I was sure that it was MasmBasic by jochen
Not really - I just modified the printf macro from the standard Masm32 lib.
In contrast to C printf, MasmBasic separates printing from the string format, which gives more flexibility, i.e. you can choose whether to print directly with
Print Str$(), or assign an intermediate string with
Let:
include \masm32\MasmBasic\
MasmBasic.inc ;
download Init mov ah, 111
Let esi=
Str$("This is a byte: %i\n", ah)
Print esi
mov cl, 222
Print Str$("This is a byte: %i", cl), " - ",
Hex$(cl), " as hex value", CrLf$
fldpi
Print Str$("... and this is PI:\n%Hf\n", ST(0))
Print "3.1415926535897932384626 is the expected value", CrLf$
Inkey "bye" Exitend start
It also can handle more input formats, e.g. xmm regs, FPU regs, REAL4... REAL10 etc.
You can even mix the input formats:
mov eax, 1000
movd xmm0, eax
fldpi
Print Str$("xmm0*ST(0)=%f\n\n", xmm0*ST(0))Output:
This is a byte: 111
This is a byte: 222 - DE as hex value
... and this is PI:
3.1415926535897932
3.1415926535897932384626 is the expected value
xmm0*ST(0)=3141.593Under the hood it's the same "if type eq REALX" technique used above for the modified printf.