Lecture 06 Flashcards

1
Q

What is ‘zero-extending’, regarding extending a value, e.g. Copying a short integer to a long integer.

A

Zero extending is when all extra bits that are not in the original value are set to 0.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is ‘sign-extending’, regarding extending a value, e.g. Copying a short integer to a long integer.

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the assembly operator’lea’ stand for?

A

Load Effective Address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the assembly operator’lea’ do?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does the operator ‘mul’ work with unsigned or signed operands?

A

Unsigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Does the operator ‘imul’ work with unsigned or signed operands?

A

Signed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Does the operator ‘div’ work with unsigned or signed operands?

A

Unsigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Does the operator ‘idiv’ work with unsigned or signed operands?

A

Signed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the operator ‘shr’ do?

A

Performs a logical shift right. Empty bits are filled with 0s.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the operator ‘shl’ do?

A

Performs a logical shift left. Empty bits are filled with 0s.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the operator ‘sar’ do?

A

Performs an arithmetic right shift. Empty bits are filled with sign bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the operator ‘sal’ do?

A

Performs an arithmetic left shift. Empty bits are filled with 0s.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the different between the ‘test’ and ‘and’ operators?

A

‘test’ does not produce a result. It simply sets the flags in the rflags register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the different between the ‘cmp’ and ‘sub’ operators?

A

‘cmp’ does not produce a result. It simply sets the flags in the rflags register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If the zero flag is set in the rflags register after a ‘cmp’ operation, what does that mean about the two operands?

A

The two operands were equal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly