I know this is a really simple question, but I couldn\'t find an answer to this. Are the registers in x86 assembly (eax, ebx edx etc) signed or unsigned? If they\'re signed
The CPU does not know nor does it care. Instead, bits in the Flags register are set on certain operations, and how your program acts on those flags depends on what the source code told it to.
E.g.,
mov eax, 0FFFFFFFFh
test eax, eax
js isNegative
vs.
mov eax, 0FFFFFFFFh
test eax, eax
jb isNegative
The first jumps to 'IsNegative' because test sets the Sign Flag here. The second does not, because test resets the Carry Flag to 0 and jb only jumps if it is 1.
32-bit registers in x86 are default unsigned. For example, a move from 32-bit operand to a 64-bit register always get zero-extended under long model. But instructions each has its own interpretation of registers based on its purpose, like 'add' instruction take registers both signed or unsigned. You should refer intel documents for detail.