'Moving procedure inside the code causes it to execute without being called
here is an assembly program written in emu8086 esimulator.
.MODEL SMALL
.STACK
.DATA
msg db 10,13,"i am being called from the macro$"
.CODE
MOV AX, @DATA
MOV DS,AX
hehe PROC
MOV DX, OFFSET msg
MOV AH,09h
INT 21h
RET
hehe ENDP
call hehe
call hehe
MOV AX,4C00h
INT 21h
END
The call statement is called just once but as I tried moving the procedure here and there inside .code I found that the output was because of the procedure itself not by the call function. What am I doing wrong here?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|