HelpExplain me this ASM pointer code please,

Posts 1–3 of 3 · Page 1 of 1
Explain me this ASM pointer code please,
1: mov byte ptr [rbx]
2: mov word ptr [rbx]
3: mov dword ptr [rbx]


Explain EVERY WORD IN THOSE CODES, + why did he choose rbx? who not rax or rcx ?
NB i just finished c++ and went to learn ASM
How do you expect us to provide an answer if we don't know under what context these instructions are from. He chose rbx cause he's cool? I don't know. Like I said in my previous post, BYTE, WORD and DWORD are all Win32 C++ basics.

BYTE = 1 byte
WORD = 2 bytes
DWORD = 4 bytes
QWORD = 8 bytes

Also, I can't explain what those instructions do because they're imcomplete. Where is the source register or value? You've only specified the destinations.
the b in rbx stands for base. It is just a name but it's widely accepted and good practice to use registers accordingly. e.g: use the counter register (rcx) when counting up in a loop.

Depending on the assembler, which registers you use shouldn't matter. I don't remember which one, but there is one where you can only use ebx as an offset like: mov eax,[ebx+5]. It wouldn't accept mov eax,[ecx+5]

As for the rest, you're missing an operand ( the source operand ). It should look like this: mov byte ptr[rbx],value. the 'byte' in this instruction is saying: take one byte from 'value' and move it into the address of rbx. So if value was equal to 256, it would be moving the value 0 into the address of rbx.
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us