]> git.sur5r.net Git - cc65/commitdiff
Place the zero page variables into the ZEROPAGE segment
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Sep 2000 21:49:13 +0000 (21:49 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 7 Sep 2000 21:49:13 +0000 (21:49 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@322 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/crt0.s
libsrc/atari/crt0.s
libsrc/c128/crt0.s
libsrc/c64/crt0.s
libsrc/cbm610/crt0.s
libsrc/pet/crt0.s
libsrc/plus4/crt0.s

index 08eb57fd9d8aa5b0776ea933b06a746ca50e6eca..c3530ccf62f1aa27756cfb83f9f6ba35482bfc56 100644 (file)
 ; Define and export the ZP variables for the C64 runtime
 
        .exportzp       sp, sreg, regsave
-       .exportzp       ptr1, ptr2, ptr3, ptr4
-       .exportzp       tmp1, tmp2, tmp3, tmp4
-       .exportzp       regbank, zpspace
-
-; These zero page entries overlap with the sweet-16 registers.
-; must be changed if sweet-16 is to be supported
-sp             =       $00             ; stack pointer
-sreg   =       $02             ; secondary register/high 16 bit for longs
-regsave        =       $04             ; slot to save/restore (E)AX into
-ptr1   =       $08             ;
-ptr2   =       $0A
-ptr3   =       $0C
-ptr4   =       $0E
-tmp1   =       $10
-tmp2   =       $11
-tmp3   =       $12
-tmp4   =       $13
-regbank        =       $14             ; 6 byte register bank
-zpspace        =       $1A             ; Zero page space allocated
+       .exportzp       ptr1, ptr2, ptr3, ptr4
+       .exportzp       tmp1, tmp2, tmp3, tmp4
+       .exportzp       regbank, zpspace
+
+; These zero page entries overlap with the sweet-16 registers in
+; the standard apple2 linker config. They must be changed if sweet-16
+; is to be supported
+
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; Actual code
index 92fea420aff709fe9c7c2e1fdfe195c2e77766ac..ca4a095d30f7f7ffa9714cd81a98e59942a0a28d 100644 (file)
        .exportzp       tmp1, tmp2, tmp3, tmp4
        .exportzp       fntemp, regbank, zpspace
 
-sp     = $D2           ; (2bytes) stack pointer
-sreg   = $D4           ; (2bytes) secondary register/high 16 bit for longs
-regsave = $D6          ; (4bytes) slot to save/restore (E)AX into
-ptr1   = $DA           ; (2bytes)
-ptr2   = $DC           ; (2bytes)
-ptr3   = $DE           ; (2bytes)
-ptr4   = $E0           ; (2bytes)
-tmp1   = $E2           ; (1byte)
-tmp2   = $E3           ; (1byte)
-tmp3   = $E4           ; (1byte)
-tmp4   = $E5           ; (1byte)
-fntemp = $E6           ; (2bytes) pointer to file name
-regbank = $E8          ; (6bytes) 6 byte register bank
-zpspace = $EE - sp     ; Zero page space allocated
+
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+fntemp:                .res    2       ; Pointer to file name
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; EXE header
@@ -86,12 +93,12 @@ L1: lda     sp,y
        sta     appmsav+1
 
        jsr     getmemtop       ; adjust for graphics mode to use
-       
+
        sta     sp
        sta     APPMHI
        stx     sp+1            ; Set argument stack ptr
        stx     APPMHI+1
-       
+
 ; set left margin to 0
 
        lda     LMARGN
@@ -104,7 +111,7 @@ L1: lda     sp,y
        ldx     SHFLOK
        stx     old_shflok
        sta     SHFLOK
-       
+
 ; Initialize the heap
 
        jsr     __hinit
@@ -160,7 +167,7 @@ _exit:      jsr     doatexit        ; call exit functions
        sta     SHFLOK
 
 ; restore APPMHI
-       
+
        lda     appmsav
        sta     APPMHI
        lda     appmsav+1
@@ -259,9 +266,9 @@ grmemusage:
 ;  220 GRAPHICS 0
 ;  230 FOR I=0 TO 31:PRINT #1;I;":",G(I);" - ";G(0)-G(I):NEXT I
 ;  240 CLOSE #1
-;  999 END 
+;  999 END
 ;  1000 VAL=PEEK(741)+256*PEEK(742)
-;  1010 RETURN 
+;  1010 RETURN
 
        .bss
 
index f10078d32cf672819a472d0bf06a5b9a8a92a9aa..eaad29ed45a06e3231f9bba9723b6f921d56ec7b 100644 (file)
        .exportzp       tmp1, tmp2, tmp3, tmp4
        .exportzp       regbank, zpspace
 
-sp             =       $02             ; stack pointer
-sreg   =       $04             ; secondary register/high 16 bit for longs
-regsave        =       $06             ; slot to save/restore (E)AX into
-ptr1   =       $0A             ;
-ptr2   =       $0C
-ptr3   =       $0E
-ptr4   =       $10
-tmp1   =       $12
-tmp2   =       $13
-tmp3   =       $14
-tmp4   =       $15
-regbank        =       $16             ; 6 byte register bank
-zpspace        =       $1A             ; Zero page space allocated
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; BASIC header with a SYS call
index 6d68f23ae4179eafcad2cc574455a4f2fa928861..1c5f3f97e9522a730accf9f047fb48739a460d42 100644 (file)
        .exportzp       tmp1, tmp2, tmp3, tmp4
        .exportzp       regbank, zpspace
 
-sp             =       $02             ; stack pointer
-sreg   =       $04             ; secondary register/high 16 bit for longs
-regsave        =       $06             ; slot to save/restore (E)AX into
-ptr1   =       $0A             ;
-ptr2   =       $0C
-ptr3   =       $0E
-ptr4   =       $10
-tmp1   =       $12
-tmp2   =       $13
-tmp3   =       $14
-tmp4   =       $15
-regbank =              $16             ; 6 byte register bank
-zpspace        =       $1A             ; Zero page space allocated
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; BASIC header with a SYS call
index 3ab5257e0395a850b4133e1a6c725f112d1c7f22..5a9a9011b66c70b05a78863b533c50df339ec6c2 100644 (file)
        .exportzp       crtc, sid, IPCcia, cia, acia, tpi1, tpi2
        .exportzp       ktab1, ktab2, ktab3, ktab4, time, RecvBuf, SendBuf
 
-sp             =       $02             ; stack pointer
-sreg   =       $04             ; secondary register/high 16 bit for longs
-regsave        =       $06             ; slot to save/restore (E)AX into
-ptr1   =       $0A             ;
-ptr2   =       $0C
-ptr3   =       $0E
-ptr4   =       $10
-tmp1   =       $12
-tmp2   =       $13
-tmp3   =       $14
-tmp4   =       $15
-regbank        =       $16             ; 6 byte register bank
-zpspace        =       $1A             ; Zero page space allocated
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; BASIC header and a small BASIC program. Since it is not possible to start
index 58e67eb05c74c713bdd4826da5dae993a1a96efe..6d1849d87c6f157be7b045960ca03e8246c41471 100644 (file)
        .exportzp       tmp1, tmp2, tmp3, tmp4
        .exportzp       regbank, zpspace
 
-sp             =       $02             ; stack pointer
-sreg   =       $04             ; secondary register/high 16 bit for longs
-regsave        =       $06             ; slot to save/restore (E)AX into
-ptr1   =       $0A             ;
-ptr2   =       $0C
-ptr3   =       $0E
-ptr4   =       $10
-tmp1   =       $12
-tmp2   =       $13
-tmp3   =       $14
-tmp4   =       $15
-regbank        =       $16             ; 6 byte register bank
-zpspace        =       $1A             ; Zero page space allocated
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; BASIC header with a SYS call
index 72fce209d2017042d57eb4b5232f6bb4757a0e9c..bdba66793ba89623477ddd55c0bf3476a87632cb 100644 (file)
        .exportzp       tmp1, tmp2, tmp3, tmp4
        .exportzp       regbank, zpspace
 
-sp             =       $02             ; stack pointer
-sreg   =       $04             ; secondary register/high 16 bit for longs
-regsave        =       $06             ; slot to save/restore (E)AX into
-ptr1   =       $0A             ;
-ptr2   =       $0C
-ptr3   =       $0E
-ptr4   =       $10
-tmp1   =       $12
-tmp2   =       $13
-tmp3   =       $14
-tmp4   =       $15
-regbank        =       $16             ; 6 byte register bank
-zpspace        =       $1A             ; Zero page space allocated
+.zeropage
+
+zpstart        = *
+sp:            .res    2       ; Stack pointer
+sreg:          .res    2       ; Secondary register/high 16 bit for longs
+regsave:       .res    2       ; slot to save/restore (E)AX into
+ptr1:          .res    2
+ptr2:          .res    2
+ptr3:          .res    2
+ptr4:          .res    2
+tmp1:          .res    1
+tmp2:          .res    1
+tmp3:          .res    1
+tmp4:          .res    1
+regbank:       .res    6       ; 6 byte register bank
+
+zpspace        = * - zpstart           ; Zero page space allocated
+
+.code
 
 ; ------------------------------------------------------------------------
 ; BASIC header with a SYS call