Discussion 4: Flags underlying Jump Instructions COLLAPSE Every jump instruction is actually based upon some combination of the flag values contained in the EFLAGS register. For example, JG takes...

Discussion 4: Flags underlying Jump InstructionsCOLLAPSE

Every jump instruction is actually based upon some combination of the flag values contained in the EFLAGS register. For example,JGtakes place if(SF = OF and ZF = 0), whileJAtakes place if(CF = ZF = 0), etc. The exact flag values that cause any jump to take place are given in theSlides 4A.pptxfile.


So many different boolean conditions on the flag values, like(SF = OF and ZF = 0), are hard to memorize for each instruction. That's why, its more intuitive name,JG, whereGstands forgreater-than, is all that a programmer needs to remember.


For a conditional jump instruction of your choice, demonstrate with your own examples, why its underlying boolean condition is correct. Construct 2 examples, each with 2 numbers. In the first example, come up with two numbers, A1 and A2, for which that jumpwill takeplace. Also show that if we executecmp A1, A2(i.e. compute A1 - A2, and set flags according to the result), the underlying boolean condition for that jump is true. In the second example, come up with numbers B1 and B2, for which that jumpwill not takeplace. Also show thatcmp B1, B2will set flags such that the underlying boolean condition for that jump is false.


It's OK to take just 4-bit examples.





May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here