News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

an error in masm6.14

Started by debugee, April 21, 2011, 06:57:50 AM

Previous topic - Next topic

debugee

;;;;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.

jj2007

Interesting. ML 9.0 does the same, only JWasm pops the "uses".

qWord

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.
FPU in a trice: SmplMath
It's that simple!

debugee

Hi qWord
Thanks for reply,I also find that what you say about,it is really strange.

debugee

hutch--

debugee,

Try this.


.data

IFIDNI <y>,<>
sym db 0
ELSE
sym db y,0
ENDIF

.code
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

debugee

hi hutch--

thanks for your reply :U :U

debugee