News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Feedback on masm64 Version 2 Beta.

Started by hutch--, July 02, 2022, 04:34:46 PM

Previous topic - Next topic

hutch--

This is very close to being a release version, a new editor, examples tidied up, everything seems to work OK and I hope there are few if any errors. Feedback would be very useful to ensure it is all working OK.

jj2007

Hi Hutch,

Your example at \Masm64\Examples\Simple\dlltest is slightly confusing: it seems not a dynamic load but rather a static link to a library.

Otherwise fine so far, everything works as expected except the print macro:

  print chr$("Hello World")

00000001400010FF | FF15 DF100000          | call [<&WriteFile>]      |
0000000140001105 | 4C:8B75 88             | mov r14,[rbp-78]         |
0000000140001109 | 4C:8B7D 80             | mov r15,[rbp-80]         |
000000014000110D | 48:8B45 90             | mov rax,[rbp-70]         | [rbp-70]:"È€"
0000000140001111 | C9                     | leave                    |
0000000140001112 | C3                     | ret                      |
...
0000000140001120 | 4C:8BC9                | mov r9,rcx               |
0000000140001123 | 48:8BCA                | mov rcx,rdx              |
0000000140001126 | 4D:03C8                | add r9,r8                |
0000000140001129 | 48:C7C0 FFFFFFFF       | mov rax,FFFFFFFFFFFFFFFF |
0000000140001130 | 48:83C0 01             | add rax,1                |
0000000140001134 | 48:0FB61401            | movzx rdx,[rcx+rax]      | <<<<<<<<<<<<<<<<< chokes
0000000140001139 | 41:881401              | mov [r9+rax],dl          |
000000014000113D | 48:85D2                | test rdx,rdx             |
0000000140001140 | 75 EE                  | jne 140001130            |
0000000140001142 | 49:03C0                | add rax,r8               |
0000000140001145 | C3                     | ret                      |


Digging deeper, I find this:
mcat MACRO pbuff:REQ,args:VARARG
LOCAL acnt
acnt = argcount(args)
invoke szmulticat,pbuff,acnt,args
ENDM

print MACRO pmem:REQ,args:VARARG
ifnb <args>            ; *** my suggestion ***
mcat pmem, args
endif
invoke StdOut,pmem
ENDM


It would be nice if \Masm64\help\MasmHelp.exe were searchable; so far, I couldn't find the print documentation.

hutch--

Its in the macro file. As you can imagine, the documentation is a genuine joy to produce but for the library, there is the configured text browser. Macros have to be searched in the macro file.

As per the makeit.bat file,

\masm64\bin64\polink.exe /SUBSYSTEM:WINDOWS /ENTRY:entry_point /LARGEADDRESSAWARE %appname%.obj dll\test.lib

As you would be aware, a DLL can be either dynamically linked or statically linked.

jj2007

Quote from: hutch-- on July 02, 2022, 09:31:29 PM
Its in the macro file

That's where I found it. Still, a print "hello" works fine with the Masm32 SDK but will produce an access violation with the Masm64 SDK. N00bs might be put off by such behaviour...

QuoteAs per the makeit.bat file,

\masm64\bin64\polink.exe /SUBSYSTEM:WINDOWS /ENTRY:entry_point /LARGEADDRESSAWARE %appname%.obj dll\test.lib

As you would be aware, a DLL can be either dynamically linked or statically linked.

I know. However, test.lib doesn't sound like dynamically linked library, but I don't want to argue.

TimoVJL

Quote from: hutch-- on July 02, 2022, 09:31:29 PM

\masm64\bin64\polink.exe /SUBSYSTEM:WINDOWS /ENTRY:entry_point /LARGEADDRESSAWARE %appname%.obj dll\test.lib

As you would be aware, a DLL can be either dynamically linked or statically linked.
with Win64 linking, linker option /LARGEADDRESSAWARE is useless.
dll can be used with run-time dynamic linking or with import library, and sometimes using COM interface.
May the source be with you

hutch--

JJ,

"print" worked in masm32, in masm64, its "conout" ALA documentation.

> with Win64 linking, linker option /LARGEADDRESSAWARE is useless.

Timo,
I have heard this before but this is MASM, not C or C++. Remove /LARGEADDRESSAWARE and you can use old mnemonic constructions but at the cost of no memory access over 2 gig. If you want to use far more memory, use /LARGEADDRESSAWARE. Allocate 32 gig if your box has enough memory.

TimoVJL

/LARGEADDRESSAWARE (Handle Large Addresses)
QuoteRemarks

The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. In the 64-bit compilers, this option is enabled by default. In the 32-bit compilers, /LARGEADDRESSAWARE:NO is enabled if /LARGEADDRESSAWARE is not otherwise specified on the linker line.
May the source be with you

hutch--

 :biggrin:

> In the 64-bit compilers .....

This is a command line for MASM. If you try and use an old format instruction that is not supported by Win64, you get an error message telling you to turn /LARGEADDRESSAWARE:NO on and this is specifically with ML64.EXE.

learn64bit

#8
I am Wrong, No bug, just me messed up my masm64 include folder...

A bug?


\masm64\bin64\ml64.exe /Cp /c /I"." tut_37i.asm
rem sha1sum:3c2fe112dd968f0314fec4bcf9f4573fee70ba9c
rem temphls.inc(86) : error A2008: syntax error : retn
rem sha1sum:3ffab569fbdd1bbb36392dff842d6d016b4ab928
rem ntdll.inc(4016) : error A2008: syntax error : equ
rem sha1sum:262c574472879d1dafbe0b70672e57d1efae82ba
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:29641f0d7bb9391361aad8e6f6b57ad809d460eb
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:0ae5e4580f83b86f20d093029d21fe93e6dd5168
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:bd0406bfd0c1a5dc78732f69e2bd669bc7fa6fd7
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:c1805d31258ce61f6ed6530811845b32bb967d94
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:abe0d2946f67c94536aab699f67e96da072d9498
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:9eb911f8e6f3ba0f81fafefc8413c8f9123789e6
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:377adc827aa3d9f82bf066b2b67d5b85c018dbd1
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:292f414b809f2798bfa5a5bedd3583f7b56d87b3
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:b268660c4c424d8ad4c16df96c8816bffd77ab90
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:7f38980506b9ebd725a36b307366cd01940b5fa5
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:b1f4c26506b623c36ef605b9e1381f9633a6673d
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:95e6600902af8fca88719e74dd6665012ed347b2
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:b14e8629049f825d92c29f003a9f5a53d7c82660
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:78601ae3e99a8582fdcbe42491326560d9cf6362
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem sha1sum:4241e6baa8ef5b01f1ca346315876ecd1c2850ad
rem ntdll.inc(4016) : error A2008:syntax error : equ
rem Maybe a bug!


ntdll.inc
line:4106

tampering:
fabs equ <__imp_fabs>
to
_fabs equ <__imp_fabs>

Yes, it works.

hutch--

With the lines,

externdef __imp_fabs:PPROC
fabs equ <__imp_fabs>

Versus

externdef __imp_fabs:PPROC
_fabs equ <__imp_fabs>


What is the difference ? Both equate to the same value. Is it a problem of the name "fabs" ?

Intel manual

FABS—Absolute Value

hutch--

Here is a variation for you. The dot prefix is enabled in MASM64 which allows you to keep the same name in a readable form. FABS is an Intel mnemonic.

externdef __imp_fabs:PPROC
.fabs equ <__imp_fabs>



quarantined

Upon doing a fresh installation of Masm64 to test the installation I started assembling the example files. (What a better way to test the install than with the examples)
Everything was assembling, linking, resources compiling, etc until I got to  \masm64\examples\simple\bigicon\...

Errors:
The system cannot find the path specified.
The system cannot find the path specified.
Volume in drive C has no label.
Volume Serial Number is 6835-0838

Directory of C:\masm64\Examples\Simple\bigicon

05/07/2022  10:23 PM             1,942 bigicon.asm
               1 File(s)          1,942 bytes
               0 Dir(s)  11,272,355,840 bytes free
Press any key to continue . . .



Batch file:
@echo off

set appname=bigicon

if exist %1.obj del %appname%.obj
if exist %1.exe del %appname%.exe

\masm64\bin64\porc64.exe rsrc.rc

\masm32\bin64\ml64.exe /c %appname%.asm

\masm32\bin64\Polink.exe /SUBSYSTEM:WINDOWS /ENTRY:entry_point /LARGEADDRESSAWARE %appname%.obj rsrc.res

dir %appname%.*

pause


Had no problems creating executables for all of the other examples. I stopped at this point..
So, I'm asking other forum members to assemble that file in their computer to see if it is something wrong with my install or not. I don't think there is as the others assembled without any apparent issues.

and heres whats in my bin64/1033 folders...

Directory of C:\masm64\bin64
06/04/2022  05:55 PM                66 assemble.bat
08/18/2022  11:07 AM            42,512 cvtres.exe
08/18/2022  11:07 AM            21,424 dumpbin.exe
08/18/2022  11:07 AM            21,424 editbin.exe
05/10/2022  06:57 AM               949 FileList.txt
08/18/2022  11:07 AM            21,424 lib.exe
08/18/2022  11:07 AM         1,987,528 link.exe
08/18/2022  11:07 AM           467,904 ml64.exe
08/18/2022  11:07 AM           101,800 msobj140.dll
08/18/2022  11:07 AM           317,856 mspdb140.dll
08/18/2022  11:07 AM         1,352,176 mspdbcmf.exe
08/18/2022  11:07 AM           636,328 mspdbcore.dll
08/18/2022  11:07 AM           134,096 mspdbsrv.exe
08/18/2022  11:07 AM           608,688 mspdbst.dll
08/18/2022  11:07 AM         2,017,680 mspft140.dll
08/18/2022  11:07 AM         1,231,264 msvcdis140.dll
08/18/2022  11:07 AM           439,200 msvcp140.dll
08/18/2022  11:07 AM           108,512 nmake.exe
08/19/2018  12:32 PM           460,800 poasm.exe
03/21/2015  09:26 AM            79,360 polib.exe
03/21/2015  09:28 AM           152,576 polink.exe
03/21/2015  09:48 AM           176,128 porc64.dll
03/21/2015  09:48 AM            48,640 porc64.exe
03/18/2019  02:50 AM            70,088 RC.Exe
06/26/1995  11:03 PM           136,161 rc.hlp
03/18/2019  02:50 AM           424,904 RcDll.Dll
08/18/2022  11:07 AM            88,976 tbbmalloc.dll
01/05/2022  12:44 PM            87,352 vcruntime140.dll

Directory of C:\masm64\bin64\1033

05/10/2020  06:09 PM            34,176 atlprovui.dll
05/10/2020  06:09 PM            16,768 bscmakeui.dll
05/10/2020  06:09 PM           564,104 clui.dll
05/10/2020  06:09 PM            13,696 cvtresui.dll
05/10/2020  06:09 PM            88,960 linkui.dll
02/20/2017  07:36 PM            23,720 LocalESPCui.dll
05/10/2020  06:09 PM            15,240 mspdbcmfui.dll
05/10/2020  06:09 PM            84,560 mspft140ui.dll
05/10/2020  06:09 PM            21,376 nmakeui.dll
02/20/2017  07:36 PM            26,288 pgort140ui.dll
05/10/2020  06:09 PM            27,520 pgoui.dll

quarantined

Quote from: swordfish on August 19, 2022, 06:20:34 AM
Everything was assembling, linking, resources compiling, etc until I got to  \masm64\examples\simple\bigicon\...

I just tested the rest of the examples with my Masm64 setup. The rest of them produced an executable without any problems.
I cannot find anything wrong with the code or batch file for 'bigicon.asm'. So it is a complete mystery to me why I can't assemble just this one file.   :sad:


ml64.exe version 14.33.31629.0
link.exe version 14.33.31629.0
polink.exe version 8.0.2.0
porc64.exe version 8.0.2.0
rc.exe version 10.0.18362.1

jj2007

Quote from: swordfish on August 19, 2022, 06:20:34 AM
Everything was assembling, linking, resources compiling, etc until I got to  \masm64\examples\simple\bigicon\...

Open the file in RichMasm and hit F6. Works like a charm :tongue:

quarantined

Quote from: jj2007 on August 19, 2022, 08:26:32 AM
Open the file in RichMasm and hit F6. Works like a charm :tongue:
:rolleyes: Ok. Wait right there and hold your breathe until I do.  :badgrin:
No, seriously why can't I assemble that one file?