My .exe program is not what I expected

My masm source file is as follows:

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 

I use the masm program, generates a .exe file called qq.exe. When I use debug qq.exe -u, the following instructors are in the picture: picture

I was confused that the "mov al, [0006]" instructor in my qq.asm turned to "mov AL, 06" in qq.exe. Any help would be appreciated.

+5
source share
1 answer

[0006] interpreted as an immediate constant. You can avoid this by canceling the segment:

 mov al, ds:[0006] 
+3
source

Source: https://habr.com/ru/post/1208361/


All Articles