; unsigned char cbm_k_acptr (void);
;
+ .include "cbm.inc"
.export _cbm_k_acptr
- .import ACPTR
_cbm_k_acptr:
; unsigned char cbm_k_basin (void);
;
+ .include "cbm.inc"
.export _cbm_k_basin
- .import BASIN
_cbm_k_basin:
; void __fastcall__ cbm_k_bsout (unsigned char C);
;
+ .include "cbm.inc"
.export _cbm_k_bsout
- .import BSOUT
_cbm_k_bsout = BSOUT
; unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
;
+ .include "cbm.inc"
.export _cbm_k_chkin
- .import CHKIN
+
_cbm_k_chkin:
tax
; void __fastcall__ cbm_k_ciout (unsigned char C);
;
- .import CIOUT
- .export _cbm_k_ciout := CIOUT
-
+ .include "cbm.inc"
+ .export _cbm_k_ciout := CIOUT
; unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
;
+ .include "cbm.inc"
.export _cbm_k_ckout
- .import CKOUT
_cbm_k_ckout:
; void cbm_k_clall (void);
;
- .import CLALL
+ .include "cbm.inc"
.export _cbm_k_clall := CLALL
; void __fastcall__ cbm_k_close (unsigned char FN);
;
+ .include "cbm.inc"
.export _cbm_k_close
- .import CLOSE
_cbm_k_close:
- clc
+ clc
jmp CLOSE
-
-
; void cbm_k_clrch (void);
;
+ .include "cbm.inc"
.export _cbm_k_clrch
- .import CLRCH
_cbm_k_clrch = CLRCH
; unsigned char cbm_k_getin (void);
;
+ .include "cbm.inc"
.export _cbm_k_getin
- .import GETIN
_cbm_k_getin:
; unsigned cbm_k_iobase (void);
;
+ .include "cbm.inc"
.export _cbm_k_iobase
- .import IOBASE
-_cbm_k_iobase:
+_cbm_k_iobase:
jsr IOBASE
txa
pha
; void __fastcall__ cbm_k_listen (unsigned char dev);
;
- .import LISTEN
+ .include "cbm.inc"
.export _cbm_k_listen := LISTEN
-
-
-
-
-
; 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
tax
pla
rts
-
; unsigned char cbm_k_open (void);
;
+ .include "cbm.inc"
.export _cbm_k_open
- .import OPEN
_cbm_k_open:
; unsigned char cbm_k_readst (void);
;
+ .include "cbm.inc"
.export _cbm_k_readst
- .import READST
_cbm_k_readst:
; 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
; void cbm_k_scnkey (void);
;
- .import SCNKEY
+ .include "cbm.inc"
.export _cbm_k_scnkey := SCNKEY
; void __fastcall__ cbm_k_second (unsigned char addr)
;
-
- .import SECOND
- .export _cbm_k_second
+ .include "cbm.inc"
+ .export _cbm_k_second
_cbm_k_second = SECOND
-
; unsigned char SA);
;
+ .include "cbm.inc"
.export _cbm_k_setlfs
- .import SETLFS
.import popa
.importzp tmp1
-
+
_cbm_k_setlfs:
sta tmp1 ; Save SA
jsr popa ; Get LFN
ldy tmp1 ; Get SA
jmp SETLFS
-
-
; 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
ldx ptr1
ldy ptr1+1
jmp SETNAM
-
; void __fastcall__ cbm_k_talk (unsigned char dev);
;
- .import TALK
+ .include "cbm.inc"
.export _cbm_k_talk := TALK
-
-
-
-
-
-
-
; void __fastcall__ cbm_k_tksa (unsigned char addr)
;
-
- .import TKSA
- .export _cbm_k_tksa
+ .include "cbm.inc"
+ .export _cbm_k_tksa
_cbm_k_tksa = TKSA
-
; void cbm_k_udtim (void);
;
- .import UDTIM
+ .include "cbm.inc"
.export _cbm_k_udtim := UDTIM
; void cbm_k_unlsn (void);
;
- .import UNLSN
+ .include "cbm.inc"
.export _cbm_k_unlsn := UNLSN
; void cbm_k_untlk (void);
;
+ .include "cbm.inc"
.export _cbm_k_untlk
- .import UNTLK
-
_cbm_k_untlk = UNTLK
.include "cbm.inc"
.export _cbm_read
- .import CHKIN, READST, BASIN, CLRCH
.importzp ptr1, ptr2, ptr3, tmp1
.import popax, popa
.import __oserror
.include "cbm.inc"
.export _cbm_write
- .import CKOUT, READST, BSOUT, CLRCH
.importzp ptr1, ptr2, ptr3
.import popax, popa
.import __oserror
-
+
_cbm_write:
sta ptr3
; clock_t clock (void);
;
+ .include "cbm.inc"
.export _clock
- .import RDTIM
.importzp sreg
-
.proc _clock
lda #0 ; Byte 3 is always zero
rts
.endproc
-
.export _close
- .import CLOSE
.import readdiskerror, closecmdchannel
.importzp tmp2
;--------------------------------------------------------------------------
; _close
-
+
.proc _close
; Check if we have a valid handle
jmp __directerrno ; Set _errno, clear _oserror, return -1
.endproc
-
-
-
-
.export writediskcmd
.export writefndiskcmd
- .import SETLFS, SETNAM, OPEN, CLOSE, BSOUT, BASIN
- .import CHKIN, CKOUT, CLRCH
.import fncmd, fnlen, fnunit
.importzp tmp1, ptr1
.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"
;------------------------------------------------------------------------------
.export _open
.destructor closeallfiles, 5
- .import SETLFS, OPEN, CLOSE
.import addysp, popax
.import scratch, fnparse, fnaddmode, fncomplete, fnset
.import opencmdchannel, closecmdchannel, readdiskerror
.include "errno.inc"
.include "fcntl.inc"
.include "filedes.inc"
+ .include "cbm.inc"
;--------------------------------------------------------------------------
.export _read
.constructor initstdin
- .import SETLFS, OPEN, CHKIN, BASIN, CLRCH, BSOUT, READST
.import rwcommon
.import popax
.importzp ptr1, ptr2, ptr3, tmp1, tmp2, tmp3
.export _write
.constructor initstdout
- .import SETLFS, OPEN, CKOUT, BSOUT, READST, CLRCH
.import rwcommon
.importzp sp, ptr1, ptr2, ptr3