; ; 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, "perror.c", 2949, 1051217727 .dbg file, "../../include/stdio.h", 5945, 1113916546 .dbg file, "../../include/stddef.h", 2974, 1061022172 .dbg file, "../../include/stdarg.h", 2817, 1102777145 .dbg file, "../../include/string.h", 4676, 1116364269 .dbg file, "../../include/errno.h", 3647, 1060696125 .import _stderr .import _fprintf .export _perror .import _strerror .import __maperrno .import __errno .segment "RODATA" L0001: .byte $25,$53,$3A,$20,$25,$53,$0D,$00,$25,$53,$0D,$00 ; --------------------------------------------------------------- ; void __fastcall__ perror (const unsigned char*) ; --------------------------------------------------------------- .segment "CODE" .proc _perror .segment "CODE" ; ; { ; .dbg line, "perror.c", 43 jsr pushax ; ; const char* errormsg = strerror (errno); ; .dbg line, "perror.c", 45 jsr __maperrno lda __errno ldx __errno+1 jsr _strerror jsr pushax ; ; if (msg) { ; .dbg line, "perror.c", 48 ldy #$03 lda (sp),y dey ora (sp),y beq L0007 ; ; fprintf (stderr, "%s: %s\n", msg, errormsg); ; .dbg line, "perror.c", 49 jsr decsp4 lda _stderr ldx _stderr+1 sta (sp),y iny txa sta (sp),y lda #<(L0001) ldx #>(L0001) ldy #$00 sta (sp),y iny txa sta (sp),y ldy #$09 jsr pushwysp ldy #$09 jsr pushwysp ldy #$08 ; ; } else { ; .dbg line, "perror.c", 50 jmp L0013 ; ; fprintf (stderr, "%s\n", errormsg); ; .dbg line, "perror.c", 51 L0007: jsr decsp4 lda _stderr ldx _stderr+1 sta (sp),y iny txa sta (sp),y lda #<(L0001+8) ldx #>(L0001+8) ldy #$00 sta (sp),y iny txa sta (sp),y ldy #$07 jsr pushwysp ldy #$06 L0013: jsr _fprintf ; ; } ; .dbg line, "perror.c", 53 jmp incsp4 .dbg line .endproc