; ; File generated by cc65 v 2.11.0 ; .fopt compiler,"cc65 v 2.11.0" .setcpu "6502" .smart on .autoimport on .case on .debuginfo on .importzp sp, sreg, regsave, regbank, tmp1, ptr1, ptr2 .macpack longbranch .dbg file, "fputc.c", 751, 1068141847 .dbg file, "../../include/stdio.h", 5945, 1113916546 .dbg file, "../../include/stddef.h", 2974, 1061022172 .dbg file, "../../include/stdarg.h", 2817, 1102777145 .dbg file, "../../include/unistd.h", 3912, 1061022172 .dbg file, "./_file.h", 742, 1084367783 .export _fputc .import _write ; --------------------------------------------------------------- ; int __fastcall__ fputc (int, struct _FILE*) ; --------------------------------------------------------------- .segment "CODE" .proc _fputc .segment "CODE" ; ; { ; .dbg line, "fputc.c", 22 jsr pushax ; ; if ((f->f_flags & _FOPEN) == 0 || (f->f_flags & (_FERROR | _FEOF)) != 0) { ; .dbg line, "fputc.c", 24 ldy #$01 jsr ldaxysp ldy #$01 sta ptr1 stx ptr1+1 lda (ptr1),y and #$01 beq L0005 jsr ldaxysp ldy #$01 sta ptr1 stx ptr1+1 lda (ptr1),y and #$06 beq L0004 ; ; return EOF; ; .dbg line, "fputc.c", 25 L0005: ldx #$FF txa jmp incsp4 ; ; if (write (f->f_fd, &c, 1) <= 0) { ; .dbg line, "fputc.c", 29 L0004: jsr decsp4 ldy #$05 jsr ldaxysp ldy #$00 sta ptr1 stx ptr1+1 ldx #$00 lda (ptr1),y ldy #$02 sta (sp),y iny txa sta (sp),y lda #$06 jsr leaasp ldy #$00 sta (sp),y iny txa sta (sp),y ldx #$00 tya jsr _write jsr pushax lda #$01 jsr toslta0 beq L000D ; ; f->f_flags |= _FERROR; ; .dbg line, "fputc.c", 31 ldy #$01 jsr ldaxysp sta ptr1 stx ptr1+1 ldy #$01 lda (ptr1),y ora #$04 sta (ptr1),y ; ; return EOF; ; .dbg line, "fputc.c", 32 ldx #$FF txa jmp incsp4 ; ; return c & 0xFF; ; .dbg line, "fputc.c", 36 L000D: ldy #$02 lda (sp),y ldx #$00 ; ; } ; .dbg line, "fputc.c", 37 jmp incsp4 .dbg line .endproc