我尝试回显内存位置
但结果不是char ...
如何解决这个问题??
汇编非常有趣
像回到开始学习的时间============================================== < / p>
STD_OUTPUT_HANDLE EQU -11
NULL EQU 0
GLOBAL GobleyGook
EXTERN ExitProcess, GetLastError, GetStdHandle, WriteConsoleA, WriteConsoleOutputA, FormatMessageA
SECTION .data
msg DB "Hello World!", 13, 10, "M", 0
msg.len EQU $ - msg
SECTION .bss
dummy RESD 1
text RESD 1
SECTION .text
GobleyGook:
PUSH STD_OUTPUT_HANDLE
CALL GetStdHandle
MOV DWORD[text], msg
PUSH NULL
PUSH dummy
PUSH 16
PUSH text
PUSH eax
CALL WriteConsoleA
PUSH NULL
CALL ExitProcess
在Windows 8上使用golink
nasm -f win32 print2.asm
golink.exe /console /entry GobleyGook print2.obj kernel32.dll