What register typically stores function return values?
RAX
How many bytes is a QWORD?
8
What does mov do?
Copies data from source to destination
mov rax, 5
add rax, 3
8
mov rax 5
Missing comma
What is the 32-bit version of RAX?
EAX
What directive defines 1 byte?
db
What does add rax, rbx do?
rax = rax + rbx
mov rax, 10
sub rax, 4
6
add rax, rbx
rbx might be uninitialized
If you modify EAX, what happens to RAX?
Upper 32 bits are zeroed
What does resw do?
Reserves a WORD (2 bytes)
What instruction is used for multiplication (basic)?
mul (or imul)
mov rax, 5
mov rbx, rax
add rbx, 2
rax = 5, rbx = 7
mov rax, 5
div 2
invalid operand / improper division usage
Which register is commonly used as a loop counter?
RCX
How many possible values can a BYTE hold?
256
What’s the difference between inc rax and add rax, 1?
inc does NOT affect carry flag
mov rax, 8
add rax, rax
16
mov rax, 5
mov rax, 10
first value overwritten (logic issue)
What happens if you overwrite RBX without saving it in a function?
You might break the program because RBX is supposed to be preserved
Why does a 64-bit register have more permutations than 32-bit?
More bits → exponential increase (2^n)
What happens if you divide without setting up registers correctly?
Runtime error / crash (division uses specific registers like rdx:rax)
mov rax, 5
mov rbx, 3
add rax, rbx
sub rbx, 1
rax = 8, rbx = 2
mov rax, 5
mul rbx
rbx not initialized / mul uses rax implicitly