1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-28 13:58:05 +11:00
collapseos/recipes/rc2014/sdcard/sdinit.asm

43 lines
512 B
NASM
Raw Normal View History

2019-05-08 05:26:52 +10:00
#include "jumptable.inc"
.org 0x9000
call JUMP_SDCINITALIZE
or a
2019-05-08 07:28:07 +10:00
jp nz, .error
ld hl, sOk
call JUMP_PRINTSTR
2019-05-08 07:28:07 +10:00
call JUMP_SDCSETBLKSIZE
or a
jp nz, .error
2019-05-08 07:28:07 +10:00
ld hl, sOk
2019-05-08 07:28:07 +10:00
call JUMP_PRINTSTR
; read sector 0
xor a
call JUMP_SDCREAD
or a
jp nz, .error
2019-05-08 07:28:07 +10:00
push hl
ld hl, sOk
2019-05-08 07:28:07 +10:00
call JUMP_PRINTSTR
pop hl
; SDC buffer address is in HL
; YOLO! print it!
2019-05-08 07:28:07 +10:00
call JUMP_PRINTSTR
ret
.error:
2019-05-08 07:28:07 +10:00
call JUMP_PRINTHEX
ld hl, sErr
call JUMP_PRINTSTR
2019-05-08 05:26:52 +10:00
ret
sOk:
.db "Ok", 0xa, 0xd, 0
sErr:
.db "Err", 0xa, 0xd, 0