Anyone know how to pass the byte value to this macro, I've tried numerous ways & can't get it to work :(
Neil,
Give this a blast.
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
comment * -----------------------------------------------------
Build this template with
"CONSOLE ASSEMBLE AND LINK"
----------------------------------------------------- *
.data?
value dd ?
.data
item dd 0
.code
start:
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
call main
inkey
exit
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
main proc
LOCAL mybyte :BYTE
mov al, 104
print udb$(al),13,10
mov mybyte, 99
print udb$(mybyte),13,10
ret
main endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end start
Great! thanks hutch :U I like Macros they can save you a lot of work, that's if you have learned how to use them correctly. There is not a lot of documentaion on Macros, at least I haven't found it yet & it can lead to a lot of head scratching, but with the great help available on this Forum maybe it's not necessary.
:U@echo off
\masm32\bin\ml.exe /c /coff /Fotest.obj /nologo test.asm
\masm32\bin\link.exe /subsystem:console /out:test.exe test.obj /nologo
pause
Assembling: test.asm
test.asm(25) : error A2006: undefined symbol : udb$
print(2): Macro Called From
test.asm(25): Main Line Code
test.asm(25) : error A2114: INVOKE argument type mismatch : argument : 1
print(2): Macro Called From
test.asm(25): Main Line Code
test.asm(28) : error A2006: undefined symbol : udb$
print(2): Macro Called From
test.asm(28): Main Line Code
test.asm(28) : error A2114: INVOKE argument type mismatch : argument : 1
print(2): Macro Called From
test.asm(28): Main Line Code
LINK : fatal error LNK1181: cannot open input file "test.obj"
Press any key to continue . . .
UtillMasm,
Are you saying you can't get it to work?
It works for me. The reason I'm using it is that it does the same as print ustr$ (eax) but you can do away with the instruction movzx eax,al, which should be quicker unless the Macro is slower, but then again it still simplifies things a little.
don't mind, it's not for you, because you are using masm32 verson 10.
:wink