Originally posted by Unregistered
into DevC++ the exe is 4kb but when i enter the same code into MSVC++ the exe is 24kb. why does msvc++ change the size so much? thanks.
Well, this code in MASM32
Code:
; ######################################
.486
.model flat, stdcall
option casemap :none ; case sensitive
; ######################################
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
main PROTO
; ---------------------
; literal string MACRO
; ---------------------
literal MACRO quoted_text:VARARG
LOCAL local_text
.data
local_text db quoted_text,0
.code
EXITM <local_text>
ENDM
; --------------------------------
; string address in INVOKE format
; --------------------------------
SADD MACRO quoted_text:VARARG
EXITM <ADDR literal(quoted_text)>
ENDM
; ##########################
.code
start:
call main
invoke ExitProcess,0
; #############################
main proc
invoke MessageBox,0,SADD("World"),SADD("Hello"),MB_OK
ret
main endp
; ###############################
end start
Makes an exe only 2.50KB. Yeah ASM wins! woo.