Download
jump statements n.
Skip this Video
Loading SlideShow in 5 Seconds..
Jump Statements PowerPoint Presentation
Download Presentation
Jump Statements

Jump Statements

188 Views Download Presentation
Download Presentation

Jump Statements

- - - - - - - - - - - - - - - - - - - - - - - - - - - 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