LINKER_OPT = -m -i -o
SRC_CRT0 = crt0$(PLATFORM).s
OBJ_CRT0 = $(SRC_CRT0:.s=.rel)
-SRC_ASM =
+SRC_ASM = enter.s
OBJ_ASM = $(SRC_ASM:.s=.rel)
SRC_C = __argv.c abort.c asctime.c assert.c atexit.c
SRC_C += bcmp.c bcopy.c bsearch.c bzero.c calloc.c cfree.c clock.c closedir.c
--- /dev/null
+;
+; These are used for space saving with the modified sdcc
+;
+ .globl __enter, __enter_s
+
+__enter:
+ pop hl ; return address
+ push ix ; save frame pointer
+ ld ix, #0
+ add ix, sp ; set ix to the stack frame
+ jp (hl) ; and return
+
+__enter_s:
+ pop hl ; return address
+ push ix ; save frame pointer
+ ld ix, #0
+ add ix, sp ; frame pointer
+ ld e, (hl) ; size byte
+ ld d, #0xFF ; always minus something..
+ inc hl
+ ex de, hl
+ add hl, sp
+ ld sp, hl
+ push de
+ ret