; ------------------------------------------------------------------------
; Constants
-IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector
+IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector
; ------------------------------------------------------------------------
-; Place the startup code in a special segment to cope with the quirks of
-; c128 banking.
-
-.segment "STARTUP"
-
; BASIC header with a SYS call
- .org $1BFF
+.segment "EXEHDR"
+
.word Head ; Load address
Head: .word @Next
.word .version ; Line number
.byte <(((Start / 1) .mod 10) + $30)
.byte $00 ; End of BASIC line
@Next: .word 0 ; BASIC end marker
- .reloc
; ------------------------------------------------------------------------
-; Actual code
+; Startup code
+
+.segment "STARTUP"
+
+Start:
; Close open files
-Start: jsr CLRCH
+ jsr CLRCH
; Switch to the second charset
; ------------------------------------------------------------------------
-; Place the startup code in a special segment.
-
-.segment "STARTUP"
-
; BASIC header with a SYS call
+.segment "EXEHDR"
+
.word Head ; Load address
Head: .word @Next
.word .version ; Line number
@Next: .word 0 ; BASIC end marker
; ------------------------------------------------------------------------
-; Actual code
+; Startup code
-Start: ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x ; save the zero page locations we need
- dex
- bpl L1
+.segment "STARTUP"
+
+Start:
; Close open files
jsr CLRCH
+; Save the zero page locations we need
+
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x
+ dex
+ bpl L1
+
; Switch to second charset
lda #14
; ------------------------------------------------------------------------
-; Place the startup code in a special segment.
-
-.segment "STARTUP"
-
; BASIC header with a SYS call
+.segment "EXEHDR"
+
.word Head ; Load address
Head: .word @Next
.word .version ; Line number
@Next: .word 0 ; BASIC end marker
; ------------------------------------------------------------------------
-; Actual code
+; Startup code
-Start: ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x ; Save the zero page locations we need
- dex
- bpl L1
+.segment "STARTUP"
+
+Start:
; Close open files
jsr CLRCH
+; Save the zero page locations we need
+
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x
+ dex
+ bpl L1
+
; Switch to second charset
lda #14
; that is overwritten later.
;
-.segment "BASICHDR"
+.segment "EXEHDR"
.byte $03,$00,$11,$00,$0a,$00,$81,$20,$49,$b2,$30,$20,$a4,$20,$34,$00
.byte $19,$00,$14,$00,$87,$20,$4a,$00,$27,$00,$1e,$00,$97,$20,$32,$35
; that is overwritten later.
;
-.segment "BASICHDR"
+.segment "EXEHDR"
.byte $03,$00,$11,$00,$0a,$00,$81,$20,$49,$b2,$30,$20,$a4,$20,$34,$00
.byte $19,$00,$14,$00,$87,$20,$4a,$00,$27,$00,$1e,$00,$97,$20,$32,$35
.include "../cbm/cbm.inc"
; ------------------------------------------------------------------------
-; Place the startup code in a special segment.
-
-.segment "STARTUP"
-
; BASIC header with a SYS call
+.segment "EXEHDR"
+
.word Head ; Load address
Head: .word @Next
.word .version ; Line number
@Next: .word 0 ; BASIC end marker
; ------------------------------------------------------------------------
-; Actual code
+; Startup code
-Start: ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x ; Save the zero page locations we need
- dex
- bpl L1
+.segment "STARTUP"
+
+Start:
; Close open files
jsr CLRCH
+; Save the zero page locations we need
+
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x
+ dex
+ bpl L1
+
; Switch to second charset. The routine that is called by BSOUT to switch the
; character set will use FNLEN as temporary storage - YUCK! Since the
; initmainargs routine, which parses the command line for arguments needs this
IRQInd = $500 ; JMP $0000 - used as indirect IRQ vector
; ------------------------------------------------------------------------
-; Place the startup code in a special segment to cope with the quirks of
-; plus/4 banking.
+; BASIC header with a SYS call
-.segment "STARTUP"
+.segment "EXEHDR"
.word Head ; Load address
Head: .word @Next
@Next: .word 0 ; BASIC end marker
; ------------------------------------------------------------------------
-; Actual code
+; Startup code
+
+.segment "STARTUP"
+
+Start:
-Start: sei ; No interrupts since we're banking out the ROM
+; Close open files
+
+ jsr $FFCC ; CLRCH
+
+; Save the zero page locations we need
+
+ sei ; No interrupts since we're banking out the ROM
sta ENABLE_RAM
ldx #zpspace-1
L1: lda sp,x
- sta zpsave,x ; save the zero page locations we need
+ sta zpsave,x
dex
bpl L1
sta ENABLE_ROM
cli
-; Close open files
-
- jsr $FFCC ; CLRCH
-
; Switch to second charset
lda #14
.include "vic20.inc"
; ------------------------------------------------------------------------
-; Place the startup code in a special segment.
-
-.segment "STARTUP"
-
; BASIC header with a SYS call
+.segment "EXEHDR"
+
.word Head ; Load address
Head: .word @Next
.word .version ; Line number
@Next: .word 0 ; BASIC end marker
; ------------------------------------------------------------------------
-; Actual code
+; Startup code
-Start: ldx #zpspace-1
-L1: lda sp,x
- sta zpsave,x ; Save the zero page locations we need
- dex
- bpl L1
+.segment "STARTUP"
+
+Start:
; Close open files
jsr CLRCH
+; Save the zero page locations we need
+
+ ldx #zpspace-1
+L1: lda sp,x
+ sta zpsave,x
+ dex
+ bpl L1
+
; Switch to second charset
lda #14
MEMORY {
ZP: start = $0002, size = $001A, type = rw, define = yes;
- RAM: start = $1Bff, size = $A401, file = %O, define = yes;
+ RAM: start = $1BFF, size = $A401, file = %O, define = yes;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
RAM: start = $0FFF, size = $7001, file = %O;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
RAM: start = $07FF, size = $C801, file = %O, define = yes;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
MEMORY {
- BASICHDR: start = $0001, size = $0050, fill = yes, fillval = 0, type = rw, file = %O;
+ HEADER: start = $0001, size = $0050, fill = yes, fillval = 0, type = rw, file = %O;
ZP: start = $0051, size = $00AD, fill = yes, fillval = 0, type = rw, file = %O, define = yes;
STARTUP: start = $00FE, size = $0102, fill = yes, fillval = 0, file = %O;
PAGE2: start = $0200, size = $0100, fill = yes, fillval = 0, file = %O;
VIDRAM: start = $F000, size = $0400, define = yes, file = "";
}
SEGMENTS {
- BASICHDR: load = BASICHDR, type = rw;
+ EXEHDR: load = HEADER, type = rw;
STARTUP: load = STARTUP, type = rw;
PAGE2: load = PAGE2, type = rw;
PAGE3: load = PAGE3, type = rw;
MEMORY {
- BASICHDR: start = $0001, size = $0050, type = rw, fill = yes, fillval = 0, file = %O;
+ HEADER: start = $0001, size = $0050, type = rw, fill = yes, fillval = 0, file = %O;
ZP: start = $0051, size = $00AD, type = rw, define = yes, fill = yes, fillval = 0, file = %O;
STARTUP: start = $00FE, size = $0102, fill = yes, fillval = 0, file = %O;
PAGE2: start = $0200, size = $0100, fill = yes, fillval = 0, file = %O;
PAGE3: start = $0300, size = $0100, fill = yes, fillval = 0, file = %O;
RAM: start = $0400, size = $FAAE, file = %O;
-}
+}
SEGMENTS {
- BASICHDR: load = BASICHDR, type = rw;
+ EXEHDR: load = HEADER, type = rw;
STARTUP: load = STARTUP, type = rw;
PAGE2: load = PAGE2, type = rw;
PAGE3: load = PAGE3, type = rw;
RAM: start = $03FF, size = $7BFF, file = %O;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
RAM: start = $0FFF, size = $ED01, file = %O;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
RAM: start = $11FF, size = $6E01, define = yes, file = %O;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;
RAM: start = $0FFF, size = $0E01, define = yes, file = %O;
}
SEGMENTS {
+ EXEHDR: load = RAM, type = ro;
STARTUP: load = RAM, type = ro;
LOWCODE: load = RAM, type = ro, optional = yes;
INIT: load = RAM, type = ro, define = yes, optional = yes;