daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Oct 31st, 2017 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. BEQ_L .macro
  2.     bne .local_label_in_macro_\@
  3.     jmp \1
  4. .local_label_in_macro_\@
  5.     .endm
  6.  
  7. BNE_L .macro
  8.     beq .local_label_in_macro_\@
  9.     jmp \1
  10. .local_label_in_macro_\@
  11.     .endm
  12.  
  13. BCS_L .macro
  14.     bcc .local_label_in_macro_\@
  15.     jmp \1
  16. .local_label_in_macro_\@
  17.     .endm
  18.  
  19. BCC_L .macro
  20.     bcs .local_label_in_macro_\@
  21.     jmp \1
  22. .local_label_in_macro_\@
  23.     .endm
  24.  
  25. BPL_L .macro
  26.     bmi .local_label_in_macro_\@
  27.     jmp \1
  28. .local_label_in_macro_\@
  29.     .endm
  30.  
  31. BMI_L .macro
  32.     bpl .local_label_in_macro_\@
  33.     jmp \1
  34. .local_label_in_macro_\@
  35.     .endm
  36.  
  37. BNEJSR .macro
  38.     beq .local_label_in_macro_\@
  39.     jsr \1
  40. .local_label_in_macro_\@
  41.     .endm
  42.  
  43. BEQJSR .macro
  44.     bne .local_label_in_macro_\@
  45.     jsr \1
  46. .local_label_in_macro_\@
  47.     .endm
  48.  
  49. BCSJSR .macro
  50.     bcc .local_label_in_macro_\@
  51.     jsr \1
  52. .local_label_in_macro_\@
  53.     .endm
  54.  
  55. BCCJSR .macro
  56.     bcs .local_label_in_macro_\@
  57.     jsr \1
  58. .local_label_in_macro_\@
  59.     .endm
  60.  
  61. BPLJSR .macro
  62.     bmi .local_label_in_macro_\@
  63.     jsr \1
  64. .local_label_in_macro_\@
  65.     .endm
  66.  
  67. BMIJSR .macro
  68.     bpl .local_label_in_macro_\@
  69.     jsr \1
  70. .local_label_in_macro_\@
  71.     .endm
  72.  
  73. BEQRTS .macro
  74.     bne .local_label_in_macro_\@
  75.     rts
  76. .local_label_in_macro_\@
  77.     .endm
  78.  
  79. BNERTS .macro
  80.     beq .local_label_in_macro_\@
  81.     rts
  82. .local_label_in_macro_\@
  83.     .endm
  84.  
  85. BPLRTS .macro
  86.     bmi .local_label_in_macro_\@
  87.     rts
  88. .local_label_in_macro_\@
  89.     .endm
  90.  
  91. BMIRTS .macro
  92.     bpl .local_label_in_macro_\@
  93.     rts
  94. .local_label_in_macro_\@
  95.     .endm
  96.  
  97.  
  98. BCSRTS .macro
  99.     bcc .local_label_in_macro_\@
  100.     rts
  101. .local_label_in_macro_\@
  102.     .endm
  103.  
  104. BCCRTS .macro
  105.     bcs .local_label_in_macro_\@
  106.     rts
  107. .local_label_in_macro_\@
  108.     .endm
  109.  
  110. BVSRTS .macro
  111.     bvc .local_label_in_macro_\@
  112.     rts
  113. .local_label_in_macro_\@
  114.     .endm
  115.  
  116. BVCRTS .macro
  117.     bvs .local_label_in_macro_\@
  118.     rts
  119. .local_label_in_macro_\@
  120.     .endm
  121.  
  122.  
  123.  
  124. SETBANK8000 .macro
  125. local_label_in_macro_\@:
  126.     .org ((local_label_in_macro_\@&$1FFF)|$8000)
  127.     .endm
  128.  
  129. SETBANKA000 .macro
  130. local_label_in_macro_\@:
  131.     .org ((local_label_in_macro_\@&$1FFF)|$A000)
  132.     .endm
  133.  
  134.  
  135. LONG_JUMP_8000 .macro
  136.     jsr LONG_JUMP_8000_BODY
  137.     .dw ((((\1)-1)&$1FFF)|$8000)
  138.     .db BANK(\1)
  139.     .endm
  140.  
  141. LONG_JUMP_8000_D .macro
  142.     jsr LONG_JUMP_8000_BODY
  143.     .dw ((((\1)-1)&$1FFF)|$8000)
  144.     .db (\1>>16)
  145.     .endm
  146.  
  147. LONG_JUMP_A000 .macro
  148.     jsr LONG_JUMP_A000_BODY
  149.     .dw ((((\1)-1)&$1FFF)|$A000)
  150.     .db BANK(\1)
  151.     .endm
  152.  
  153. LONG_JUMP_A000_D .macro
  154.     jsr LONG_JUMP_A000_BODY
  155.     .dw ((((\1&$FFFF)-1)&$1FFF)|$A000)
  156.     .db (\1>>16)
  157.     .endm
  158.  
  159. LONG_CALL .macro
  160.     jsr LONG_CALL_BODY
  161.     .db HIGH ((\1)-1)
  162.     .db LOW ((\1)-1)
  163.     .db BANK(\1)+$80
  164.     .endm
  165.  
  166. LONG_CALL_D .macro
  167.     jsr LONG_CALL_BODY
  168.     .dw ((\1&$FFFF)-1)
  169.     .db (\1>>16)
  170.     .endm
  171.  
  172. BANKORG_D .macro
  173.     .bank (\1>>16)
  174.     .org (\1&$FFFF)
  175.     .endm
  176.  
  177. BANKORG .macro
  178.     .bank BANK(\1)
  179.     .org (\1)
  180.     .endm
  181.  
  182. ORG_DELTA .macro
  183. .local_\@
  184.     .org (.local_\@+\1)
  185.     .endm
  186.  
  187.  
  188. INV_A   .macro
  189.     eor #$FF
  190.     clc
  191.     adc #$01
  192.     .endm
  193.  
  194. INV_A_CC    .macro
  195.     bcs .local_label_in_macro_\@
  196.     INV_A
  197. .local_label_in_macro_\@
  198.     .endm
  199.  
  200. TYAX    .macro
  201.     tya
  202.     tax
  203.     .endm
  204.  
  205. TXAY    .macro
  206.     txa
  207.     tay
  208.     .endm
  209.  
  210.  
  211. ASSEMBLING_BANK_INC .macro
  212. local_label_in_macro_\@:
  213.     .bank (BANK(local_label_in_macro_\@)+1)
  214.     .org $A000
  215.     nop
  216.     .endm
  217.  
  218. ASSEMBLING_BANK_INC_NO_PADDING  .macro
  219. local_label_in_macro_\@:
  220.     .bank (BANK(local_label_in_macro_\@)+1)
  221.     .org $A000
  222.     .endm
  223.  
  224.  
  225. TRASH_GLOBAL_LABEL  .macro
  226. TRASH_GLOBAL_LABEL_\@
  227.     .endm
  228.  
  229. END_BOUNDARY_TEST   .macro
  230. CurrentPosition\@:
  231.     .IF ((CurrentPosition\@)&$FFFF)>((\1)&$FFFF)
  232.     .FAIL ;END_BOUNDARY_TEST \1
  233.     .ENDIF
  234.     .endm
  235.  
  236. END_BOUNDARY_TEST_1FFF  .macro
  237. CurrentPosition\@:
  238.     .IF ((CurrentPosition\@)&$1FFF)>((\1)&$1FFF)
  239.     .FAIL ;END_BOUNDARY_TEST \1
  240.     .ENDIF
  241.     .endm
  242.  
  243. BANK_BOUNDARY_TEST  .macro
  244. CurrentPosition\@:
  245.     .IF (bank(CurrentPosition\@))>=(\1)
  246.     .FAIL ;BANK_BOUNDARY_TEST \1
  247.     .ENDIF
  248.     .endm
  249.  
  250. BANKORG_ROM .macro
  251.     .bank ((\1-$10)/$2000)
  252.     .org (((\1-$10)&$1FFF)|$8000)
  253.     .endm
  254.  
  255. END_BOUNDARY_TEST_ROM   .macro
  256. CurrentPosition\@:
  257.     .IF ((CurrentPosition\@)&$1FFF)>(((\1)-$10)&$1FFF)
  258.     .FAIL ;END_BOUNDARY_TEST \1
  259.     .ENDIF
  260.     .endm
  261.  
  262. DB4 .macro
  263.     .db LOW(\1>>24)
  264.     .db LOW(\1>>16)
  265.     .db LOW(\1>>8)
  266.     .db LOW(\1)
  267.     .endm
  268. DB3 .macro
  269.     .db LOW(\1>>16)
  270.     .db LOW(\1>>8)
  271.     .db LOW(\1)
  272.     .endm
  273. DB2 .macro
  274.     .db LOW(\1>>8)
  275.     .db LOW(\1)
  276.     .endm
  277.  
  278. BANKORG_DB .macro
  279.     BANKORG_D \1
  280.     .db \2
  281.     .endm
  282.  
  283. DB_HI .macro
  284.     .db HIGH(\1)
  285.     .endm
  286. DB_LO .macro
  287.     .db LOW(\1)
  288.     .endm
  289.  
  290.  
  291. M_DBAddrLHSplit .macro
  292.     .db LOW (\1)
  293.     ORG_DELTA ((\2)-1)
  294.     .db HIGH(\1)
  295.     ORG_DELTA (-(\2))
  296.     .endm
  297.  
  298. M_DBAddrLHSplit_G .macro
  299. TRASH_GLOBAL_LABEL_\@:
  300.     .db LOW (\1)
  301.     ORG_DELTA ((\2)-1)
  302.     .db HIGH(\1)
  303.     ORG_DELTA (-(\2))
  304.     .endm
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top