如何在程序集的消息上打印寄存器

问题描述

我开始使用emu8086学习汇编

我正在编写包含在 Emu8086 上的名为“比较数字”的示例代码

代码是这样的:

name "flags"

org 100h

; Now a little game:
game:  mov dx,offset msg1
       mov ah,9
       int 21h

       ; read character in al:
       mov ah,1 
       int 21h

       cmp al,'0'
       jb stop

       cmp al,'9'
       ja stop

       cmp al,'5'
       jb below
       ja above
       mov dx,offset equal_5
       jmp print
below: mov dx,offset below_5     
       jmp print
above: mov dx,offset above_5
print: mov ah,9
       int 21h
       jmp game  ; loop.


stop: ret  ; stop


msg1 db "enter a number or any other character to exit:  $"
equal_5 db " is five! (equal)",0Dh,0Ah,"$"
below_5 db " is below five!","$"
above_5 db " is above five!","$"

我正在寻找的是在“equal_5”消息上添加一个寄存器以具有以下内容

equal_5 db "[content of al o any other register] is equal five! ","$"

在简历中,我想知道如何在消息中打印寄存器。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)