-; Get the FILE* parameter, check if the file is open
-;
-
-getf: sta ptr1
- stx ptr1+1
- ldy #_FILE::f_flags
- lda (ptr1),y ; get f->f_flags
- and #_FOPEN ; file open?
- beq @L1 ; jump if no
- clc ; ok
- rts
-@L1: sec
+; Get the FILE* parameter, check if the file is open. Returns zero in A
+; and zero flag set in case of an error.
+
+.proc getf
+ sta ptr1
+ stx ptr1+1
+ ldy #_FILE::f_flags
+ lda (ptr1),y ; get f->f_flags
+ and #_FOPEN ; file open?