Check your parameters...
include \Masm32\MasmBasic\Res\JBasic.inc ; ## builds in 32- or 64-bit mode with UAsm, ML, AsmC ##
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.")
PrintLine "This small program is supposed to determine the length of a file:"
hTheFile equ <rbx>
mov hTheFile, rv(CreateFileA, Chr$("GetFileSize.asc"), GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
jinvoke GetFileSize, hTheFile, 0
Print Str$("The file size is %i bytes\n", rax)
jinvoke CloseHandle, hTheFile
Inkey "all is fine"
EndOfCode
Output:
This program was assembled with ml64 in 64-bit format.
This small program is supposed to determine the length of a file:
The file size is 4254 bytes
all is fine
Of course, if you are dealing with large files, you need a second argument to get the high dword.