; ; 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, "fdopen.c", 750, 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/fcntl.h", 3407, 1101568713 .dbg file, "../../include/errno.h", 3647, 1060696125 .dbg file, "./_file.h", 742, 1084367783 .export _fdopen .import __errno .import __fdesc ; --------------------------------------------------------------- ; struct _FILE* __fastcall__ fdopen (int, const unsigned char*) ; --------------------------------------------------------------- .segment "CODE" .proc _fdopen .segment "CODE" ; ; { ; .dbg line, "fdopen.c", 23 jsr pushax ; ; if (!(f = _fdesc ())) { ; .dbg line, "fdopen.c", 27 jsr decsp2 jsr __fdesc ldy #$00 jsr staxysp stx tmp1 ora tmp1 bne L0004 ; ; _errno = EMFILE; /* Too many files */ ; .dbg line, "fdopen.c", 29 tax lda #$05 sta __errno stx __errno+1 ; ; return 0; ; .dbg line, "fdopen.c", 30 txa jmp incsp6 ; ; f->f_fd = handle; ; .dbg line, "fdopen.c", 34 L0004: ldy #$01 jsr ldaxysp sta sreg stx sreg+1 ldy #$04 lda (sp),y ldy #$00 sta (sreg),y ; ; f->f_flags = _FOPEN; ; .dbg line, "fdopen.c", 35 iny jsr ldaxysp sta sreg stx sreg+1 lda #$01 tay sta (sreg),y ; ; return f; ; .dbg line, "fdopen.c", 38 jsr ldaxysp ; ; } ; .dbg line, "fdopen.c", 39 jmp incsp6 .dbg line .endproc