Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. ;Slightly inefficient
  2. ;zp_base=$80
  3. ;foo1=zp_base+0
  4. ;foo2=zp_base+1
  5. ;foo3=zp_base+2
  6. ;bar1=zp_base+3
  7. ;bar2-bar98
  8. ;bar99=zp_base+101
  9.  
  10. ;If you need to add foo4 you have to retype bar1-bar99 :(
  11.  
  12.  
  13. ;Slightly more efficient
  14. .macro var name
  15. name=zp_counter
  16. zp_counter .set zp_counter+1
  17. .endmacro
  18.  
  19. zp_base=$80
  20. zp_counter .set zp_base
  21. var foo1
  22. var foo2
  23. var foo3
  24. var bar1
  25. ;bar2-98
  26. var bar99
  27.  
  28.  
  29. .org $C000
  30. LDA foo1
  31. LDA foo2
  32. LDA foo3
  33.  
  34. .out .sprintf("%d of %d zero page bytes used",zp_counter-zp_base,255-zp_base)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement