News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Ml64 If/else problem

Started by ragdog, January 13, 2017, 05:11:55 AM

Previous topic - Next topic

TouEnMasm

" bit tedious and badly documented as usual."
I agree with that  :toothy:.
As the subject is ML64 bits,I was speaking about ML64.exe .
Too bad,another hope who fall.
Stay,a modify of vasily.inc,must be possible.
Fa is a musical note to play with CL

TouEnMasm

#16
 :icon_idea:
I modify the vasily.inc so now,he recognize != instead of {}
I have put ECHO to follow the macro path.
I have made two modifies with two comments ;------ToutEnMasm modify -----
You don't need any more include to make it run,ML64 is enough.It's the minimal version that I have always posted + vasily.inc.

---------------------------------------------- LATER ------------------------------------------------------------------
don't work,made an error on }
Bad news,I had no see that the char ! and < aren't view by the ECHO,ALL is lost,must stay as it is,it is better
Fa is a musical note to play with CL

TouEnMasm

Hello,
Surprise, I refind this post searching in the web.
I take the opportunity to make a hello at microsoft.
The bug is in the title,the sign ! disappear when put in a constant.


include master_ml64.inc
includelib msvcrt.lib
;Microsoft (R) Macro Assembler (x64) Version 14.28.29914.0
;https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
;http://masm32.com/board/index.php?topic=5941.15
;imagehelp.sdk
MessageBox MACRO hWnd:REQ,lpText:REQ,lpCaption:REQ,uType:REQ
IFDEF __UNICODE__
externdef __imp_MessageBoxW:PPROC
invoke __imp_MessageBoxW,hWnd,lpText,lpCaption,uType
ELSE
externdef __imp_MessageBoxA :PPROC
invoke __imp_MessageBoxA,hWnd,lpText,lpCaption,uType
ENDIF
EXITM<>
ENDM

.const

essai TEXTEQU <"bug here-!-'{&#-|([-|`_\ç^à@)]=}²ô$¤!r">
;ASCII printable characters (character code 32-127)
.data
chaineascii db "a",32,"a",33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56
db 57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81
db 82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106
db 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,0


titre db essai,0
;-------------------
.code
WinMain proc hInst:QWORD,hPrevInst:QWORD,lpCmdLine:QWORD,nShowCmd:DWORD
Local hr:QWORD
MessageBox ( NULL,addr chaineascii,addr titre,MB_OK)
ret
WinMain endp
end
Fa is a musical note to play with CL

TouEnMasm


Difficult to say if this is a bug or this is because the Hight level Syntax had been deleted from ml64.
The ml 32 Microsoft (R) Macro Assembler Version 14.28.29914.0,show the same thing in the messagebox
but allow !=

;include \masm32\include\
include H:\masm32\include\masm32rt.inc
include H:\masm32\include\windows.inc
includelib user32.lib

;Microsoft (R) Macro Assembler Version 14.28.29914.0
;https://docs.microsoft.com/en-us/windows/win32/debug/pe-format
;http://masm32.com/board/index.php?topic=5941.15

;--------
.const

essai TEXTEQU <"bug here-!-'{&#-|([-|`_\ç^à@)]=}²ô$¤!r">
;ASCII printable characters (character code 32-127)
.data
chaineascii db "a",32,"a",33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56
db 57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81
db 82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106
db 107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,0


titre db essai,0
;-------------------
.code
;WinMain proc hInst:QWORD,hPrevInst:QWORD,lpCmdLine:QWORD,nShowCmd:DWORD
start:
mov eax,1
.if eax != 0           ; HLL and not a normal Macro ?
invoke MessageBox ,NULL,addr chaineascii,addr titre,MB_OK
.endif
;ret
;WinMain endp
end start

Fa is a musical note to play with CL

jj2007

include \masm32\include\masm32rt.inc
.code
start:
  tmp$ CATSTR <inkey "** line >, %@Line, <: ever tried to use a string with !<brackets!> ? **">
  % tmp$
  exit
end start


Strangely enough, in this case it works without the escape characters. But I have seen many cases where it didn't.