

This negative high bit is called the "sign bit", and it has a negative value in two's complement signed numbers. Wait, the last bit's value is -128? Yes, it really is!

Value=value+value /* moves over by one bit (value=value<<1 would work too) */ If you watch closely right before overflow, you see something funny happen: signed char value=1 /* value to test, starts at first (lowest) bit */ These were added in 64-bit mode, so the names are slightly different. Also used to pass function argument #2 in 64-bit mode (on Linux). Sometimes used to store the old value of the stack pointer, or the "base". Points to the top of the stack (details next week!) Preserved register: don't use it without saving it! Multiply instructions put the high bits of the result here. Some instructions use it as a counter (such as SAL or REP). Multiply instructions put the low bits of the result here too. Values are returned from functions in this register. " Preserved" registers serve some important purpose somewhere else, so as we'll talk about next week you have to put them back ("save" the register) if you use them-for now, just leave them alone! Notes "Scratch" registers you're allowed to overwrite and use for anything you want. They're original back to 1972.Ĭuriously, you can write a 64-bit value into rax, then read off the low 32 bits from eax, or the low 16 bitx from ax, or the low 8 bits from al-it's just one register, but they keep on extending it! rax: 64-bitįor example, mov rcx,0xf00d00d2beefc03 load 64-bit constant al is the low 8 bits (like ax&0xff), ah is the high 8 bits (like ax>8).

