最佳答案
我是一个装配初学者,我不知道所有的 db,dw,dd,东西是什么意思。 我尝试编写这个小脚本,它执行1 + 1操作,将其存储在一个变量中,然后显示结果。以下是我目前的代码:
.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib
.data
num db ? ; set variable . Here is where I don't know what data type to use.
.code
start:
mov eax, 1 ; add 1 to eax register
mov ebx, 1 ; add 1 to ebx register
add eax, ebx ; add registers eax and ebx
push eax ; push eax into the stack
pop num ; pop eax into the variable num (when I tried it, it gave me an error, i think thats because of the data type)
invoke StdOut, addr num ; display num on the console.
invoke ExitProcess ; exit
end start
我需要了解 db,dw,dd 的含义以及它们是如何影响变量设置和组合的。
先说声谢谢, 程序