So people in the forum need to pay attention, Including JJ and everyone else. As you can see, it's so easy to use grammar in MASM64SDK, As MASM32SDK. All this is due to Mr. HUTCH's excellent work and extraordinary contribution. He reprogrammed 64-bit MASM library files and advanced macro inclusion files, Designed powerful. IF .ENDIF, WHILE .ENDW,. REPEAT .UNTIL and other advanced syntax macros, A powerful and reliable MASM64SDK. for all developers I have no problem using these advanced syntax macros, Use masm64 as smoothly as use C. Dear JJ, It's time, Come back to all the friends who have scorned MASM64, Get everyone back to HUTCH, Let HUTCH regain the unity and warmth of the MASM32 era. All of us in MASM64 arms, Spring with a 64-bit architecture, Let the development of human computer software development in the history of our due clear footprint!
Dear Steven,
I am not against 64-bit Assembly per se. As soon as somebody demonstrates that it's 20% faster than 32-bit code, I'll join the crowd :tongue:
include \Masm32\MasmBasic\Res\JBasic.inc ; ## console demo, builds in 32- or 64-bit mode with UAsm, ML, AsmC ##
usedeb=1 ; use the deb macro
.code
SayHi proc <cb> arg:SIZE_P ; <cb> indicates ok for usage as a callback function; the arg is a pointer
jinvoke MessageBox, 0, arg, Chr$("Hi"), MB_OK or MB_SETFOREGROUND
ret
SayHi endp
Init ; OPT_64 1 ; put 0 for 32 bit, 1 for 64 bit assembly
Cls
PrintLine Chr$("This program was assembled with ", @AsmUsed$(1), " in ", jbit$, "-bit format.")
Print ComCtl32$("It uses common controls version %i.%i\n\n") ; see EndOfCode below
xor rbx, rbx
ifidni @Environ(oAssembler), <ml64>
@@: Print Str$("%i ", rbx) ; Microsoft version of a .Repeat ... .Until loop
inc rbx
cmp rbx, 20
jle @B
else
.Repeat
Print Str$("%i ", rbx) ; UAsm & AsmC version
inc rbx
.Until rbx>20
endif
mov al, 123
movzx eax, al ; same result as movzx rax, al but shorter
if @64 ; use @64 (set by opt_64 n) for conditional assembly
Print Str$(" \nrax is %lli\n\n", rax)
mov rax, 1234567890123456789
Print Str$("rax can be a really big number: %lli\n\n", rax)
else
Print Str$(" \nrax is %i\n\n", rax)
mov eax, 123456789
Print Str$("eax has only 32 bits, big enough: %i\n", eax)
endif
fldpi ; the FPU works fine in x64
sub rsp, QWORD
fld st
fistp qword ptr [esp]
movlps xmm0, qword ptr [esp]
fst qword ptr [esp]
movlps xmm1, qword ptr [esp]
add rsp, QWORD
deb 4, "Even dual assembly has a deb macro:", x:rbp, x:rsp, x:rip, xmm0, f:xmm1, ST(0)
Print "Type a number: "
Print Str$("The value of your number is %i\n", Val(Input$()))
PrintLine Chr$(jbit$, "-bit assembly is easy, it seems...")
push 111 ; demonstrate that locals are zeroed
push 222
push 333
push 444
add rsp, 4*SIZE_P
jinvoke SayHi, Chr$("Wow, it works!!!!")
EndOfCode
:biggrin:
That's easy, open a 32 gigabyte file and do a speed comparison. :tongue: