diff --git a/Makefile b/Makefile index 9ab0da8..4044551 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,7 @@ $(BUILDDIR)/%.rel: %.asm ${ASM} ${AFLAGS} -o $@ $< # mv -f $(addprefix $(basename $^), .lst .rel .sym) . -$(BUILDDIR)/rtlplayground.ihx: $(OBJS) $(BUILDDIR)/crtstart.rel $(BUILDDIR)/crc16.rel +$(BUILDDIR)/rtlplayground.ihx: $(OBJS) $(BUILDDIR)/crtbank.rel $(BUILDDIR)/crc16.rel $(CC) $(CC_FLAGS) -Wl-bHOME=0x00000 -Wl-bBANK1=0x14000 -Wl-bBANK2=0x24000 -Wl-r -o $@ $^ $(BUILDDIR)/rtlplayground.img: $(BUILDDIR)/rtlplayground.ihx diff --git a/crtbank.asm b/crtbank.asm new file mode 100644 index 0000000..7a00868 --- /dev/null +++ b/crtbank.asm @@ -0,0 +1,29 @@ + .area HOME (CODE) + .area GSINIT0 (CODE) + .area GSINIT1 (CODE) + .area GSINIT2 (CODE) + .area GSINIT3 (CODE) + .area GSINIT4 (CODE) + .area GSINIT5 (CODE) + .area GSINIT (CODE) + .area GSFINAL (CODE) + .area CSEG (CODE) + + + .area HOME (CODE) + +__sdcc_banked_call:: + push _PSBANK + xch a,r0 + push a + mov a,r1 + push a + mov a,r2 + anl a,#0x1f + mov _PSBANK, a + xch a, r0 + ret + +__sdcc_banked_ret:: + pop _PSBANK + ret diff --git a/crtstart.asm b/crtstart.asm deleted file mode 100644 index 23146a7..0000000 --- a/crtstart.asm +++ /dev/null @@ -1,17 +0,0 @@ - .area GSFINAL (CODE) - -__sdcc_banked_call:: - push _PSBANK - xch a,r0 - push a - mov a,r1 - push a - mov a,r2 - anl a,#0x1f - mov _PSBANK, a - xch a, r0 - ret - -__sdcc_banked_ret:: - pop _PSBANK - ret