利用DOS系统功能调用编写汇编程序,在屏幕上显示自己姓的拼音和学号的后4个数字符号。 - 爱问答

(爱问答)

利用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

其它的,你自己测试下

下一篇:vi的哪种模式可以执行shell命令A.插入模式B.命令模式C.底行模式D.以上都不对

上一篇:java定义-个类的语法是什么?

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?