我正在尝试让我的程序在两个不同的行上显示一个字符串。
这是一个.com程序,我正在使用A86汇编程序。
jmp start ; This will start the program
;============================
msg db "Hello Word.$" ; A string variable
msg db "Michael J. Crawley$" ; A string variable with a value.
;============================
start:
mov ah,09 ; subfunction 9 output a string
mov dx,offset msg ; DX for the string
int 21h ; Output the message
int 21h ; Output the message
exit:
mov ah,4ch
mov al,00 ; Exit code
int 21h ; End program
这是您的特定问题:
msg
(a86会否决)。这些问题的解决方案(不提供实际代码)。>>
msg2
。msg2
加载到dx中。更新:
jmp start ; This will start the program msg db "Hello Word.",0a,"$" ; A string variable . msg2 db "Michael J. Crawley$" ; A string variable with a value. start: mov ah,09 ; subfunction 9 output a string mov dx,offset msg ; DX for the string int 21h ; Output the message mov dx,offset msg2 ; DX for the string int 21h ; Output the message exit: mov ah,4ch mov al,00 ; Exit code int 21h ; End program
此输出:
Hello Word.
Michael J. Crawley
味精的两个定义?
我不熟悉a86,但是对于NASM和MASM,您需要在com程序的开头使用“ org 100h”汇编程序指令。现在的方式是,偏移量msg为0x2,它将尝试从程序段前缀的第二个字节(一个16位的字,用于保存您可用的内存顶部的段)开始打印。