1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-08 23:29:42 +00:00
8bitworkshop/presets/astrocade/hdr_autostart.s
2019-06-02 00:48:02 -04:00

28 lines
599 B
ArmAsm

; Minimal header file for use with Astrocade C programs
.area _CODE
jp Start ; jump to main()
Start:
ld hl,#0x4fce ; stack start
ld sp,hl ; setup stack pointer
; clear BIOS RAM
ld bc,#0x4fff-0x4fce
xor a ; A = 0
ld (hl),a ; set initial zero
push hl
pop de
inc de ; DE = HL + 1
ldir ; clear RAM
; initialize INITIALIZED segment
ld BC, #l__INITIALIZER
jp z,.nomeminit
ld A, B
ld DE, #s__INITIALIZED
ld HL, #s__INITIALIZER
ldir
.nomeminit:
; jump to main C function
jp _main