mirror of
https://github.com/cc65/cc65.git
synced 2024-11-17 09:07:32 +00:00
Added the telldir() function.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5673 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
a83bf3dc04
commit
3a8365c445
@ -86,6 +86,7 @@ S_OBJS = c_acptr.o \
|
||||
scratch.o \
|
||||
sysremove.o \
|
||||
sysrename.o \
|
||||
telldir.o \
|
||||
toascii.o \
|
||||
wherex.o \
|
||||
wherey.o \
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
.struct DIR
|
||||
fd .word
|
||||
offs .word
|
||||
off .word
|
||||
name .byte 16+1
|
||||
.endstruct
|
||||
|
||||
|
35
libsrc/cbm/telldir.s
Normal file
35
libsrc/cbm/telldir.s
Normal file
@ -0,0 +1,35 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 2012-06-03
|
||||
;
|
||||
; Based on C code by Groepaz
|
||||
;
|
||||
; long __fastcall__ telldir (DIR *dir);
|
||||
;
|
||||
|
||||
|
||||
.include "dir.inc"
|
||||
.include "zeropage.inc"
|
||||
|
||||
|
||||
.proc _telldir
|
||||
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
|
||||
; Clear high word of returned value
|
||||
|
||||
lda #0
|
||||
sta sreg
|
||||
sta sreg+1
|
||||
|
||||
; Return dir->off
|
||||
|
||||
ldy #DIR::off+1
|
||||
lda (ptr1),y
|
||||
tax
|
||||
dey
|
||||
lda (ptr1),y
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
Loading…
Reference in New Issue
Block a user