Advertisement
luckytyphlosion

rgbasm macro syntax is dead to me

Dec 1st, 2017
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. ldrw: MACRO
  2. if (\3 == 0) || (\3 == "offset")
  3. if "\1" == "a"
  4. if \4 == 0 ; low
  5. db $fa, $fa, (\2 + BOOTSTRAP_OFFSET) >> 8
  6. else
  7. db $fa, (\2 + BOOTSTRAP_OFFSET) & $ff, (\2 + BOOTSTRAP_OFFSET) & $ff
  8. endc
  9. elif "\2" == "a"
  10. if \4 == 0 ; low
  11. db $ea, $ea, (\1 + BOOTSTRAP_OFFSET) >> 8
  12. else
  13. db $ea, (\1 + BOOTSTRAP_OFFSET) & $ff, (\2 + BOOTSTRAP_OFFSET) & $ff
  14. endc
  15. else
  16. if _NARG == 3
  17. db (\2 + BOOTSTRAP_OFFSET) & $ff, (\2 + BOOTSTRAP_OFFSET) & $ff, (\2 + BOOTSTRAP_OFFSET) >> 8
  18. else
  19. if \4 == 0 ; low
  20. db (\2 + BOOTSTRAP_OFFSET) >> 8, (\2 + BOOTSTRAP_OFFSET) >> 8, (\2 + BOOTSTRAP_OFFSET) >> 8
  21. else
  22. db (\2 + BOOTSTRAP_OFFSET) & $ff, (\2 + BOOTSTRAP_OFFSET) & $ff, (\2 + BOOTSTRAP_OFFSET) & $ff
  23. endc
  24. endc
  25. endc
  26. else
  27. if "\1" == "a"
  28. if \4 == 0 ; low
  29. db $fa, $fa, \2 >> 8
  30. else
  31. db $fa, \2 & $ff, \2 & $ff
  32. endc
  33. elif "\2" == "a"
  34. if \4 == 0 ; low
  35. db $ea, $ea, \1 >> 8
  36. else
  37. db $ea, \1 & $ff, \1 & $ff
  38. endc
  39. else
  40. if _NARG == 3
  41. db \2 & $ff, \2 & $ff, \2 >> 8
  42. else
  43. if \4 == 0 ; low
  44. db \2 >> 8, \2 >> 8, \2 >> 8
  45. else
  46. db \2 & $ff, \2 & $ff, \2 & $ff
  47. endc
  48. endc
  49. endc
  50. endc
  51. ENDM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement