I am starting to build and I do not know what all things db, dw, dd mean. I tried to write this little script that does 1 + 1, save it in a variable, and then display the result. Here is my code:
.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
I need to understand what db, dw, dd things mean and how they affect setting and combining variables and such things.
Thanks in advance, Progrmr
variables assembly x86
Progrmr Apr 16 2018-12-12T00: 00Z
source share