]> git.sur5r.net Git - cc65/commitdiff
kiec.s
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 19 Dec 2003 00:12:08 +0000 (00:12 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 19 Dec 2003 00:12:08 +0000 (00:12 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2781 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/cbm610/Makefile
libsrc/cbm610/cbm610.inc
libsrc/cbm610/crt0.s
libsrc/cbm610/kiobase.s [new file with mode: 0644]
libsrc/cbm610/krdtim.s [new file with mode: 0644]
libsrc/cbm610/kreadst.s [new file with mode: 0644]
libsrc/cbm610/kscreen.s [new file with mode: 0644]
libsrc/cbm610/ksetlfs.s [new file with mode: 0644]
libsrc/cbm610/ksetnam.s [new file with mode: 0644]
libsrc/cbm610/ksettim.s [new file with mode: 0644]
libsrc/cbm610/kupdst.s [new file with mode: 0644]

index 12ea8504c29b605d279fe3d1d56203fd367a5b33..fb8adf9fdf173fbd88c2830fe2e4557d240ada0e 100644 (file)
@@ -33,10 +33,19 @@ OBJS =      _scrsize.o      \
                crt0.o          \
                crtc.o          \
                kbhit.o         \
+        kiec.o          \
+        kiobase.o       \
                kirq.o          \
                kplot.o         \
+        krdtim.o        \
+        kreadst.o       \
        kscnkey.o       \
+        kscreen.o       \
+        ksetlfs.o       \
+        ksetnam.o       \
+        ksettim.o       \
        kudtim.o        \
+        kupdst.o        \
         mainargs.o      \
        peeksys.o       \
        pokesys.o       \
index 942c6bf846285c7ad6d2345ab338b89e0f0b9f00..6520b7ecd7df084bd857869ce3e1a58a80f41e15 100644 (file)
@@ -24,9 +24,8 @@ SendHead      = $24           ; Head of send buffer
 SendTail       = $25           ; Tail of send buffer
 SendFreeCnt    = $26           ; Number of bytes free in send buffer
 
-FileNameAdrLo          = $90
-FileNameAdrHi          = $91
-FileNameAdrSeg         = $92
+FNAM            := $90          ; File name address
+FNAM_SEG        := $92          ; Unused
 SaveAdrLow             = $93
 SaveAdrHi              = $94
 SaveAdrSeg             = $95
@@ -36,11 +35,11 @@ EndAdrSeg           = $98
 StartAdrLow            = $99
 StartAdrHi             = $9A
 StartAdrSeg            = $9B
-Status                 = $9C
-FileNameLen            = $9D
-LogicalAdr             = $9E
-FirstAdr               = $9F
-SecondAdr              = $A0
+ST              := $9C          ; Status
+FNAM_LEN        := $9D
+LFN             := $9E
+DEVNUM          := $9F
+SECADR          := $A0
 DefInpDev              = $A1
 DefOutDev              = $A2
 TapeBufPtr             = $A3
index 65fdf81e3252acf03f1f7426efaa27b33844d7d1..2de1a5f638b511078877e8db66a62f77dfacd61d 100644 (file)
@@ -12,7 +12,7 @@
        .import         push0, callmain
        .import         __BSS_RUN__, __BSS_SIZE__
        .import         irq, nmi
-               .import         k_irq, k_nmi, PLOT, UDTIM, SCNKEY
+               .import         k_irq, k_nmi
 
        .include        "zeropage.inc"
        .include        "cbm610.inc"
@@ -102,17 +102,17 @@ Back:     ldx     spsave
 ; use the stack (since it's in page 1)!
 
        tsx
-               stx     spsave          ; Save the system stackpointer
-       ldx     #$FF
-       txs                     ; Set up our own stack
+               stx     spsave          ; Save the system stackpointer
+       ldx     #$FF
+       txs                     ; Set up our own stack
 
 ; Set the interrupt, NMI and other vectors
 
-       ldy     #vectable_size
-L0:    lda     vectable-1,y
-       sta     $FF80,y
+       ldy     #vectors_size-1
+L0:            lda     vectors,y
+       sta     $10000 - vectors_size,y
        dey
-               bne     L0
+               bpl     L0
 
 ; Switch the indirect segment to the system bank
 
@@ -123,7 +123,7 @@ L0:         lda     vectable-1,y
 
        lda     #$90
        sta     ptr1
-       lda     #$00
+       lda     #$00
        sta     ptr1+1
        ldy     #$62-1
 L1:    lda     (ptr1),y
@@ -133,19 +133,19 @@ L1:       lda     (ptr1),y
 
 ; Copy the page 3 vectors in place
 
-       ldy     #$00
-L2:    lda     p3vectable,y
+       ldy     #$00
+L2:    lda     p3vectors,y
        sta     $300,y
        iny
-       cpy     #p3vectable_size
+       cpy     #p3vectors_size
                bne     L2
 
 ; Copy the rest of page 3 from the system bank
 
        lda     #$00
        sta     ptr1
-       lda     #$03
-       sta     ptr1+1
+       lda     #$03
+       sta     ptr1+1
 L3:    lda     (ptr1),y
        sta     $300,y
        iny
@@ -153,8 +153,8 @@ L3: lda     (ptr1),y
 
 ; Set the indirect segment to bank we're executing in
 
-       lda     ExecReg
-       sta     IndReg
+       lda     ExecReg
+       sta     IndReg
 
 ; Zero the BSS segment. We will do that here instead calling the routine
 ; in the common library, since we have the memory anyway, and this way,
@@ -222,59 +222,20 @@ Z4:
 ; Additional data that we need for initialization and that's overwritten
 ; later
 
-vectable:
-       jmp     $0000           ; CINT
-       jmp     $0000           ; IOINIT
-       jmp     $0000           ; RAMTAS
-       jmp     $0000           ; RESTOR
-       jmp     $0000           ; VECTOR
-       jmp     $0000           ; SETMSG
-       jmp     $0000           ; SECOND
-       jmp     $0000           ; TKSA
-       jmp     $0000           ; MEMTOP
-       jmp     $0000           ; MEMBOT
-       jmp     SCNKEY
-       jmp     $0000           ; SETTMO
-       jmp     $0000           ; ACPTR
-       jmp     $0000           ; CIOUT
-       jmp     $0000           ; UNTLK
-       jmp     $0000           ; UNLSN
-       jmp     $0000           ; LISTEN
-       jmp     $0000           ; TALK
-       jmp     $0000           ; READST
-               jmp     SETLFS
-               jmp     SETNAM
-       jmp     $0000           ; OPEN
-       jmp     $0000           ; CLOSE
-       jmp     $0000           ; CHKIN
-       jmp     $0000           ; CKOUT
-       jmp     $0000           ; CLRCH
-       jmp     $0000           ; BASIN
-       jmp     $0000           ; BSOUT
-       jmp     $0000           ; LOAD
-       jmp     $0000           ; SAVE
-       jmp     SETTIM
-               jmp     RDTIM
-       jmp     $0000           ; STOP
-       jmp     $0000           ; GETIN
-       jmp     $0000           ; CLALL
-       jmp     UDTIM
-       jmp     SCREEN
-       jmp     PLOT
-       jmp     IOBASE
-       sta     ExecReg
-       rts
-       .byte   $01             ; Filler
+vectors:
+               sta     ExecReg
+               rts
+               .byte   $01             ; Filler
                .word   nmi
                .word   0               ; Reset - not used
                .word   irq
-vectable_size  = * - vectable
+vectors_size   = * - vectors
 
-p3vectable:
-       .word   k_irq           ; IRQ user vector
-       .word   k_brk           ; BRK user vector
-       .word   k_nmi           ; NMI user vector
-p3vectable_size        = * - p3vectable
+p3vectors:
+       .word   k_irq           ; IRQ user vector
+       .word   k_brk           ; BRK user vector
+       .word   k_nmi           ; NMI user vector
+p3vectors_size = * - p3vectors
 
 
 ; ------------------------------------------------------------------------
@@ -327,66 +288,9 @@ Clear:     sta     $02,x
 ; Code that is copied into the system bank at $100 when switching back
 
 reset: cli
-       jmp     $8000                   ; BASIC cold start
+       jmp     $8000                   ; BASIC cold start
 reset_size = * - reset
 
-; ------------------------------------------------------------------------
-; Code for a few simpler kernal calls goes here
-
-.export IOBASE
-.proc   IOBASE
-       ldx     cia
-       ldy     cia+1
-       rts
-.endproc
-
-.export SCREEN
-.proc   SCREEN
-       ldx     #80             ; Columns
-       ldy     #25             ; Lines
-       rts
-.endproc
-
-.export SETLFS
-.proc   SETLFS
-        sta     LogicalAdr
-        stx     FirstAdr
-        sty     SecondAdr
-        rts
-.endproc
-
-.export SETNAM
-.proc   SETNAM
-        sta     FileNameLen
-        lda     $00,x
-        sta     FileNameAdrLo
-        lda     $01,x
-        sta     FileNameAdrHi
-        lda     $02,x
-        sta     FileNameAdrSeg
-        rts
-.endproc
-
-.export RDTIM
-.proc   RDTIM
-       sei
-       lda     time+0
-       ldx     time+1
-       ldy     time+2
-       cli
-       rts
-.endproc
-
-.export SETTIM
-.proc   SETTIM
-       sei
-       sta     time+0
-       stx     time+1
-       sty     time+2
-       cli
-       rts
-.endproc
-
 ; -------------------------------------------------------------------------
 ; Data area - switch back to relocatable mode
 
diff --git a/libsrc/cbm610/kiobase.s b/libsrc/cbm610/kiobase.s
new file mode 100644 (file)
index 0000000..1f21f02
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 2003-12-19
+;
+; IOBASE kernal call
+;
+
+        .export         IOBASE
+        .import         cia : zeropage
+
+
+
+.proc   IOBASE
+
+       ldx     cia
+       ldy     cia+1
+       rts
+
+.endproc
+
diff --git a/libsrc/cbm610/krdtim.s b/libsrc/cbm610/krdtim.s
new file mode 100644 (file)
index 0000000..85e2f5a
--- /dev/null
@@ -0,0 +1,21 @@
+;
+; Ullrich von Bassewitz, 2003-12-19
+;
+; RDTIM kernal call
+;
+
+        .export         RDTIM
+        .import         time : zeropage
+
+
+.proc   RDTIM
+
+       sei
+       lda     time+0
+       ldx     time+1
+       ldy     time+2
+       cli
+       rts
+
+.endproc
+
diff --git a/libsrc/cbm610/kreadst.s b/libsrc/cbm610/kreadst.s
new file mode 100644 (file)
index 0000000..0920a38
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 2003-12-19
+;
+; READST kernal call
+;
+
+        .export         READST
+
+        .include        "cbm610.inc"
+
+
+.proc   READST
+
+        lda     ST                      ; Load status
+        rts                             ; Return to caller
+
+.endproc
+
+
diff --git a/libsrc/cbm610/kscreen.s b/libsrc/cbm610/kscreen.s
new file mode 100644 (file)
index 0000000..c25d192
--- /dev/null
@@ -0,0 +1,16 @@
+;
+; Ullrich von Bassewitz, 2003-12-19
+;
+; SCREEN kernal call
+;
+
+        .export         SCREEN
+
+
+.proc   SCREEN
+
+       ldx     #80             ; Columns
+       ldy     #25             ; Lines
+       rts
+
+.endproc
diff --git a/libsrc/cbm610/ksetlfs.s b/libsrc/cbm610/ksetlfs.s
new file mode 100644 (file)
index 0000000..a71410c
--- /dev/null
@@ -0,0 +1,19 @@
+;
+; Ullrich von Bassewitz, 2003-12-18
+;
+; SETLFS replacement function
+;
+
+        .export         SETLFS
+
+        .include        "cbm610.inc"
+
+
+.proc   SETLFS
+        sta     LFN
+        stx     DEVNUM
+        sty     SECADR
+        rts                             ; Return to caller
+.endproc
+
+
diff --git a/libsrc/cbm610/ksetnam.s b/libsrc/cbm610/ksetnam.s
new file mode 100644 (file)
index 0000000..841b883
--- /dev/null
@@ -0,0 +1,25 @@
+;
+; Ullrich von Bassewitz, 2003-12-18
+;
+; SETNAM kernal call.
+;
+; NOTE: The routine does not work like that in the CBM610 kernal (which works
+; different than that on all other CBMs). Instead, it works like on all other
+; Commodore machines. No segment has to be passed, the current segment is
+; assumed.
+
+        .export         SETNAM
+
+       .include        "cbm610.inc"
+
+.proc   SETNAM
+
+        sta     FileNameLen
+        stx     FileNameAdrLo
+        sty     FileNameAdrHi
+        rts
+
+.endproc
+
+
+
diff --git a/libsrc/cbm610/ksettim.s b/libsrc/cbm610/ksettim.s
new file mode 100644 (file)
index 0000000..dab570f
--- /dev/null
@@ -0,0 +1,21 @@
+;
+; Ullrich von Bassewitz, 2003-12-19
+;
+; SETTIM kernal call
+;
+
+        .export         SETTIM
+        .import         time : zeropage
+
+
+.proc   SETTIM
+
+       sei
+       sta     time+0
+       stx     time+1
+       sty     time+2
+       cli
+       rts
+
+.endproc
+
diff --git a/libsrc/cbm610/kupdst.s b/libsrc/cbm610/kupdst.s
new file mode 100644 (file)
index 0000000..04d29ec
--- /dev/null
@@ -0,0 +1,20 @@
+;
+; Ullrich von Bassewitz, 2003-12-18
+;
+; UPDST kernal call.
+;
+
+        .export         UPDST
+
+       .include        "cbm610.inc"
+
+.proc   UPDST
+
+        ora     ST
+        sta     ST
+        rts
+
+.endproc
+
+
+