add xfseek

This commit is contained in:
jede
2023-03-17 23:10:15 +01:00
parent 7f1dd09bcb
commit c8c6fc6a40
2 changed files with 41 additions and 0 deletions

39
libsrc/telestrat/lseek.s Normal file
View File

@@ -0,0 +1,39 @@
;
; Jede (jede@oric.org), 2023-03-13
;
; off_t __fastcall__ lseek(int fd, off_t offset, int whence);
.export _lseek
.include "telestrat.inc"
.include "zeropage.inc"
.import popax
.proc _lseek
; Save whence
sta tmp1
; Skip X
; Get offset and store
jsr popax
sta tmp2
stx tmp3
jsr popax
sta RESB
stx RESB+1
; Get FD
jsr popax
; Does not need X
sta RES ; Save FD
lda tmp2
ldy tmp3
ldx tmp1 ; Get whence
BRK_TELEMON XFSEEK
rts
.endproc