Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,2 @@
LDA #10
CMP #11

View file

@ -0,0 +1,20 @@
BNE ;Branch on Not Equal - branch when the zero flag is set
BEQ ;Branch on EQual - branch when the zero flag is set.
;The zero flag is set when the result of an operation is zero
BMI ;Branch on MInus
BPL ;Branch on PLus - branch when the sign flag is cleared/set.
;The sign flag is set when the result of an instruction is a negative number
;and cleared when the result is a positive number
BVS ;Branch on oVerflow Set
BVC ;Branch on oVerflow Cleared - branch when the overflow flag is cleared/set.
;The overflow flag is set when the result of an addition/subtraction would
;result in a number larger than 127 or smaller than -128
BCS ;Branch on Carry Set
BCC ;Branch on Carry Clear - branch when the carry flag is cleared/set.
;The carry flag is set when an addition produced a carry and when
;a subtraction produced a borrow and cleared if an addition/subtraction
;does not produce a carry/borrow. The carry flag also holds bits
;after shifts and rotates.

View file

@ -0,0 +1,6 @@
LDA #200
CMP Variable
BEQ #3 ;if equal, skip ahead 3 bytes...
CLC ;if unequal, continue executing instructions
ADC #1
STA OtherVariable ; ...to here.

View file

@ -0,0 +1,4 @@
LDX #100
Loop: ...do something
DEX
BNE Loop

View file

@ -0,0 +1,21 @@
ReturnTable:
dw foo-1 ;each is a label to a section of code that ends in an RTS
dw bar-1
dw baz-1
ReturnSpoof: ;assume execution arrived here via a JSR command.
lda indexVariable ;contains the desired index into ReturnTable. 0 = foo, 1 = bar, 2 = baz.
asl ;the data is word length so the index must be multiplied by 2.
tax
lda ReturnTable+1,x ;get the high byte of the return address.
pha
lda ReturnTable,x ;get the low byte
pha
; Now, the desired subroutine's address minus 1 is on top of the stack.
; The RTS command will take this address and jump there. That routine's RTS command will act as the RTS from "ReturnSpoof",
; bringing execution to the point just after ReturnSpoof was called.
; If done properly, return spoofing will not corrupt the stack.
RTS ;this "RTS" acts as a JMP to the address we just put on the stack.