1
0
mirror of https://github.com/cc65/cc65.git synced 2026-03-11 08:41:58 +00:00
Files
cc65/libsrc/common/rewind.s
2025-01-01 14:32:07 +01:00

36 lines
664 B
ArmAsm

;
; Colin Leroy-Mira <colin@colino.net>
;
; void __fastcall__ rewind (FILE* f)
; /* Rewind a file */
;
.export _rewind
.import _fseek, _clearerr
.import pushax, pushl0, popax
.include "stdio.inc"
; ------------------------------------------------------------------------
; Code
.proc _rewind
; Push f twice (once for fseek, once for clearerr later)
jsr pushax
jsr pushax
; Push offset (long) zero
jsr pushl0
lda #SEEK_SET
jsr _fseek
; Clear error
jsr popax
jmp _clearerr
.endproc