This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: M7 X <- (A+BC)/(D – EF) Q2. CMP X,Y computes Y – X and sets the flags depending on the result. Y = 37h = 00110111 X = 49h = 01001001 Perform subtraction by 2’s complement addition 00110111 + 10110111 11101110 Remember that carry is meaningful only in unsigned arithmetic. In unsigned subtraction, absence of carry indicates borrow and therefore CF=1. Overflow and sign are meaningful only in signed arithmetic. There is no overflow , so OF=0 Result is negative so SF=1 Result is not zero, so ZF=0 (meaningful both in unsigned and signed) Q3. For this question, Parity Flag PF is also needed. Since there are 6 ones in the result PF =1 (even parity) Branch Taken/Not Taken Reason JA NT C=1 JAE NT C=1 JB T C=1 JBE T C=1 JE NT Z=0 JG NT S=1, O=0 JGE NT S=1,O=0 JL T S=1,O=0 JLE T S=1,O=0 JNE T Z=0 JNO T O=0 JNS NT S=1 JNP NT P=1 JO NT O=0 JP T P=1 JS T S=1...
View Full Document
- Spring '11