MASM is reasonably successful at emulating some of the capacity of popular high level languages but its always been very poor at actually getting the same size output file so here is a macro that levels the playing field a little. Judicious use of this macro will make the non-informed user think you wrote the APP in CPP or Delphi.
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
comment * -----------------------------------------------------
Build this template with
"CONSOLE ASSEMBLE AND LINK"
----------------------------------------------------- *
bloat MACRO lang
LOCAL cntr
IFIDN <lang>,<CPP>
echo Emulating C++
cntr = 50000
ELSEIFIDN <lang>,<DELPHI>
echo Emulating Delphi
cntr = 50000
ELSEIFIDN <lang>,<C>
echo Emulating C with standard runtime libraries
cntr = 25000
ELSEIFIDN <lang>,<PASCAL>
echo Emulating procedural Pascal
cntr = 20000
ELSEIFIDN <lang>,<BASIC>
echo Emulating a basic compiler
cntr = 5000
ELSEIFIDN <lang>,<CNRT>
echo Emulating C without the runtime library
cntr = 1000
ELSEIFIDN <lang>,<ASM>
EXITM
ELSE
echo "Please wait, this OP is slow"
cntr = 100000
ENDIF
REPEAT cntr
nop
ENDM
align 16
ENDM
.code
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
call main
exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
main proc
cls
print "Hello World",13,10
ret
bloat CPP
main endp
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
:bdg :bdg :bdg :bdg :bdg :bdg :bdg :bdg
:naughty: Size is not sufficient! There's still the problem of the speed of execution... :bdg
:U
You forgot:
IFIDN <developer>,<MICRO$OFT>
WHILE 1
nop
ENDM
LOL. Just the thing for those occasions when your code is just too quick and/or small :)
regards,
-Brent
:lol
actually I beat C size with asm proggy, without intentionally fill program with bloat, my asm program is whopping 1 058 816 byte
its a dx9 program which only displays a textured triangle(this is without texture), so I dont know if my includes are included automatically +included by includes could be the problem