;;;;can somebody tell me why?
.386
.model flat,stdcall
option casemap:none
CTEXT MACRO y:VARARG
LOCAL sym
_DATA segment
IFIDNI <y>,<>
sym db 0
ELSE
sym db y,0
ENDIF
_DATA ends
EXITM <OFFSET sym>
ENDM
.code
main proc uses ebx esi edx
mov eax,CTEXT("this is a test!")
ret
main endp
start:
jmp main
end start
00401000 > /53 PUSH EBX
00401001 . |56 PUSH ESI
00401002 . |52 PUSH EDX
00401003 . |B8 00204000 MOV EAX,bug.00402000 ; ASCII "this is a test!"
00401008 . |5A POP EDX
00401009 > $^\EB F5 JMP SHORT bug.00401000
0040100B . C3 RETN
0040100C 00 DB 00
0040100D 00 DB 00
0040100E 00 DB 00
Added code tags.
Interesting. ML 9.0 does the same, only JWasm pops the "uses".
This problem is well knowen to me: masm simply cooks sometimes when using SEGMENT/ENDS inside procs. The only solution is to use .data/.code to switch the segments - as long as not using your own defined code segments it should be no problem.
Hi qWord
Thanks for reply,I also find that what you say about,it is really strange.
debugee
debugee,
Try this.
.data
IFIDNI <y>,<>
sym db 0
ELSE
sym db y,0
ENDIF
.code
hi hutch--
thanks for your reply :U :U
debugee