Assembly 我的.exe程序不是我所期望的
我的masm源文件如下: qq.asmAssembly 我的.exe程序不是我所期望的,assembly,windows-7,64-bit,masm,dosbox,Assembly,Windows 7,64 Bit,Masm,Dosbox,我的masm源文件如下: qq.asm assume cs:codesegment codesegment segment mov ax, 0ffffh mov ds, ax mov al, 00ffh mov bx, 0006h mov [bx], al mov al, [0006] mov ah, 0 mov dx, 0 mov cx, 3 s: add dx, ax loop s mov ax, 4c00h int 21h codesegment ends end 我使用masm程序生成
assume cs:codesegment
codesegment segment
mov ax, 0ffffh
mov ds, ax
mov al, 00ffh
mov bx, 0006h
mov [bx], al
mov al, [0006]
mov ah, 0
mov dx, 0
mov cx, 3
s: add dx, ax
loop s
mov ax, 4c00h
int 21h
codesegment ends
end
我使用masm程序生成一个名为qq.exe的.exe文件。当我使用debug qq.exe-u时,指导者如图所示:
我把我的qq.asm中的“mov al,[0006]”讲师变成了qq.exe中的“mov al,06”弄糊涂了。
任何帮助都将不胜感激。
[0006]
被解释为立即常数。您可以通过段替代来避免:
mov al, ds:[0006]
非常感谢@rkhb。再次感谢,我按照你的建议做了,一切都很好@rkhb。