]> git.sur5r.net Git - cc65/blobdiff - libsrc/apple2/lseek.s
lseek: use STZ for APPLE2ENH
[cc65] / libsrc / apple2 / lseek.s
index 73f4136be835dfadee2435489bb9f0b0a804c707..6d5eba8a233b8eb19fdf74818e9745649a434bed 100644 (file)
@@ -5,7 +5,7 @@
 ;
 
         .export         _lseek
-        .import         popax
+        .import         popax, popptr1
 
         .include        "zeropage.inc"
         .include        "errno.inc"
@@ -18,9 +18,7 @@ _lseek:
         stx     tmp2
 
         ; Get and save offset
-        jsr     popax
-        sta     ptr1
-        stx     ptr1+1
+        jsr     popptr1
         jsr     popax
         sta     ptr2
 
@@ -86,6 +84,18 @@ seek_common:
         jsr     callmli
         bcs     oserr
 
+        ; Need to return the position in EAX
+        .ifdef  __APPLE2ENH__
+        stz     sreg+1
+        .else
+        lda     #0
+        sta     sreg+1
+        .endif
+        lda     mliparam + MLI::MARK::POSITION+2
+        sta     sreg
+        ldx     mliparam + MLI::MARK::POSITION+1
+        lda     mliparam + MLI::MARK::POSITION
+
         rts
 
         ; Load errno code