Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARK 0.33 KB | None | 0 0
  1. ! equiv c code:
  2. ! int x = 0;
  3. ! while(x < 20) {
  4. !   /* statements */   
  5. ! }
  6.  
  7. !
  8. ! Unoptimzed:
  9. !
  10.     clr %l0
  11. loop:
  12.     cmp %l0, 20
  13.     bge :end_loop
  14.     nop
  15.  
  16.     /* statements */
  17.  
  18.     ba loop
  19.     nop
  20. end_loop:
  21.  
  22. !
  23. ! Optimized:
  24. !
  25.     clr %l0
  26.  
  27.     cmp %l0, 20
  28.     bge end_loop
  29.     nop
  30. loop:
  31.     /* statements */
  32.     cmp %l0, 20
  33.     bl loop
  34.     nop
  35.    
  36. end_loop:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement