Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Jump-anywhere/6502-Assembly/jump-anywhere-1.6502
Normal file
1
Task/Jump-anywhere/6502-Assembly/jump-anywhere-1.6502
Normal file
|
|
@ -0,0 +1 @@
|
|||
JMP PrintChar ; jump to the label "PrintChar" where a routine to print a letter to the screen is located.
|
||||
5
Task/Jump-anywhere/6502-Assembly/jump-anywhere-2.6502
Normal file
5
Task/Jump-anywhere/6502-Assembly/jump-anywhere-2.6502
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
lda #<PrintChar ;load into A the low byte of the address that PrintChar references.
|
||||
sta $00
|
||||
lda #>PrintChar ;load into A the high byte of the address that PrintChar references.
|
||||
sta $01 ;these need to be stored low then high because the 6502 is a little-endian cpu
|
||||
JMP ($00) ;dereferences to JMP PrintChar
|
||||
8
Task/Jump-anywhere/6502-Assembly/jump-anywhere-3.6502
Normal file
8
Task/Jump-anywhere/6502-Assembly/jump-anywhere-3.6502
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
JumpTable_Lo: db <PrintChar, <WaitChar, <ReadKeys, <MoveMouse ;each is the low byte of a memory address
|
||||
JumpTable_Hi: db >PrintChar, >WaitChar, >ReadKeys, >MoveMouse ;each is the high byte of a memory address
|
||||
|
||||
lda JumpTable_Lo,x
|
||||
sta $10
|
||||
lda JumpTable_Hi,x
|
||||
sta $11
|
||||
JMP ($0010)
|
||||
5
Task/Jump-anywhere/6502-Assembly/jump-anywhere-4.6502
Normal file
5
Task/Jump-anywhere/6502-Assembly/jump-anywhere-4.6502
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
.org $8000
|
||||
JMP PrintChar
|
||||
JMP WaitChar
|
||||
JMP ReadKeys
|
||||
JMP MoveMouse
|
||||
7
Task/Jump-anywhere/6502-Assembly/jump-anywhere-5.6502
Normal file
7
Task/Jump-anywhere/6502-Assembly/jump-anywhere-5.6502
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
lda $80
|
||||
sta $21
|
||||
txa
|
||||
clc
|
||||
adc #$03
|
||||
sta $20
|
||||
JMP ($0020)
|
||||
7
Task/Jump-anywhere/6502-Assembly/jump-anywhere-6.6502
Normal file
7
Task/Jump-anywhere/6502-Assembly/jump-anywhere-6.6502
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
JumpTable:
|
||||
word PrintChar
|
||||
word PrintString
|
||||
word MoveMouse
|
||||
|
||||
ldx #$02
|
||||
JMP (JumpTable,x) ;dereferences to JMP PrintString
|
||||
1
Task/Jump-anywhere/6502-Assembly/jump-anywhere-7.6502
Normal file
1
Task/Jump-anywhere/6502-Assembly/jump-anywhere-7.6502
Normal file
|
|
@ -0,0 +1 @@
|
|||
ReturnTable: dw PrintChar-1,WaitChar-1,ReadKeys-1,MoveMouse-1
|
||||
15
Task/Jump-anywhere/6502-Assembly/jump-anywhere-8.6502
Normal file
15
Task/Jump-anywhere/6502-Assembly/jump-anywhere-8.6502
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
;execution is currently here
|
||||
JSR UseReturnTable ;the address just after this label is pushed onto the stack.
|
||||
;the chosen subroutine's RTS will bring you here.
|
||||
|
||||
|
||||
UseReturnTable: ;pretend this is somewhere far away from where execution is, its distance doesn't matter.
|
||||
ASL ;double the value of the variable, because this is a table of words.
|
||||
TAX
|
||||
LDA ReturnTable+1,x ;load the chosen subroutine's high byte into the accumulator
|
||||
PHA ;push it onto the stack
|
||||
LDA ReturnTable,x ;load the chosen subroutine's low byte into the accumulator
|
||||
PHA ;push it onto the stack.
|
||||
RTS ;this "RTS" actually takes you to the desired subroutine.
|
||||
;The top two bytes of the stack are popped, the low byte is incremented by 1,
|
||||
;and this value becomes the new program counter.
|
||||
Loading…
Add table
Add a link
Reference in a new issue