; ; File generated by cc65 v 2.19 - Git fe19dd1 ; .fopt compiler,"cc65 v 2.19 - Git fe19dd1" .setcpu "65C02" .smart on .autoimport on .case on .debuginfo on .importzp c_sp, sreg, regsave, regbank .importzp tmp1, tmp2, tmp3, tmp4, ptr1, ptr2, ptr3, ptr4 .macpack longbranch .dbg file, "common/getopt.c", 2509, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/stdio.h", 6999, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/stdlib.h", 6948, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/string.h", 5678, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/unistd.h", 4340, 1794640055 .dbg sym, "stderr", "00", extern, "_stderr" .import _stderr .import _fputc .import _fputs .import _strchr .export _optarg .export _optind .export _opterr .export _optopt .export _getopt .segment "DATA" _opterr: .word $0001 _optind: .word $0001 .segment "RODATA" S0004: .byte $3A,$20,$6F,$70,$74,$69,$6F,$6E,$20,$72,$65,$71,$75,$69,$72,$65 .byte $73,$20,$61,$6E,$20,$61,$72,$67,$75,$6D,$65,$6E,$74,$20,$2D,$2D .byte $20,$00 S0002: .byte $3A,$20,$69,$6C,$6C,$65,$67,$61,$6C,$20,$6F,$70,$74,$69,$6F,$6E .byte $20,$2D,$2D,$20,$00 S0003 := S0004+33 S0005 := S0004+33 S0001 := S0004+33 .segment "BSS" _optarg: .res 2,$00 _optopt: .res 2,$00 ; --------------------------------------------------------------- ; int __near__ __fastcall__ getopt (int argc, char * const *argv, const char *optstring) ; --------------------------------------------------------------- .segment "CODE" .proc _getopt: near .dbg func, "getopt", "00", static, "_getopt" .dbg sym, "argc", "00", auto, 4 .dbg sym, "argv", "00", auto, 2 .dbg sym, "optstring", "00", auto, 0 .dbg sym, "oli", "00", register, "regbank", 4 .segment "CODE" .dbg line, "common/getopt.c", 36 jsr pushax .dbg line, "common/getopt.c", 39 lda regbank+4 ldx regbank+5 jsr pushax .dbg line, "common/getopt.c", 41 lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) bne L0007 .dbg line, "common/getopt.c", 42 lda _optind ldy #$06 cmp (c_sp),y lda _optind+1 iny sbc (c_sp),y bvs L001B eor #$80 L001B: bmi L001E lda _optind ldx _optind+1 jsr aslax1 clc ldy #$04 adc (c_sp),y pha txa iny adc (c_sp),y tax pla jsr ldaxi sta M0001 stx M0001+1 sta ptr1 stx ptr1+1 lda (ptr1) cmp #$2D bne L001E inc M0001 bne L0005 inc M0001+1 L0005: lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) bne L0003 .dbg line, "common/getopt.c", 43 L001E: ldx #$FF txa jmp L0001 .dbg line, "common/getopt.c", 45 L0003: lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) cmp #$2D bne L0007 .dbg line, "common/getopt.c", 47 inc _optind bne L0008 inc _optind+1 .dbg line, "common/getopt.c", 48 L0008: ldx #$FF txa jmp L0001 .dbg line, "common/getopt.c", 53 L0007: lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) sta _optopt stz _optopt+1 cmp #$3A jsr booleq php inc M0001 bne L000B inc M0001+1 L000B: plp bne L001F .dbg line, "common/getopt.c", 54 ldy #$05 jsr pushwysp lda _optopt ldx _optopt+1 jsr _strchr sta regbank+4 stx regbank+4+1 jsr bnegax beq L0009 .dbg line, "common/getopt.c", 55 L001F: lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) bne L000E .dbg line, "common/getopt.c", 56 inc _optind bne L000E inc _optind+1 .dbg line, "common/getopt.c", 58 L000E: ldy #$05 jsr ldaxysp jsr pushw lda _stderr ldx _stderr+1 jsr _fputs lda #<(S0002) ldx #>(S0002) jsr pushax lda _stderr ldx _stderr+1 jsr _fputs lda _optopt ldx _optopt+1 jsr pushax lda _stderr ldx _stderr+1 jsr _fputc lda #$0A jsr pusha0 lda _stderr ldx _stderr+1 jsr _fputc ldx #$00 lda #$3F jmp L0001 .dbg line, "common/getopt.c", 60 L0009: inc regbank+4 bne L0011 inc regbank+4+1 L0011: lda (regbank+4) cmp #$3A beq L0010 .dbg line, "common/getopt.c", 62 stz _optarg stz _optarg+1 .dbg line, "common/getopt.c", 63 lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) jne L0014 .dbg line, "common/getopt.c", 66 jmp L0022 .dbg line, "common/getopt.c", 68 L0010: lda M0001+1 sta ptr1+1 lda M0001 sta ptr1 lda (ptr1) beq L0015 .dbg line, "common/getopt.c", 70 lda M0001+1 sta _optarg+1 lda M0001 sta _optarg .dbg line, "common/getopt.c", 72 jmp L0019 L0015: ldy #$09 jsr pushwysp inc _optind bne L0018 inc _optind+1 L0018: lda _optind ldx _optind+1 jsr tosicmp beq L001D bpl L0017 .dbg line, "common/getopt.c", 73 L001D: lda #>(S0003) sta M0001+1 lda #<(S0003) sta M0001 .dbg line, "common/getopt.c", 74 ldy #$05 jsr ldaxysp jsr pushw lda _stderr ldx _stderr+1 jsr _fputs lda #<(S0004) ldx #>(S0004) jsr pushax lda _stderr ldx _stderr+1 jsr _fputs lda _optopt ldx _optopt+1 jsr pushax lda _stderr ldx _stderr+1 jsr _fputc lda #$0A jsr pusha0 lda _stderr ldx _stderr+1 jsr _fputc ldx #$00 lda #$3F bra L0001 .dbg line, "common/getopt.c", 77 L0017: lda _optind ldx _optind+1 jsr aslax1 clc ldy #$04 adc (c_sp),y pha txa iny adc (c_sp),y tax pla jsr ldaxi sta _optarg stx _optarg+1 .dbg line, "common/getopt.c", 79 L0019: lda #>(S0005) sta M0001+1 lda #<(S0005) sta M0001 .dbg line, "common/getopt.c", 80 L0022: inc _optind bne L0014 inc _optind+1 .dbg line, "common/getopt.c", 82 L0014: lda _optopt ldx _optopt+1 .dbg line, "common/getopt.c", 83 L0001: pha lda (c_sp) sta regbank+4 ldy #$01 lda (c_sp),y sta regbank+5 pla jmp incsp8 .dbg line .segment "DATA" M0001: .addr S0001 .endproc