Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly FASM x86 msg db新线_Assembly_X86_Fasm - Fatal编程技术网

Assembly FASM x86 msg db新线

Assembly FASM x86 msg db新线,assembly,x86,fasm,Assembly,X86,Fasm,我在想些什么。我继续学习一些汇编,并开始了解更多。不管怎样,让我们继续吧。这就是我所做的: org 100h ; Message 1 mov ah,09 mov dx,msg int 21h ; Message 2 ; LOL mov ah,09 mov dx,msg2 int 21h mov ah,08 int 21h ; ENd int 20h msg db "hello world!$", 0Dh, 0Ah, 0 msg2 db "made by Josh!$", 0Dh, 0Ah, 0

我在想些什么。我继续学习一些汇编,并开始了解更多。不管怎样,让我们继续吧。这就是我所做的:

org 100h
; Message 1
mov ah,09
mov dx,msg
int 21h
; Message 2
; LOL
mov ah,09
mov dx,msg2
int 21h
mov ah,08
int 21h
; ENd
int 20h
msg db "hello world!$", 0Dh, 0Ah, 0
msg2 db "made by Josh!$", 0Dh, 0Ah, 0        
然而,在msg和msg2之间,没有新的线路。它的意思是,“你好,世界!”还有“乔希做的!”我们在同一条线上。如何添加新行


另外,如果有人想评论代码本身,请这样做。我是装配新手,我真的很想学习。非常感谢

对于您正在使用的中断--“AH=09h-将字符串写入标准输出”--字符代码
$
是字符串结尾标记,而不是您认为的二进制
0

$
放在末尾以解决此问题:

msg db "hello world!", 0Dh, 0Ah, "$"
这里不需要
0
字节,为了清楚起见,最好不要使用它

这都是你的密码吗?您似乎错过了程序结束中断:

mov ah, 4Ch
mov al, 0
int 21h

(AH=4Ch-“退出”-以返回代码终止)

您可以打印新行,打印方式与打印字符串的方式非常相似,并且可以重复使用

org 100h
mov dx,msg
mov ah,9h
int 21h

mov dx,newline ;put newline in between
mov ah,9h
int 21h

mov dx,msg2
mov ah,9h
int 21h

;int 20h
mov ah,4ch
int 21h 

msg db 'Hello World$'
msg2 db 'Hello FASM$'
newline db 0dh,0ah,'$'

对谢谢你。我还在学习组装,所以我可能做错了。