This commit is contained in:
Michael Steil 2008-10-13 03:10:48 +00:00
parent babaa8be94
commit 4574fd1983
5 changed files with 55 additions and 75 deletions

View File

@ -1,4 +1,3 @@
* split into files
* use linker magic to compile files separately
* convert messy init code into completely different
files without ifdefs (not much in common!)

44
defines.s Normal file
View File

@ -0,0 +1,44 @@
.if .def(cbmbasic1)
CBM1 := 1
.include "defines_cbm.s"
.elseif .def(osi)
OSI := 1
.include "defines_osi.s"
.elseif .def(applesoft)
APPLE := 1
.include "defines_apple.s"
.elseif .def(kb9)
KIM := 1
.include "defines_kim.s"
.elseif .def(cbmbasic2)
CBM2 := 1
.include "defines_cbm.s"
.elseif .def(kbdbasic)
KBD := 1
.include "defines_kbd.s"
.endif
.ifdef CONFIG_SMALL
BYTES_FP := 4
.else
BYTES_FP := 5
.endif
.ifdef APPLE
BYTES_PER_ELEMENT := 6 ; ???
.else
BYTES_PER_ELEMENT := BYTES_FP
.endif
BYTES_PER_VARIABLE := BYTES_FP+2
MANTISSA_BYTES := BYTES_FP-1
BYTES_PER_FRAME := 2*BYTES_FP+8
FOR_STACK1 := 2*BYTES_FP+5
FOR_STACK2 := BYTES_FP+4
.ifdef CBM1
MAX_EXPON = 12
.else
MAX_EXPON = 10
.endif
STACK := $0100

5
header.s Normal file
View File

@ -0,0 +1,5 @@
.segment "HEADER"
.ifdef KBD
jmp LE68C
.byte $00,$13,$56
.endif

View File

@ -2,104 +2,34 @@
.debuginfo +
.if .def(cbmbasic1)
CBM1 := 1
.include "defines_cbm.s"
.elseif .def(osi)
OSI := 1
.include "defines_osi.s"
.elseif .def(applesoft)
APPLE := 1
.include "defines_apple.s"
.elseif .def(kb9)
KIM := 1
.include "defines_kim.s"
.elseif .def(cbmbasic2)
CBM2 := 1
.include "defines_cbm.s"
.elseif .def(kbdbasic)
KBD := 1
.include "defines_kbd.s"
.endif
.ifdef CONFIG_SMALL
BYTES_FP := 4
.else
BYTES_FP := 5
.endif
.ifdef APPLE
BYTES_PER_ELEMENT := 6 ; ???
.else
BYTES_PER_ELEMENT := BYTES_FP
.endif
BYTES_PER_VARIABLE := BYTES_FP+2
MANTISSA_BYTES := BYTES_FP-1
BYTES_PER_FRAME := 2*BYTES_FP+8
FOR_STACK1 := 2*BYTES_FP+5
FOR_STACK2 := BYTES_FP+4
.ifdef CBM1
MAX_EXPON = 12
.else
MAX_EXPON = 10
.endif
.setcpu "6502"
.macpack longbranch
.include "defines.s"
.include "macros.s"
.include "zeropage.s"
.setcpu "6502"
.macpack longbranch
STACK := $0100
.segment "HEADER"
.ifdef KBD
jmp LE68C
.byte $00,$13,$56
.endif
.include "header.s"
.include "token.s"
.include "error.s"
.include "message.s"
.include "memory.s"
.include "program.s"
.include "flow.s"
.include "misc1.s"
.include "print.s"
.include "input.s"
.include "eval.s"
.include "var.s"
.include "array.s"
.include "misc2.s"
.include "string.s"
.include "misc3.s"
.ifndef KBD
.include "poke.s"
.endif
.include "float.s"
.include "chrget.s"
.include "rnd.s"
.include "trig.s"
.include "init.s"

View File

@ -118,3 +118,5 @@ TXTPTR = <(GENERIC_TXTPTR-GENERIC_CHRGET + CHRGET)
L00CF:
RNDSEED = <(GENERIC_RNDSEED-GENERIC_CHRGET + CHRGET)
.endif