利用DOS系统功能调用编写汇编程序,在屏幕上显示自己姓的拼音和学号的后4个数字符号。
求大神帮助!!!急急急!!!
例如,你姓“李”,你的学号是“20191234”,则在屏幕上显示出“LI:1234”。具体要求如下:(1)编写出完整的汇编语言程序;(2)利用宏汇编程序MASM和连接程序LINK对所编写的程序进行汇编和连接,生成可执行文件,并在DOS下运行程序。(3)打印出相应的列表文件(后缀lst的文件)清单,并对调试运行结果进行截图,以证明程序调试成功。
完整的程序参考
; multi-segment executable file template.
assume cs:code
data segment
; add your data here!
disp db "LI:1234$"
data ends
stack segment stack
dw 128 dup(0)
stack ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
; add your code here
lea dx, disp
mov ah, 9
int 21h ; output string at ds:dx
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
code ends
end start ; set entry point and stop the assembler.
列表文件
Microsoft (R) macro Assembler Version 5.00 11/26/19 12:17:18
Page 1-1
; multi-segment executable file template.
assume cs:code
0000 data segment
; add your data here!
0000 4C 49 3A 31 32 33 34 disp db "LI:1234$"
24
0008 data ends
0000 stack segment stack
0000 0080[ dw 128 dup(0)
0000
]
0100 stack ends
0000 code segment
0000 start:
; set segment registers:
0000 B8 ---- R mov ax, data
0003 8E D8 mov ds, ax
0005 8E C0 mov es, ax
; add your code here
0007 8D 16 0000 R lea dx, disp
000B B4 09 mov ah, 9
000D CD 21 int 21h ; output string at ds:dx
; wait for any key....
000F B4 01 mov ah, 1
0011 CD 21 int 21h
0013 B8 4C00 mov ax, 4c00h ; exit to operating system.
0016 CD 21 int 21h
0018 code ends
end start ; set entry point and stop the assemb
ler.
Microsoft (R) macro Assembler Version 5.00 11/26/19 12:17:18
Symbols-1
Segments and Groups:
N a m e Length Align Combine Class
CODE . . . . . . . . . . . . . . 0018 PARA NONE
DATA . . . . . . . . . . . . . . 0008 PARA NONE
STACK . . . . . . . . . . . . . 0100 PARA STACK
Symbols:
N a m e Type Value Attr
DISP . . . . . . . . . . . . . . L BYTE 0000 DATA
START . . . . . . . . . . . . . L NEAR 0000 CODE
@FILENAME . . . . . . . . . . . TEXT mytest
37 Source Lines
37 Total Lines
7 Symbols
51184 + 406464 Bytes symbol space free
0 Warning Errors
0 Severe Errors
其它的,你自己测试下