Funnily enough I've just been through this to get graphics working on the tiki100, so appmake got updated to join an extra section the end of the binary.
Create an assembler file as follows and add it to your project:
Code: Select all
SECTION HIMEM
ORG 45000
routine:
ret
SECTION HIMEM_END
SECTION code_crt_init
; Code to move the HIMEM section to the right place in memory
EXTERN __BSS_END_tail
EXTERN __HIMEM_head
EXTERN __HIMEM_END_tail
ld hl,__BSS_END_tail
ld de,__HIMEM_head
ld bc,__HIMEM_END_tail - __HIMEM_head
ldir
appmake will stitch together a binary with the HIMEM code appended to the file.
There are other ways to do this using PHASE, but I've not got it to work across files, but the following should work if your high memory code is located in a single file:
Code: Select all
SECTION HIMEM
PHASE 45000
routine:
ret
SECTION HIMEM_END
SECTION code_crt_init
; Code to move the HIMEM section to the right place in memory
EXTERN __BSS_END_tail
EXTERN __HIMEM_head
EXTERN __HIMEM_END_tail
ld hl,__BSS_END_tail
ld de,_45000
ld bc,__HIMEM_END_tail - __HIMEM_head
ldir
which will create a single binary without the need for appmake