.386
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib
Main proto
.data
hOutput dd 0
bReadWritten dd 0
szText1 db "What's your name?",0
hInput dd 0
szInput db 128 dup(0)
.data?
.code
start:
Invoke Main
Invoke ExitProcess,0
Main proc
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hOutput, eax
invoke GetStdHandle,STD_INPUT_HANDLE
mov hInput, eax
invoke lstrlen, addr szText1
invoke WriteFile, hOutput, addr szText1, eax, ADDR bReadWritten, NULL
invoke ReadFile, hInput, addr szInput, 128, ADDR bReadWritten,0
ret
Main endp
end start
执行此程序后没有任何反应。为什么没有出现控制台窗口?
后记
组装选项(winAsm):
/Zi /Zd /c /coff /Cp /nologo
链接器选项
/SUBSYSTEM:WINDOWS /DEBUG /DEBUGTYPE:CV /VERSION:4.0 /INCREMENTAL:NO