【发布时间】:2020-02-19 21:36:18
【问题描述】:
Console equ -11
extern GetStdHandle: PROTO
extern WriteFile: PROTO
extern ReadFile: PROTO
extern ExitProcess: PROTO
.data
num1 byte ?
num2 word ?
num3 dword ?
num4 qword ?
stdin qword ?
stdout qword ?
numWrite qword ?
.code
mainCRTStartup PROC
sub rsp, 40 ;reserve shadow space
mov rcx, CONSOLE
call GetStdHandle
mov stdin, rax
;Storing information into memory
mov num1, 6dh
mov num2, 7361h
mov num3, 7369206dh
mov rax, 216e754620h
mov rcx, stdout ;parm1 = console
lea rdx, num2 ;parm2 = ASCII
;parm3 = total #bytes to display
mov r8, 15
lea r9, numWrite
mov qword ptr [rsp+32], 0
call ReadFile
add rsp, 40
mov rcx, 0
call ExitProcess
mainCRTStartup ENDP
END
【问题讨论】:
-
你能把它们传给 printf 吗?如果不是,您必须自己进行数字 -> 字符串转换。 How do I print an integer in Assembly Level Programming without printf from the c library?
标签: windows winapi assembly x86-64