What’s the difference between a word and byte?

Byte: Today, a byte is almost always 8 bit. However, that wasn’t always the case and there’s no “standard” or something that dictates this. Since 8 bits is a convenient number to work with it became the de facto standard. Word: The natural size with which a processor is handling data (the register size). The most common word sizes … Read more

MIPS instruction and machine code

Actually you have only found the instruction, so it’s not ending there from your spec. Write out the machine code for the MIPS instruction. In order to write the machine code for this instruction you need to look at MIPS reference sheet MIPS Reference sheet If you look at the sheet the lw has opcode 35 and for $1 is 17 , … Read more

What does `dword ptr` mean?

The dword ptr part is called a size directive. This page explains them, but it wasn’t possible to direct-link to the correct section. Basically, it means “the size of the target operand is 32 bits”, so this will bitwise-AND the 32-bit value at the address computed by taking the contents of the ebp register and … Read more

What are callee and caller saved registers?

Caller-saved registers (AKA volatile registers, or call-clobbered) are used to hold temporary quantities that need not be preserved across calls. For that reason, it is the caller’s responsibility to push these registers onto the stack or copy them somewhere else if it wants to restore this value after a procedure call. It’s normal to let … Read more