1/50
Looks like no tags are added yet.
What is the size of a byte in bits?
A byte contains 8 bits.
What does the EAX register represent in terms of bits?
EAX is a 32-bit register.
How do AH and AL relate to AX?
AH is the upper 8 bits and AL is the lower 8 bits of AX.
What is the result of changing AL in AX?
Changing AL replaces only the lower byte of AX.
What happens when you change AX?
Changing AX replaces both AH and AL, but leaves the upper 16 bits of EAX unchanged.
How is AX calculated from AH and AL?
AX = AH Ć 256 + AL.
What is the purpose of the MOV instruction?
MOV copies a value; it does not remove the value from the source.
What does the ADD instruction do?
ADD adds to the destination.
What does the INC instruction do?
INC adds 1 to the destination.
What are the binary place values for 8 bits?
128, 64, 32, 16, 8, 4, 2, and 1.
What is the range of 8-bit unsigned numbers?
0 to 255.
What is the range of 8-bit two's complement numbers?
ā128 to 127.
How is a negative number represented in two's complement?
Flip every bit of its positive representation and add 1.
What is the representation of +6 in sign-magnitude?
+6 = 00000110.
What is the representation of -6 in one's complement?
ā6 = 11111001.
What does the Zero Flag (ZF) indicate?
ZF = 1 when all result bits are zero.
What does the Sign Flag (SF) represent?
SF copies the result's leftmost bit.
What does the Carry Flag (CF) indicate?
CF = 1 for an unsigned carry out in addition or an unsigned borrow in subtraction.
What does the Overflow Flag (OF) indicate?
OF = 1 when a signed arithmetic result cannot fit in the destination.
What is the effect of the INC and DEC instructions on flags?
INC and DEC change ZF, OF, and SF but preserve CF.
What is the result of adding 1 to 12FFh in AX?
AX becomes 1300h; CF = 0.
What is the two's complement representation of -1 in 8 bits?
11111111.
How do you decode a negative pattern in two's complement?
Invert and add 1 to find its magnitude, then attach the negative sign.
What is the 8-bit range for sign-magnitude representation?
ā127 to 127.
What is the result of adding AL and 1 when AL is 00h?
AL wraps to 00h; AH stays the same.
What is the result of changing AH to 78h when AX is 1256h?
AX becomes 7856h.
What is the effect of the MOV instruction on flags?
MOV does not change ZF, OF, CF, or SF.
What is the condition for signed addition overflow when adding two positive numbers?
Positive + positive producing a negative stored result ā overflow.
What indicates signed addition overflow when adding two negative numbers?
Negative + negative producing a nonnegative stored result ā overflow.
What is the outcome of adding a positive and a negative number regarding overflow?
Positive + negative ā no signed addition overflow.
What is the shortcut rule for detecting signed addition overflow?
Same-sign inputs, opposite-sign result ā OF = 1.
In an 8-bit addition, what happens when 127 is added to 1?
It results in overflow: 01111111 + 00000001 ā 10000000, which means ā128.
What is the condition for carry flag (CF) in signed addition?
No carry left the 8-bit destination, so CF = 0.
What is the difference between carry and overflow in arithmetic operations?
Carry checks unsigned arithmetic; overflow checks signed arithmetic.
What does CF indicate in subtraction?
CF = 1 if the first unsigned value is smaller than the value being subtracted.
What does ZF represent in the context of arithmetic results?
ZF = 1 if all stored result bits are zero.
What is the result of the bitwise AND operation?
AND ā 1 only when both bits are 1.
What is the result of the bitwise OR operation?
OR ā 1 when at least one bit is 1.
What does the XOR operation yield?
XOR ā 1 when the bits are different.
What does the NOT operation do?
NOT ā flips every bit.
What happens during a left shift (SHL)?
SHL shifts left and inserts zeros on the right.
What is the effect of a right shift (SHR)?
SHR shifts right and inserts zeros on the left.
What does a left shift by k multiply by?
A left shift by k multiplies by 2^k if the result fits.
What does an arithmetic right shift (SAR) do?
SAR shifts right and repeats the original sign bit on the left.
What is the purpose of the shift flags?
Shift flags reflect the outcome of shift operations and indicate overflow and carry.
What is the range of an 8-bit two's-complement representation?
The range is ā128 to 127.
What is the result of the operation 5 SHL 2?
It results in 20.
What is the result of the operation 29 SHR 3?
It results in 3.
What is the difference between SHR and SAR for signed values?
SHR fills with zeros; SAR copies the sign bit.
What common mistake is made regarding the sizes of AH and AL?
AH and AL are both 8 bits; AX is 16 bits.
What happens when you update AL?
Updating AL does not replace all of AX or EAX.