This bootloader right now just prints the letter A, but should be capable of reading blocks from the SD card into memory.
23 lines
400 B
ArmAsm
23 lines
400 B
ArmAsm
.export _sd_readblock
|
|
|
|
.autoimport
|
|
|
|
.importzp sreg
|
|
|
|
; sreg is the pointer to store the data
|
|
; a/y is the block address
|
|
; send command 17 with the block address of 00/y/a
|
|
|
|
; void sd_readblock(uint16_t addr, void* buf);
|
|
|
|
_sd_readblock:
|
|
sta sreg ; move buf pointer to sreg
|
|
stx sreg+1
|
|
|
|
jsr popax ; move addr to a/y
|
|
tya
|
|
|
|
ldx #$1 ; call interrupt 1
|
|
brk
|
|
|
|
rts |