tut_02mp.asm contains this line.
include win64a.inc
How are defined the external functions in this include file? Normally, the API functions should be declared with EXTERNDEF otherwise your code will import a lot of unnecessary symbols making larger your object module. Disassembling tut_02mp.obj :
H:\masm32\bin\objconv.exe -fmasm tut_02mp.obj disasm.txt
disasm.txt
option dotname
public start
extern __imp_wvsprintfW: byte
extern __imp_wvsprintfA: byte
extern __imp_wsprintfW: byte
extern __imp_wsprintfA: byte
extern __imp_mouse_event: byte
extern __imp_keybd_event: byte
.
.
.
.
extern __imp_AddLocalAlternateComputerNameW: byte
extern __imp_AddLocalAlternateComputerNameA: byte
extern __imp_AddConsoleAliasW: byte
extern __imp_AddConsoleAliasA: byte
extern __imp_AddAtomW: byte
extern __imp_AddAtomA: byte
extern __imp_ActivateActCtx: byte
@comp.id equ 00957809H
_text SEGMENT PARA 'CODE'
start PROC
sub esp, 40
xor ecx, ecx
mov rdx, offset MsgCaption
mov r8, rdx
xor r9d, r9d
call qword ptr [__imp_MessageBoxA]
xor ecx, ecx
call qword ptr [__imp_ExitProcess]
start ENDP
_text ENDS
The number of symbols defined with EXTERN is 1731. This the reason why you get a large executable.
\masm64\bin\link.exe -dump /HEADERS tut_02mp.exe
SECTION HEADER #1
.text name
23 virtual size
1000 virtual address (0000000140001000 to 0000000140001022)
200 size of raw data
200 file pointer to raw data (00000200 to 000003FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read
SECTION HEADER #2
.data name
F476 virtual size
2000 virtual address (0000000140002000 to 0000000140011475)
F600 size of raw data
400 file pointer to raw data (00000400 to 0000F9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write
F600 size of raw data. This is the size of the .data section containing all the API functions mentioned above.