Lecture 06 Flashcards
What is ‘zero-extending’, regarding extending a value, e.g. Copying a short integer to a long integer.
Zero extending is when all extra bits that are not in the original value are set to 0.
What is ‘sign-extending’, regarding extending a value, e.g. Copying a short integer to a long integer.
Sign extending is when all extra bits that are not in the original value are set to the sign of the value.
For example, a positive number will be padded with 0s, and a negative will be padded with 1s.
What does the assembly operator’lea’ stand for?
Load Effective Address
What does the assembly operator’lea’ do?
lea computes a memory address from the first operand and stores it into the second operand. It is like mov except it stores the address instead of the content stored at the address.
Does the operator ‘mul’ work with unsigned or signed operands?
Unsigned
Does the operator ‘imul’ work with unsigned or signed operands?
Signed
Does the operator ‘div’ work with unsigned or signed operands?
Unsigned
Does the operator ‘idiv’ work with unsigned or signed operands?
Signed
What does the operator ‘shr’ do?
Performs a logical shift right. Empty bits are filled with 0s.
What does the operator ‘shl’ do?
Performs a logical shift left. Empty bits are filled with 0s.
What does the operator ‘sar’ do?
Performs an arithmetic right shift. Empty bits are filled with sign bit.
What does the operator ‘sal’ do?
Performs an arithmetic left shift. Empty bits are filled with 0s.
What is the different between the ‘test’ and ‘and’ operators?
‘test’ does not produce a result. It simply sets the flags in the rflags register.
What is the different between the ‘cmp’ and ‘sub’ operators?
‘cmp’ does not produce a result. It simply sets the flags in the rflags register.
If the zero flag is set in the rflags register after a ‘cmp’ operation, what does that mean about the two operands?
The two operands were equal.