从寄存器连接字符串并打印它们

时间:2016-05-11 14:07:19

标签: assembly masm cpuid

我正在尝试调用cpuid并将EBX,ECX和EDX的输出打印到控制台,但它打印出空行而不是

这是我的代码:

.586 

.model flat,stdcall 

option casemap:none 

include \masm32\include\windows.inc 
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib  

.data
.data?
mybuffer byte 100 dup(?)

.code 
start: 

mov      eax, 0
cpuid

invoke   lstrcpy, addr mybuffer, ebx   
invoke   lstrcat, addr mybuffer, ecx
invoke   lstrcat, addr mybuffer, edx

invoke   GetStdHandle, STD_OUTPUT_HANDLE
invoke   WriteConsole, eax, addr mybuffer, sizeof mybuffer, NULL, NULL

invoke   ExitProcess, 0

end start

0 个答案:

没有答案