SMProxy

Untitled

May 13th, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. ; test short literals
  2. SET a, -300 ; long
  3. SET a, -3 ; long
  4. SET a, -2 ; long
  5. SET a, -1 ; short in 1.5
  6. SET a, 0
  7. SET a, 1
  8. SET a, 2
  9. SET a, 3
  10. SET a, 4
  11. SET a, 5
  12. ; ...
  13. SET a, 0x1d
  14. SET a, 0x1c
  15. SET a, 0x1e ; short
  16. SET a, 0x1f ; long in 1.5
  17. SET a, 0x20
  18. SET a, 0x200
  19.  
  20. ; warning cases
  21. SET a, -0x8000 ; fits
  22. SET a, -0x8001 ; wrap to 0
  23. SET a, 0xffff ; fits
  24. SET a, 0x10000 ; wrap to 0
  25.  
  26. ; test short literal forced long
  27. SET a, from + 32 - to ; may be short literal
  28. :from SET a, from + 32 - to ; must be long literal
  29. :to SET a, from + 32 - to ; may be short literal
  30. :end
  31.  
  32. ; In this case one or other instruction may use short form, but not both.
  33. ; Hard to optimise, and which to choose to make short?
  34. ; test 0x1e boundary
  35. :a1 SET a, a2 + 32 - b2
  36. :b1
  37. :a2 SET a, a1 + 32 - b1
  38. :b2
  39.  
  40. ; test -1 boundary
  41. :a3 SET a, b4 - a4 - 3
  42. :b3
  43. :a4 SET a, b3 - a3 - 3
  44. :b4
Advertisement
Add Comment
Please, Sign In to add comment