1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +00:00

Merge pull request #695 from ops/cbmkernal_imports

CBM: Add imports for standard kernal entries
This commit is contained in:
Oliver Schmidt 2018-07-04 23:47:33 +02:00 committed by GitHub
commit cc5c0931a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 108 additions and 116 deletions

View File

@ -4,8 +4,9 @@
; unsigned char cbm_k_acptr (void);
;
.include "cbm.inc"
.export _cbm_k_acptr
.import ACPTR
_cbm_k_acptr:

View File

@ -4,8 +4,9 @@
; unsigned char cbm_k_basin (void);
;
.include "cbm.inc"
.export _cbm_k_basin
.import BASIN
_cbm_k_basin:

View File

@ -4,7 +4,8 @@
; void __fastcall__ cbm_k_bsout (unsigned char C);
;
.include "cbm.inc"
.export _cbm_k_bsout
.import BSOUT
_cbm_k_bsout = BSOUT

View File

@ -4,8 +4,10 @@
; unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
;
.include "cbm.inc"
.export _cbm_k_chkin
.import CHKIN
_cbm_k_chkin:
tax

View File

@ -4,7 +4,7 @@
; void __fastcall__ cbm_k_ciout (unsigned char C);
;
.import CIOUT
.include "cbm.inc"
.export _cbm_k_ciout := CIOUT

View File

@ -4,8 +4,9 @@
; unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
;
.include "cbm.inc"
.export _cbm_k_ckout
.import CKOUT
_cbm_k_ckout:

View File

@ -4,5 +4,6 @@
; void cbm_k_clall (void);
;
.import CLALL
.include "cbm.inc"
.export _cbm_k_clall := CLALL

View File

@ -4,11 +4,10 @@
; void __fastcall__ cbm_k_close (unsigned char FN);
;
.include "cbm.inc"
.export _cbm_k_close
.import CLOSE
_cbm_k_close:
clc
clc
jmp CLOSE

View File

@ -4,7 +4,8 @@
; void cbm_k_clrch (void);
;
.include "cbm.inc"
.export _cbm_k_clrch
.import CLRCH
_cbm_k_clrch = CLRCH

View File

@ -4,9 +4,9 @@
; unsigned char cbm_k_getin (void);
;
.export _cbm_k_getin
.import GETIN
.include "cbm.inc"
.export _cbm_k_getin
_cbm_k_getin:
jsr GETIN

View File

@ -4,10 +4,11 @@
; unsigned cbm_k_iobase (void);
;
.export _cbm_k_iobase
.import IOBASE
.include "cbm.inc"
_cbm_k_iobase:
.export _cbm_k_iobase
_cbm_k_iobase:
jsr IOBASE
txa
pha

View File

@ -4,10 +4,6 @@
; void __fastcall__ cbm_k_listen (unsigned char dev);
;
.import LISTEN
.include "cbm.inc"
.export _cbm_k_listen := LISTEN

View File

@ -4,8 +4,9 @@
; unsigned int __fastcall__ cbm_k_load (unsigned char flag, unsigned addr);
;
.include "cbm.inc"
.export _cbm_k_load
.import LOAD
.import __oserror
.import popa
.importzp ptr1
@ -27,4 +28,3 @@ _cbm_k_load:
tax
pla
rts

View File

@ -4,8 +4,9 @@
; unsigned char cbm_k_open (void);
;
.include "cbm.inc"
.export _cbm_k_open
.import OPEN
_cbm_k_open:

View File

@ -4,8 +4,9 @@
; unsigned char cbm_k_readst (void);
;
.include "cbm.inc"
.export _cbm_k_readst
.import READST
_cbm_k_readst:

View File

@ -4,8 +4,9 @@
; unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end);
;
.include "cbm.inc"
.export _cbm_k_save
.import SAVE
.import popptr1
.importzp ptr1, tmp1

View File

@ -4,5 +4,6 @@
; void cbm_k_scnkey (void);
;
.import SCNKEY
.include "cbm.inc"
.export _cbm_k_scnkey := SCNKEY

View File

@ -4,9 +4,8 @@
; void __fastcall__ cbm_k_second (unsigned char addr)
;
.include "cbm.inc"
.import SECOND
.export _cbm_k_second
.export _cbm_k_second
_cbm_k_second = SECOND

View File

@ -6,11 +6,12 @@
; unsigned char SA);
;
.include "cbm.inc"
.export _cbm_k_setlfs
.import SETLFS
.import popa
.importzp tmp1
_cbm_k_setlfs:
sta tmp1 ; Save SA
@ -19,5 +20,3 @@ _cbm_k_setlfs:
jsr popa ; Get LFN
ldy tmp1 ; Get SA
jmp SETLFS

View File

@ -4,10 +4,11 @@
; void __fastcall__ cbm_k_setnam (const char* Name);
;
.include "cbm.inc"
.export _cbm_k_setnam
.import SETNAM
.importzp ptr1
_cbm_k_setnam:
sta ptr1 ; Store pointer to file name
@ -21,4 +22,3 @@ _cbm_k_setnam:
ldx ptr1
ldy ptr1+1
jmp SETNAM

View File

@ -4,12 +4,6 @@
; void __fastcall__ cbm_k_talk (unsigned char dev);
;
.import TALK
.include "cbm.inc"
.export _cbm_k_talk := TALK

View File

@ -4,9 +4,8 @@
; void __fastcall__ cbm_k_tksa (unsigned char addr)
;
.include "cbm.inc"
.import TKSA
.export _cbm_k_tksa
.export _cbm_k_tksa
_cbm_k_tksa = TKSA

View File

@ -4,5 +4,6 @@
; void cbm_k_udtim (void);
;
.import UDTIM
.include "cbm.inc"
.export _cbm_k_udtim := UDTIM

View File

@ -4,5 +4,6 @@
; void cbm_k_unlsn (void);
;
.import UNLSN
.include "cbm.inc"
.export _cbm_k_unlsn := UNLSN

View File

@ -4,8 +4,8 @@
; void cbm_k_untlk (void);
;
.export _cbm_k_untlk
.import UNTLK
.include "cbm.inc"
.export _cbm_k_untlk
_cbm_k_untlk = UNTLK

View File

@ -7,46 +7,51 @@
; Subroutines available in the CBM jump table
;
;CINT = $FF81
;IOINIT = $FF84
;RAMTAS = $FF87
;RESTOR = $FF8A
;VECTOR = $FF8D
;SETMSG = $FF90
;SECOND = $FF93
;TKSA = $FF96
;MEMTOP = $FF99
;MEMBOT = $FF9C
;SCNKEY = $FF9F
;SETTMO = $FFA2
;ACPTR = $FFA5
;CIOUT = $FFA8
;UNTLK = $FFAB
;UNLSN = $FFAE
;LISTEN = $FFB1
;TALK = $FFB4
;READST = $FFB7
;SETLFS = $FFBA
;SETNAM = $FFBD
;OPEN = $FFC0
;CLOSE = $FFC3
;CHKIN = $FFC6
;CKOUT = $FFC9
;CLRCH = $FFCC
;BASIN = $FFCF
;BSOUT = $FFD2
;LOAD = $FFD5
;SAVE = $FFD8
;SETTIM = $FFDB
;RDTIM = $FFDE
;STOP = $FFE1
;GETIN = $FFE4
;CLALL = $FFE7
;UDTIM = $FFEA
;SCREEN = $FFED
;PLOT = $FFF0
;IOBASE = $FFF3
.import C64MODE
.import SWAPPER
.import SETBNK
.import CINT
.import IOINIT
.import RAMTAS
.import VECTOR
.import RESTOR
.import SETMSG
.import SECOND
.import TKSA
.import MEMTOP
.import MEMBOT
.import SCNKEY
.import SETTMO
.import ACPTR
.import CIOUT
.import UNTLK
.import UNLSN
.import LISTEN
.import TALK
.import READST
.import SETLFS
.import SETNAM
.import OPEN
.import CLOSE
.import LOAD
.import SAVE
.import SETTIM
.import RDTIM
.import SCREEN
.import PLOT
.import IOBASE
.import CHKIN
.import CKOUT
.import CLRCH
.import BASIN
.import CHRIN
.import BSOUT
.import CHROUT
.import STOP
.import GETIN
.import CLALL
.import UDTIM
;-----------------------------------------------------------------------------
; Device numbers
@ -63,5 +68,3 @@ CBMDEV_SCREEN = 3
MAX_DRIVES = 23
FIRST_DRIVE = 8

View File

@ -39,7 +39,6 @@
.include "cbm.inc"
.export _cbm_read
.import CHKIN, READST, BASIN, CLRCH
.importzp ptr1, ptr2, ptr3, tmp1
.import popax, popa
.import __oserror

View File

@ -31,11 +31,10 @@
.include "cbm.inc"
.export _cbm_write
.import CKOUT, READST, BSOUT, CLRCH
.importzp ptr1, ptr2, ptr3
.import popax, popa
.import __oserror
_cbm_write:
sta ptr3

View File

@ -4,10 +4,10 @@
; clock_t clock (void);
;
.export _clock
.import RDTIM
.importzp sreg
.include "cbm.inc"
.export _clock
.importzp sreg
.proc _clock
@ -19,4 +19,3 @@
rts
.endproc

View File

@ -6,7 +6,6 @@
.export _close
.import CLOSE
.import readdiskerror, closecmdchannel
.importzp tmp2
@ -17,7 +16,7 @@
;--------------------------------------------------------------------------
; _close
.proc _close
; Check if we have a valid handle
@ -64,7 +63,3 @@ invalidfd:
jmp __directerrno ; Set _errno, clear _oserror, return -1
.endproc

View File

@ -11,8 +11,6 @@
.export writediskcmd
.export writefndiskcmd
.import SETLFS, SETNAM, OPEN, CLOSE, BSOUT, BASIN
.import CHKIN, CKOUT, CLRCH
.import fncmd, fnlen, fnunit
.importzp tmp1, ptr1

View File

@ -8,11 +8,11 @@
.export fnadd, fnaddmode, fncomplete, fndefunit
.export fnunit, fnlen, fnisfile, fncmd, fnbuf
.import SETNAM
.import curunit, __filetype
.importzp ptr1, tmp1
.include "ctype.inc"
.include "cbm.inc"
;------------------------------------------------------------------------------

View File

@ -7,7 +7,6 @@
.export _open
.destructor closeallfiles, 5
.import SETLFS, OPEN, CLOSE
.import addysp, popax
.import scratch, fnparse, fnaddmode, fncomplete, fnset
.import opencmdchannel, closecmdchannel, readdiskerror
@ -18,6 +17,7 @@
.include "errno.inc"
.include "fcntl.inc"
.include "filedes.inc"
.include "cbm.inc"
;--------------------------------------------------------------------------

View File

@ -8,7 +8,6 @@
.export _read
.constructor initstdin
.import SETLFS, OPEN, CHKIN, BASIN, CLRCH, BSOUT, READST
.import rwcommon
.import popax
.importzp ptr1, ptr2, ptr3, tmp1, tmp2, tmp3

View File

@ -7,7 +7,6 @@
.export _write
.constructor initstdout
.import SETLFS, OPEN, CKOUT, BSOUT, READST, CLRCH
.import rwcommon
.importzp sp, ptr1, ptr2, ptr3