Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Deepcopy/6502-Assembly/deepcopy-1.6502
Normal file
2
Task/Deepcopy/6502-Assembly/deepcopy-1.6502
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
LDA $00 ;read the byte at memory address $00
|
||||
STA $20 ;store it at memory address $20
|
||||
5
Task/Deepcopy/6502-Assembly/deepcopy-2.6502
Normal file
5
Task/Deepcopy/6502-Assembly/deepcopy-2.6502
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
LDA $00 ;read the byte at memory address $00
|
||||
STA $20 ;store it at memory address $20
|
||||
INC $00 ;add 1 to the original
|
||||
CMP $00 ;compare the copy to the original (we could have done LDA $20 first but they're the same value so why bother)
|
||||
BNE notEqual ;this branch will be taken.
|
||||
14
Task/Deepcopy/6502-Assembly/deepcopy-3.6502
Normal file
14
Task/Deepcopy/6502-Assembly/deepcopy-3.6502
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
;input:
|
||||
;$00,$01 = pointer to source
|
||||
;$07,$08 = pointer to destination
|
||||
;X = bytes to copy
|
||||
;(the memory addresses are arbitrary, but each pair of input addresses MUST be consecutive or this won't work.)
|
||||
memcpy:
|
||||
LDY #0
|
||||
memcpy_again:
|
||||
lda ($00),y
|
||||
sta ($07),y
|
||||
iny
|
||||
dex
|
||||
bne memcpy_again
|
||||
rts
|
||||
Loading…
Add table
Add a link
Reference in a new issue