Hi Masm32 crew,
Just opened the Forum, and the four most recent posts are about exciting issues such as
- forest fires
- somebody requesting permission to scare people with CIA badges
- a Cafeteria fight and
- the Late Mr. Frost.
So I hope I won't offend anybody if I open a new thread about, you guessed it, assembler coding:
Val MACRO pStr
push si
mov si, pStr
xor edx, edx
xor eax, eax
.While 1
lodsb
cmp al, "0"
.Break .if Sign?
lea edx, [4*edx+edx]
lea edx, [2*edx+eax-"0"]
.Endw
pop si
xchg eax, edx
EXITM <eax>
ENDM
So far, so simple - it works:
Print Str$(Val(Chr$("12345"))), " is 12345", 13, 10
The question is: Should such macros be limited to 16-bit registers, or is "mixed size" DOS code acceptable? Where would it cause problems?