How to know if a register is a “general purpose register”?

The term General purpose register(GPR) stands in contrast to Special purpose Register. The latter cannot be used in all contexts. Historically the old 8086 architecture introduced this difference for integer registers present in their names till today: AX = Accumulator register: accumulates the result(**) BX = Base register: base offset for certain instruction, e.g. XLAT … Read more

What’s the real meaning of $$ in nasm

$$ is the address of the beginning of the current section. It is a relocatable value (not “scalar” – a word you will find in an error message, but not in the Manual). It is an offset, so doesn’t care what’s in a segment register. Documentation: https://www.nasm.us/doc/nasmdoc3.html#section-3.5 example use case for a boot sector: https://www.nasm.us/doc/nasmdo13.html#section-13.1.3 … Read more

MIPS Assembly Alignment Align n

Taken directly from MARS helping tooltips: Align next data item on specified byte boundary (0=byte, 1=halfword, 2=word, 3=double) Consider this code la $t0, array .data .space 3 array: .space 12 This is assembled into lui $at, 0x1001 ori $t0, $at, 0x0003 #$t0 = 0x10010003 showing that array is at address 0x10010003. Using an .align directive: … Read more