Assume that register %rax contains the value 0xFFFFFFFF. Which condition code flags will be set to 1 after the following instruction executes?
add $1, %rax
ZF
Correct!
SF
Incorrect.
CF
Correct!
OF
Incorrect. Consider that 0xFFFF is -1. Adding 1 to -1 should result in a 0 result if there is no overflow, which it does if you perform binary addition.
Checkpoint7.4.2.Understanding How Flags are Set by Cmp.
Assume that %rax contains 12 and %rcx contains 22. Which condition code flags will be set by the following instruction:
cmp %rcx, %rax
ZF
Incorrect.
SF
Correct!
CF
Incorrect.
OF
Incorrect.
Checkpoint7.4.3.Understanding How Flags are Set by Cmp.
Find values for %rax and %rcx for which cmp %rcx, %rax would result in setting all condition code flags to 0.
For which of the following values for %rax and %rcx does the instruction cmp %rcx, %rax not set any flags?
%rax = 5, %rcx = 4
Correct!
%rax = 4, %rcx = 5
Incorrect.
%rax = 5, %rcx = 5
Incorrect.
All of the above instruction set a flag.
Incorrect.
None of the above instruction set a flag.
Incorrect.
Checkpoint7.4.4.Understanding How Flags are Set by Test.
Assume that %rax contains 0. Check all the flags that would be set by the following instruction:
test %rax, %rax
ZF
Correct!
SF
Incorrect
CF
Incorrect.
OF
Incorrect.
Checkpoint7.4.5.Hits/Misses.
Given the following initial state:
%rcx 0x1
%rdx 0x8
What value is in the %rdx register after the following code is executed? Enter your answer in hex.