News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How to disable debugging information?

Started by Mikl__, April 04, 2017, 11:43:00 AM

Previous topic - Next topic

Mikl__

Hi!
I installed Visual Studio 14
There are ml64.exe and link.exe version 14.00.24210.0 in folder VC\bin\amd64.
I created simple "Hello, world!"; GUI #
include win64a.inc
.code
MsgBoxText      db "Win64 Assembly is Great!",0
MsgCaption      db "Win64 Iczelion's lesson #2: MessageBox",0
WinMain proc
push rbp
mov edx,offset MsgBoxText
lea r8,[rdx+sizeof MsgBoxText]
invoke MessageBox,NULL,,,MB_OK
pop rbp
ret
WinMain endp
end
with bat-filecls
set masm64_path=\masm64\
set filename=%~n1
call :read_settings %filename%
@echo %kind_of_file%
goto %kind_of_file%
:GUI
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%\bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed %filename%.obj %filename%.res >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed %filename%.obj >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
:: del errors.txt
exit
:DLL
if exist %filename%.dll del %filename%.dll
%masm64_path%bin\ml64 /c /Cp /I %masm64_path%include %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r  %filename%.rc >> errors.txt
if errorlevel 1 exit
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj %filename%.res /DEF:%filename%.def >> errors.txt
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj /DEF:%filename%.def >> errors.txt
)
if errorlevel 1 exit
if exist %1.res del %1.res
del %filename%.obj
del %filename%.exp
del errors.txt
exit
:read_settings
for /f "eol=# tokens=2-3" %%A in (%filename%.asm) do (
set kind_of_file=%%A
if %%B == # exit /b )
exit /b
exe-file has size 880 bytes
ml64.exe version 11.00.50727.1 and link.exe version 10.00.30319.01 made exe-file with size 640 bytes without debug information.
How to disable debugging information?

If used ml64.exe version 14.00.24210.0 and link.exe version 10.00.30319.01 made exe-file with size 640 bytes

jj2007


Mikl__

Ciao, jj2007!
Assembler is funny, but not to such an extent, I wanted to get a newer version of the compiler

jj2007

Note that the latest ML64 versions are very buggy:

ml.exe scrambles output: https://connect.microsoft.com/VisualStudio/feedback/details/1263794/ml-exe-scrambles-output-and-exists-with-exit-code-1-when-giving-full-path-to-source-file

Posted by Microsoft on 20/04/2015*):
Thank you for your feedback, we are currently reviewing the issue

see also
http://masm32.com/board/index.php?topic=5678.msg60531#msg60531
http://masm32.com/board/index.php?topic=5662.msg60775#msg60775

*) M$ takes a bit longer than the HJWasm team :P

TWell

#4
The missing option was: /nocoffgrpinfo

It took over 4 years to fix it :P
Version 14.10.25017.0

and it is difficult to them to release a small fix pack for it, all that s.. and useless c.. must come with along :(

hutch--

I chose the smaller of the two versions in VS2017 and it has not been a problem at all. The larger version had a 5 second delay in build so I gave up on it. Looks like the ML64 maintenance team left some testing/debug code in it and rendered it close to useless. The smaller version has not problems with XMM and YMM registers and the instructions I have tested so far. Seems like the Watcom versions are not the only ones in development.  :P

Mikl__

TWell,
many thanks for the help and for the link which you gived in the letter!
ml64.exe and link.exe version 14.00.24210.0 made exe-file with size 640 bytes

felipe

Quote from: Mikl__ on April 04, 2017, 11:43:00 AM
   lea r8,[rdx+sizeof MsgBoxText]

Mikl__ i will not get tired of seeing your examples!  :biggrin:

:icon14: