Str$ macro works only with dd variables, but not less or more.
What should I do to display with print db, dw, ax, etc ?
Thanks
Sorry for all my noob's questions...
there are a few different ways to do it
one way is to use MOVSX, assuming you want to treat them as signed values
;for a byte
movsx eax,byte ptr MyByte
print str$(eax)
;for a word
movsx eax,word ptr MyWord
print str$(eax)
MOVSX converts signed bytes or words to dwords by sign-extending them
MOVZX is similar - it converts unsigned bytes or words to dwords by zero-extending them
Quote from: ookami on February 18, 2011, 11:50:58 AM
Str$ macro works only with dd variables, but not less or more.
The Masm32 library macro is lowercase
str$() and is indeed meant for dwords.
In contrast, the MasmBasic (http://www.masm32.com/board/index.php?topic=12460)
Str$ macro swallows almost everything, including byte and word registers, xmm regs, REAL vars, qwords etc.
Thank you. :bg