实验六报告
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实验6 模块化程序设计
一.实验目的:
(1)熟悉子程序库的建立步骤。
(2)熟悉对库文件的修改(添加、删除)。
二.实验内容:
主模块A编程:设计一个能实现加、减、乘、除计算的程序,要求该程序接受从键盘输入的两个十六进制数,调用相应的程序模块执行相应的计算后,计算结果以十六进制数输出。
模块B编程:实现两个十六进制数相加。
模块C编程:实现两个十六进制数相减。
模块D编程:实现两个十六进制数相乘。
模块E编程:实现两个十六进制数相除。
(1)将各模块分别汇编为.OBJ文件;
(2)应用LIB命令建立子程序库TST.LIB,里面包含BINHEX.OBJ和HEXD.OBJ。
(3)将各模块ZHSY2_3_A.OBJ、ADDOPT.OBJ、SUBOPT.OBJ、MULOPT.OBJ、DIVOPT.OBJ、INNUM.OBJ、OUTNUM.OBJ和子程序库TST.LIB相连接为一个可执行程序ZHSY2_3_A.EXE。
(4)应用DEBUG命令调试ZHSY2_3_A.EXE,注意调试时T命令和P命令的应用。
1、编译: c:\masm .asm
2、链接: c:\link .obj
3、调试: c:\debug .exe
4、运行: c:\ .exe
(1)1、编译:子程序 C:\masm .asm
c:\masm>masm 6-1
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-1.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50352 + 415152 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-2
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-2.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50394 + 415110 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-3
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-3.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50394 + 415110 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-4
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-4.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50394 + 415110 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-5
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-5.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50432 + 415072 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-6
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-6.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50356 + 415148 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-7
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-7.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50356 + 415148 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-8
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-8.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50356 + 415148 Bytes symbol space free
0 Warning Errors
0 Severe Errors
c:\masm>masm 6-9
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987. All rights reserved.
Object filename [6-9.OBJ]:
Source listing [NUL.LST]:
Cross-reference [NUL.CRF]:
50356 + 415148 Bytes symbol space free
0 Warning Errors
0 Severe Errors