大会code打印新的线串 [英] Assembly code to print a new line string
本文介绍了大会code打印新的线串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个集会code打印(显示)的字符串。我的问题是我不能够如何打印两个字符串到不同的线路!
I have an assembly code to print (display) a string. My problem is I'm not able to how print two string into different line!
.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 'Fun $'
MSG2 DB 'Day!$'
.CODE
MAIN PROC
MOV AX, @data
MOV DS, AX
LEA DX,MSG1
MOV AH,9
LEA DX,MSG2
MOV AH,9
INT 21H
MOV AH,4Ch
INT 21H
MAIN ENDP
END MAIN
输出应该是这样的:结果
The output should be like:
Fun
Day!
但结果:结果
Day!
帮帮我!结果
推荐答案
您缺少 INT 21H
要求的第一部分,这就是为什么只有第二个被打印出来。至于两行,只是追加CR LF到您的字符串。您还可以打印整个事情一次,如:
You are missing the INT 21H
call for the first part, that's why only the second is printed. As for the two lines, just append a CR LF to your string. You can also print the whole thing at once, such as:
.MODEL SMALL
.STACK 100H
.DATA
MSG DB 'Fun', 10, 13, 'Day!$'
.CODE
MAIN PROC
MOV AX, @data
MOV DS, AX
LEA DX,MSG
MOV AH,9
INT 21H
MOV AH,4Ch
INT 21H
MAIN ENDP
END MAIN
这篇关于大会code打印新的线串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文