aboutsummaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorThomas Albers Raviola <thomas@thomaslabs.org>2024-12-03 21:45:47 +0100
committerThomas Albers Raviola <thomas@thomaslabs.org>2024-12-03 21:45:47 +0100
commitd46862a5bd2319c595b11427f781201ca063d194 (patch)
treee83d3f40c60233a1da85334745b882f188b0be52 /asm
parent9cd14efb76a4ddbcd013f44d50dc1ff93d56c4ca (diff)
Add bootloader
Diffstat (limited to 'asm')
-rw-r--r--asm/crt0.asm10
1 files changed, 5 insertions, 5 deletions
diff --git a/asm/crt0.asm b/asm/crt0.asm
index 523c39e..fd03997 100644
--- a/asm/crt0.asm
+++ b/asm/crt0.asm
@@ -6,22 +6,22 @@
.area _HEADER (ABS)
.org 0x0000
start:
+ di
xor a
ld i, a
ld sp, #0x0000
- di
;; Init PIO and check for KEY2
ld a, #PIO_MODE_3
out (PORT_B_CTRL), a
ld a, #0x7F
out (PORT_B_CTRL), a
in a, (PORT_B_DATA)
- and #0x02 ; is KEY2 pressed? If so, start booloader
+ and #KEY2 ; is KEY2 pressed? If so, start booloader
jr NZ, main
;; Load payload (bootloader)
- ld HL, #0x7000
- ld DE, #0x8000
- ld BC, #0x1000
+ ld hl, #0x7000 ; src
+ ld de, #0x8000 ; dest
+ ld bc, #0x1000 ; size
ldir
;; Start bootloader
jp 0x8000