1 / 6

Jump Statements

Jump Statements. Assembly. Jump Statement Commands. JMP 0150 JZ 01C2 – zero = 1 JNZ 0240 – zero = 0 JP 012C – sign = 1 JM 11C0 – sign = 0. Comparison Instructions. CMP B – CPI 20 –. Example #1. High Level: Low Level: if amount > 20 then amount := 20 end if. Example #2.

clark
Download Presentation

Jump Statements

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jump Statements Assembly

  2. Jump Statement Commands • JMP 0150 • JZ 01C2 – zero = 1 • JNZ 0240 – zero = 0 • JP 012C – sign = 1 • JM 11C0 – sign = 0

  3. Comparison Instructions • CMP B – • CPI 20 –

  4. Example #1 High Level: Low Level: if amount > 20 then amount := 20 end if

  5. Example #2 High Level: Low Level: loop i ++ exit when i >= 5 end loop

  6. Example #3 High Level: Low Level: var sum : int := 0 for i : 1 .. 20sum := sum + i end for

More Related