Assembly Part 4 Flashcards

1
Q

CF is set to 1 when

A

The carry out from the most significant bit (unsigned overflow) is 1

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

ZF is set to 1 if

A

T == 0

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

SF is set to 1 if

A

T < 0 (as signed)

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

OF is set to 1 if

A

Two-complement signed overflow

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

Does Leaq instruction set (means set to 1) condition codes?

A

No

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

Explicitly set flags with ______ instruction

A

CmpX

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

Cmpq src1, src2
Cmpq b,a

A

Same as computing a-b, but not assigning the result to a destination. Flags are set to 0 or 1

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

Explicitly set flags with ____ instruction

A

Test

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

Testq src2, src1
Testq b,a

A

The same as computing a&b, but not assigning the result to destination

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

The setX instruction set a ____ _____ based on combination of condition codes
Stores ____ value in one of the ______ registers and does not alter remaining bits

A

Single byte
1-bit, 1-byte

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

CmpX <scrc1>, <src2></src2></scrc1>

A

Computes scr2 - scr1 but does save the result anywhere
Conditions codes are set to 0 or 1 based on the computation
Src1 and src2 must be of the same size

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

TestX <src1>, <src2></src2></src1>

A

Computes <src2> & <Src1> but does not save the result anywhere
Conditions codes (ZF and SF) are set to 1 or 0 based on the computation
Scr1 and src2 must be of the same size</Src1></src2>

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

JX destination

A

Jump to different part of code depending on condition codes

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

CmovX operand1, operand2

A

Move a value or not depending on condition codes

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

Memory address review
Imm

A

Mem[Imm]
Note that this special case contains no parentheses, but still specifies a address in memory were we will go and access the value

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

TestX instruction changes what flags

A

ZF set to 1 when a&b == 0
SF is set to 1 when a&b < 0

OF and CF cannot be set to one by testX

17
Q

What flags cannot be set to 1 by testX?

19
Q

CmovX operand1, operadn2

A

Move a value (or not) depending on the condition codes