Advertisement
MolSno

ASM Notes

Sep 1st, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.98 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ; Loading ;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4. LDA = Load Data into Accumulator
  5. LDX = Load Data into X
  6. LDY = Load Data into Y
  7.  
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9. ; Storing ;
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11. STA = Store Accumulator
  12. STX = Store X
  13. STY = Store Y
  14. STZ = Store 0
  15.  
  16. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  17. ; Returning ;
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19. RTS = Return from Subroutine
  20. RTL = Return from Subroutine, Long
  21.  
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  23. ; Adding ;
  24. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  25. INC = Increment, +1
  26. INX
  27. INY
  28. ADC = Add with Carry
  29. CLC = Clear Carry Flag, usually goes before ADC
  30.  
  31. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  32. ; Subtracting ;
  33. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  34. DEC = Decrease, -1
  35. SBC = Subtract with Carry
  36. SEC = Set Carry Flag, usually goes before SBC
  37. DEX
  38. DEY
  39.  
  40. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  41. ; Multiplying ;
  42. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  43. ASL = Accumulator Shift Left, x2, can stack
  44.  
  45. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  46. ; Dividing ;
  47. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  48. LSR = Logical Shift Right, /2, can stack
  49.  
  50. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  51. ; Transferring ;
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. TYA = Y to A
  54. TAY = A to Y
  55. TXA = X to A
  56. TAX = A to X
  57. TYX = Y to X
  58. TXY = X to Y
  59.  
  60. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  61. ; Comparing ;
  62. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  63. CMP = Compare
  64. LDA $19 ;Loads player's powerup
  65. CMP #$02 ;Checks if cape
  66. ;Branching without CMP assumes value is 0
  67. CPX = Compare to X
  68. CPY = Compare to Y
  69.  
  70. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  71. ; Branching ;
  72. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  73. BRA = Branch
  74. BRL = Branch Long
  75. BEQ = Branch if Equal, aka CMP = A
  76. BNE = Branch if Not Equal, aka CMP != A
  77. LDA $19
  78. CMP #$02
  79. BNE Return
  80. (do something here)
  81. Return:
  82. RTS
  83. BCC = Branch if Carry Clear, aka CMP > A
  84. LDA $19 ;Loads powerup status
  85. CMP #$02 ;Checks if cape
  86. BCC Return ;Branch if 0 or 1
  87. LDA #$14 ;Load 20 into A
  88. STA $13CC ;Store 20 to coin counter
  89. Return:
  90. RTS
  91. BCS = Branch if Carry Set, aka CMP <= A
  92. LDA $19 ;
  93. CMP #$02 ;
  94. BCS Return ;Branch if A >= 02
  95. LDA #$14 ;Mario is small or big, no powerups
  96. STA $13CC ;
  97. Return: ;He has fire or cape
  98. RTS ;
  99. BPL = Branch if Plus (00-7F), can be used for looping
  100. LDX #$03 ;X at 03
  101. Loop:
  102. (insert code)
  103. DEX ;X-1
  104. BPL Loop ;02 is still positive, so branch
  105. BMI = Branch if Minus (80-FF)
  106. BVC = Branch if Overflow Clear
  107. BVS = Branch if Overflow Set
  108.  
  109. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  110. ; Jumping ;
  111. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  112. JMP = Jump
  113. 1. LDA #$01 ;go to 2
  114. 2. STA $19 ;go to 3
  115. 3. JMP Label ;go to 6
  116. 4. INC $0DBE
  117. 5. RTS
  118.  
  119. 6. Label: ;go to 7
  120. 7. LDA #$10 ;go to 8
  121. 8. STA $1490 ;go to 9
  122. 9. RTS ;rinse and repeat
  123.  
  124. JML = Jump Long, can go outside bank
  125. JSR = Jump to Subroutine (uses 2 bytes of stack)
  126. 1. LDA #$01 ;go to 2
  127. 2. STA $19 ;go to 3
  128. 3. JMP Label ;go to 6
  129. 4. INC $0DBE ;go to 5
  130. 5. RTS ;rinse and repeat
  131.  
  132. 6. Label: ;go to 7
  133. 7. LDA #$10 ;go to 8
  134. 8. STA $1490 ;go to 9
  135. 9. RTS ;go to 4
  136. JSL = Jump to Subroutine, Long (uses 3 bytes of stack)
  137.  
  138. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  139. ; Blocks ;
  140. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  141. See base block.asm
  142.  
  143. Turn block into blank tile:
  144. LDA #$02
  145. STA $9C
  146. JSL $00BEB0
  147.  
  148. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  149. ; Indexing ;
  150. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  151. $0000,x
  152. $0000,y
  153.  
  154. Example:
  155. LDY $95 ;load the current screen number into y
  156. LDA #$C2 ;load level c2 to a
  157. STA $19B8,y ;store c2 as the exit for the current screen
  158. Example:
  159. LDX $19 ;load mario's powerup status to x
  160. LDA InvincibilityTimer,x;jump to table
  161. STA $1490 ;star power timer
  162. RTL
  163.  
  164. InvincibilityTimer:
  165. db $FF,$7F,$3F,$1F ;pick byte depending on powerup
  166.  
  167. dp,x = direct (8-bit) address
  168. abs,x = absolute (16-bit)
  169. long,x = long (24-bit)
  170. abs,y = absolute
  171. You can sort of index a direct address by Y by simply adding 00 at the
  172.  
  173. beginning, like so:
  174. LDA $00C2,y (or if you're doing something that requires xkas, LDA.w
  175.  
  176. $00C2,y)
  177.  
  178. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  179. ; Bitwise Operations ;
  180. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  181. AND = AND Accumulator with Memory, compares A to value after AND, puts new value
  182.  
  183. into A. If either bit is 0, the result will be a 0.
  184. LDA #$5A (0 1 0 1 1 0 1 0)
  185. AND #$93 (1 0 0 1 0 0 1 1)
  186.  
  187. (? ? ? ? ? ? ? ?)
  188. (? ? ? ? ? ? ? 0)
  189. (? ? ? ? ? ? 1 0)
  190. (? ? ? ? ? 0 1 0)
  191. (? ? ? ? 0 0 1 0)
  192. (? ? ? 1 0 0 1 0)
  193. (? ? 0 1 0 0 1 0)
  194. (? 0 0 1 0 0 1 0)
  195. (0 0 0 1 0 0 1 0)
  196.  
  197. ;;;;;;;;;;;;;;;;;
  198.  
  199. LDA $77 ;SxxMUDLR - which sides player is blocked by
  200. AND #$04 ;clears all bits except D
  201.  
  202. (? ? ? ? ? x ? ?)
  203. (0 0 0 0 0 1 0 0)
  204. ORA = OR Accumulator with Memory. If either bit is 1, the result will be a 1.
  205. LDA #$5A (0 1 0 1 1 0 1 0)
  206. AND #$93 (1 0 0 1 0 0 1 1)
  207.  
  208. (1 1 0 1 1 0 1 1)
  209.  
  210. ;;;;;;;;;;;;;;;;;
  211.  
  212. LDA $1490 ;star invincibility timer
  213. ORA $1497 ;flashing invincibility timer
  214. ORA $73 ;if player is ducking
  215. ORA $187A ;if riding yoshi
  216. ORA $1493 ;if level is ending
  217. BNE LeaveHimAloneYouJerk;if any are 1, enemy can't attack
  218.  
  219. ;;;;;;;;;;;;;;;;;
  220.  
  221. LDA $15 ;controller data
  222. ORA #$41 ;player pressing y and right
  223. STA $15 ;force it
  224. EOR = Exclusive OR Accumulator with Memory, if one bit is 1, the result will be
  225.  
  226. a 1. If both are 0 or both are 1, returns a 0.
  227. LDA #$5A (0 1 0 1 1 0 1 0)
  228. AND #$93 (1 0 0 1 0 0 1 1)
  229.  
  230. (1 1 0 0 1 0 0 1)
  231.  
  232. ;;;;;;;;;;;;;;;;;
  233.  
  234. LDA $14AF ;if switch was 00 (on)
  235. EOR #$01 ;set it to 01 (off)
  236. STA $14AF
  237.  
  238. ;;;;;;;;;;;;;;;;;
  239.  
  240. LDA ---
  241. EOR #$FF ;flips all bits
  242. TRB = Test and Reset Bits, clears bits quickly
  243. LDA #$08 ;load bit 3
  244. TRB $0F40 ;clear it
  245. TSB = Test and Set Bits, sets bits quickly
  246. LDA #$08 ;load bit 3
  247. TSB $0F40 ;set it
  248. BIT = Bit Test
  249. LDA $7FAB10,x ;load the address holding the extra bits for
  250.  
  251. custom sprites
  252. BIT #$04 ;check value without changing A
  253. BNE BitSet ;branch if value is 04, don't if 00
  254. ROL = Rotate Left, brings the carry flag back around
  255. CLC
  256. LDA #%01101010 ; #%01101010 = #$6A
  257. ROL ; A is now 11010100, or #$D4; the carry flag is clear
  258. ROL ; A is now 10101000, or #$A8; the carry flag is set
  259. ROL ; A is now 01010001, or #$51; the carry flag is set
  260. ROL ; A is now 10100011, or #$A3; the carry flag is clear
  261. ROL ; A is now 01000110, or #$46; the carry flag is set
  262. ROL ; A is now 10001101, or #$8D; the carry flag is clear
  263. ROL ; A is now 00011010, or #$1A; the carry flag is set
  264. ROR = Rotate Right
  265. CLC
  266. LDA #%01101010 ; #%01101010 = #$6A
  267. ROR ; A is now 00110101, or #$35; the carry flag is clear
  268. ROR ; A is now 00011010, or #$1A; the carry flag is set
  269. ROR ; A is now 10001101, or #$8D; the carry flag is clear
  270. ROR ; A is now 01000110, or #$46; the carry flag is set
  271. ROR ; A is now 10100011, or #$A3; the carry flag is clear
  272. ROR ; A is now 01010001, or #$51; the carry flag is set
  273. ROR ; A is now 10101000, or #$A8; the carry flag is set
  274.  
  275. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  276. ; Processor Flags ;
  277. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  278. envmxdizc
  279. e - emulation bit
  280. n -
  281. v -
  282. m - if clear, enables 16-bit values with A
  283. x - if clear, enables 16-bit values with X and Y
  284. d - decimal mode
  285. i - interrupt/IRQ disable
  286. z -
  287. c -
  288.  
  289. SEP - Set Processor Bits, set any except e
  290. REP - Reset Processor Bit, any except e
  291. LDA #$24
  292. LDX #$60
  293. LDY #$40
  294. REP #$20 ;#$30 = REP #%00110000 -> nvMXdizc
  295. LDA #$0380 ;enables A to hold 16-bit numbers
  296. LDX #$01FF ;enables X to hold 16-bit numbers
  297. LDY #$14C0 ;enables Y to hold 16-bit numbers
  298.  
  299. LDA #$1280 ;80 goes into $7E
  300. STA $7E ;12 goes into $7F
  301.  
  302. LDA $7E ;$7E and $7F
  303. CMP $80 ;compared with $80 and $81
  304.  
  305. Table16:
  306. dw $0001,$0403,$0807,$0C0B,$100F,$1413,$1817,$1C1B
  307. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  308. LDA $13 ;load frame counter
  309. AND #$07 ;clear top 5 bits
  310. ASL
  311. TAX ;transfer to x
  312. LDA Table16,x ;load 16-bit value from table based on result
  313.  
  314. if 16-bit value's high byte is 00, opcode suffix should be .w
  315.  
  316. XBA - Exchange Bytes of A, swaps high byte and low byte
  317. LDA #$10 ;load 10 to accumulator
  318. XBA ;swap high and low bytes -> 10??
  319. LDA #$23 ;load 23 into accumulator
  320. REP #$20 ;enable 16-bit mode, A is now #$1023
  321.  
  322. SEI - Set Interrupt Flag, sets i bit
  323. CLI - Clear Interrupt Flag, clears i bit
  324.  
  325. SED - Set Decimal Flag, sets d bit
  326. CLD - Clear Decimal Flag, clears d bit
  327.  
  328. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  329. ; Stack ;
  330. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  331. PHA - Push Accumulator
  332. LDA $1588,x ;load sledge bro's blocked status
  333. PHA ;push it into the stack
  334. JSL $01802A ;move the sprite
  335. LDA $1588,x ;$1588 now holds sprite's blocked status after moving
  336. AND #$04 ;check to make sure it isn't in the air
  337. BEQ NoShake ;branch if sledge bro is on the ground
  338. PLA ;pull the sprite's original blocked status
  339. AND #$04 ;check that it wasn't in the air
  340. BNE NoShake ;if it was on ground before moving, no shake
  341. PLA - Pull Accumulator
  342. PHX - Push X
  343. PLX - Pull X
  344. PHY - Push Y
  345. PHY ;preserve Y
  346. JSL $028663 ;make block shatter
  347. PLY ;bring back Y
  348. PLY - Pull Y
  349.  
  350. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  351. LDA #$03
  352. STA $19
  353. LDA $03,s ;pull byte from 3 bytes down in stack
  354. STA $0F
  355. RTS
  356. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  357. TCS - Transfer Accumulator C to Stack Pointer
  358. REP #$20
  359. LDA #$1100
  360. TCS
  361. TXS - Transfer X to Stack Pointer
  362. TSC - Transfer Stack Pointer to Accumulator C
  363. TSX - Transfer X to Stack Pointer
  364. TCD - Transfer 16-bit Accumulator to Direct Page, takes A & copies to direct
  365.  
  366. page
  367. LDA #$1200 ;load #$1200 to C
  368. TCD ;transfer C to direct page
  369. LDA $40 ;load from $1240
  370. TCD - Transfer Direct Page register to 16-bit Accumulator
  371. PHD - Push Direct Page register
  372. PLD - Pull Direct Page register
  373. PHD ;push direct page into the stack
  374. LDA #$00 ;Load #$00
  375. XBA ;Swap the bytes
  376. LDA #$13 ;Now load #$13
  377. TCD ;Set the direct page to #$1300
  378. LDA $37 ;Load these values starting from #$1300
  379. STA $38
  380. LDA $39
  381. STA $3A
  382. LDA $3B
  383. STA $3C
  384. LDA $3D
  385. STA $3E
  386. LDA $3F
  387. STA $40
  388. LDA $41
  389. STA $42
  390. LDA $43
  391. STA $44
  392. PLD ;pull direct page from stack
  393.  
  394. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  395. ; Patches ;
  396. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  397. header - tells xkas the rom has a header
  398. lorom - tells xkas the rom is in LoROM format
  399. org - loads a ROM address
  400. db - stores values at the starting ROM address
  401.  
  402. (See drop.asm for example)
  403.  
  404. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  405. ; Data Bank + Program Bank ;
  406. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  407. Program Bank - indicates the bank in which code is currently running
  408. Data Bank - indicates the bank from which data will be loaded if the specified
  409.  
  410. address isn't 24-bit
  411. LDA $A178,x ;\same thing, assuming data bank is 05
  412. LDA $05A178,x ;/
  413. opcode.l - force xkas to parse operand as 24-bit address
  414. LDA.l $8000,x ;assembles as $008000,x
  415. PHB - Push Data Bank Register, pushes value of data bank onto stack
  416. PLB - Pull Data Bank Register, pulls top byte of stack into data bank
  417. PHK - Push Program Bank Register, pushes value of program bank onto stack
  418. Wrapper:
  419. PHB ;pushes value of current data bank onto stack
  420. PHK ;pushes value of program bank onto stack
  421. PLB ;pulls value of the prgm bank into data bank
  422. JSR MainCode
  423. PLB ;pull original data bank value
  424. RTL
  425.  
  426. MainCode:
  427. ;some stuff here
  428. RTS
  429. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  430. PHB
  431. LDA #$02
  432. PHA ;push #$02 into stack
  433. PLB ;now the data bank is 02
  434. JSL $028663 ;subroutine that makes a block shatter
  435. PLB ;bring back original data bank value
  436.  
  437. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  438. ; Pointers+Indirect Addressing ;
  439. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  440. Examples:
  441. LDA #$14 ;\ store 14 to $01
  442. STA $01 ;/
  443. LDA #$20 ;\ store 20 to $00
  444. STA $00 ;/
  445. LDA ($00) ; Load from $1420
  446.  
  447. LDA #$7F ;\ store 7F to $02
  448. STA $02 ;/
  449. LDA #$14 ;\ store 14 to $01
  450. STA $01 ;/
  451. LDA #$20 ;\ store 20 to $00
  452. STA $00 ;/
  453. LDA [$00] ; Load from $7F1420
  454.  
  455. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  456.  
  457. HighBytes:
  458. db $10,$12,$14,$16
  459.  
  460. Code:
  461. LDA #$7F ;\ store 7F as the bank byte
  462. STA $02 ;/
  463. LDY $19 ;\
  464. LDA HighBytes,y ; | pick high byte depending on powerup status
  465. STA $01 ;/
  466. STZ $00 ; set 00 as the low byte
  467.  
  468. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  469.  
  470. LDA $0F33 ; load ones digit of the timer
  471. STA $01 ; make it the high byte
  472. STZ $00 ; now make it divisible by 100
  473. LDY $19 ; load powerup status to Y
  474. LDA ($00),y ; load $(ones digit)(powerup status)
  475.  
  476. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  477.  
  478. LDX $13BE ; item memory settings (can be 0-2)
  479. LDA #$F8 ; load F8
  480. CLC ;\add # of bytes from table depending on value
  481. ADC data1,x ;/
  482. STA $08 ; store that value to $08
  483. LDA #$19 ; load 19
  484. ADC data2,x ; add # of bytes from table depending on value
  485. STA $09 ; store that value to $09
  486.  
  487. data1: ;\
  488. .db $00,$80,$00 ; | if $13BE = 00, value is 19F8, first table
  489. ; | if = 01, value is 19F8+80, second table
  490. data2: ; | if = 02, value is 19F8+100, third table
  491. .db $00,$00,$01 ;/
  492.  
  493. LDY $57 ;
  494. AND #$07 ;
  495. TAX ;
  496. LDY $0E ; byte index into item memory table
  497. LDA ($08),y ; not the same as $19F8,y unless item memory setting = 0
  498.  
  499. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  500.  
  501. ($00,x) - Using [$00],x or ($00),x will not work. Using this method indexes the
  502.  
  503. pointer itself. ($00), y on the other hand indexes the address being pointed to.
  504. LDA #$88 : STA $00
  505. LDA #$99 : STA $01
  506. LDA #$AA : STA $02
  507. LDA #$BB : STA $03
  508. LDA #$CC : STA $04
  509. LDA #$DD : STA $05
  510. LDA #$EE : STA $06
  511. LDA #$FF : STA $07
  512.  
  513. LDA $13BF ; load overworld level number
  514. AND #$07 ; lower 3 bits of address
  515. TAX ; transfer the value to X
  516. LDA ($00,x) ; if at overworld level 20, x = 00, so start at $00, A
  517.  
  518. is whatever is at $9988
  519. ; if level = 19, x = 01, start at $AA99
  520.  
  521. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  522.  
  523. JMP ($0000)
  524. JMP ($0000,x)
  525. JML [$0000]
  526. JSR ($0000,x)
  527.  
  528. REP #$30
  529. LDA !LevelNum
  530. ASL A
  531. TAX
  532. LDA LevelPtrs,x
  533. STA $00
  534. SEP #$30
  535. LDX #$00 ; ensures that pointer will always be $0000
  536. JSR ($0000,x) ; jumps to levelasm code for particular level
  537.  
  538. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  539. JSL $0086DF - subroutine used for pointer tables, just load pointer index into
  540.  
  541. A, JSL to it, and put pointer table after - erases the three bytes JSL pushes
  542.  
  543. onto the stack when it executes
  544. STZ $1491
  545. LDA RAM_SpriteNum,X
  546. JSL ExecutePtr
  547.  
  548. dw ShellessKoopas ; 00 - Green Koopa, no shell
  549. dw ShellessKoopas ; 01 - Red Koopa, no shell
  550. dw Code
  551. ...
  552. Code:
  553. RTS
  554. JSL $0086FA - same as above, but for 24-bit pointers
  555. LDA $13BF
  556. AND #$07
  557. JSL $0086FA
  558.  
  559. dl Code1
  560. dl Code2
  561. ...
  562.  
  563. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  564.  
  565. LDA $1100
  566. JSR Routine
  567. Label1:
  568. RTS
  569.  
  570. Routine:
  571. LDY #$40
  572. PER $0007 ; 2 pointers * 2 + 3 = 7, if 24-bit pointers, 2 pointers
  573.  
  574. * 3 + 3 = 9
  575. JSL $0086DF
  576.  
  577. dw Sub1
  578. dw Sub2
  579.  
  580. Sub3:
  581. STA $43
  582. STY $44
  583. RTS
  584.  
  585. Sub1:
  586. STA $00
  587. RTS
  588.  
  589. Sub2:
  590. STY $01
  591. RTS
  592.  
  593. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  594.  
  595. LDA $1100
  596. JSL Routine
  597. Label1:
  598. RTS
  599.  
  600. Routine:
  601. LDY #$40
  602. PHK
  603. PER $0009 ; 2 pointers * 3 + 3 = 9
  604. JSL $0086FA
  605.  
  606. dl Sub1
  607. dl Sub2
  608.  
  609. Sub3:
  610. STA $43
  611. STY $44
  612. RTL
  613.  
  614. Sub1:
  615. STA $00
  616. RTL
  617.  
  618. Sub2:
  619. STY $01
  620. RTL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement