1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-26 10:49:17 +00:00
8bitworkshop/presets/astrocade/hdr_autostart.s

30 lines
627 B
ArmAsm
Raw Normal View History

2018-08-29 01:41:51 +00:00
; Minimal header file for use with Astrocade C programs
2019-06-02 02:09:45 +00:00
.area _CODE
2019-06-02 02:09:45 +00:00
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
2019-05-29 01:05:19 +00:00
ld BC, #l__INITIALIZER
ld a,c
or b
2019-06-02 02:09:45 +00:00
jp z,.nomeminit
2019-05-29 01:05:19 +00:00
ld A, B
ld DE, #s__INITIALIZED
ld HL, #s__INITIALIZER
ldir
2019-06-02 02:09:45 +00:00
.nomeminit:
; jump to main C function
jp _main