2002-06-22 10:58:24 +00:00
|
|
|
;
|
2021-12-24 03:24:55 +00:00
|
|
|
; 2002-06-22, Ullrich von Bassewitz
|
|
|
|
; 2021-12-23, Greg King
|
2002-06-22 10:58:24 +00:00
|
|
|
;
|
|
|
|
; Original C code by Marc 'BlackJack' Rintsch, 18.03.2001
|
|
|
|
;
|
|
|
|
; unsigned char __fastcall__ cbm_open (unsigned char lfn,
|
|
|
|
; unsigned char device,
|
|
|
|
; unsigned char sec_addr,
|
|
|
|
; const char* name);
|
|
|
|
; /* Opens a file. Works just like the BASIC command.
|
2014-06-30 09:10:35 +00:00
|
|
|
; ** Returns 0 if opening was successful, otherwise an errorcode (see table
|
|
|
|
; ** below).
|
|
|
|
; */
|
2002-06-22 10:58:24 +00:00
|
|
|
; {
|
|
|
|
; cbm_k_setlfs(lfn, device, sec_addr);
|
|
|
|
; cbm_k_setnam(name);
|
|
|
|
; return _oserror = cbm_k_open();
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _cbm_open
|
2021-12-24 03:24:55 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.import popa
|
2002-06-22 10:58:24 +00:00
|
|
|
.import _cbm_k_setlfs, _cbm_k_setnam, _cbm_k_open
|
|
|
|
.import __oserror
|
|
|
|
|
|
|
|
_cbm_open:
|
2021-12-24 03:24:55 +00:00
|
|
|
jsr _cbm_k_setnam
|
2002-06-22 10:58:24 +00:00
|
|
|
|
|
|
|
jsr popa ; Get sec_addr
|
|
|
|
jsr _cbm_k_setlfs ; Call SETLFS, pop all args
|
|
|
|
|
|
|
|
jsr _cbm_k_open
|
|
|
|
sta __oserror
|
|
|
|
rts
|