2018-09-14 13:10:41 +00:00
|
|
|
|
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
|
2018-09-14 13:10:41 +00:00
|
|
|
|
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
|
2019-06-02 14:53:39 +00:00
|
|
|
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
|
2018-09-14 13:10:41 +00:00
|
|
|
jp _main
|