; ; File generated by cc65 v 2.19 - Git fe19dd1 ; .fopt compiler,"cc65 v 2.19 - Git fe19dd1" .setcpu "W65C02" .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/strtoul.c", 2840, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/limits.h", 3735, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/ctype.h", 4485, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/errno.h", 5854, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/stdlib.h", 6948, 1794640055 .import _isdigit .import _islower .import _isspace .import _isupper .import ___seterrno .export _strtoul ; --------------------------------------------------------------- ; unsigned long __near__ __fastcall__ strtoul (const char *nptr, char **endptr, int base) ; --------------------------------------------------------------- .segment "CODE" .proc _strtoul: near .dbg func, "strtoul", "00", static, "_strtoul" .dbg sym, "nptr", "00", auto, 4 .dbg sym, "endptr", "00", auto, 2 .dbg sym, "base", "00", auto, 0 .dbg sym, "S", "00", register, "regbank", 4 .dbg sym, "Val", "00", auto, -6 .dbg sym, "Minus", "00", auto, -7 .dbg sym, "Ovf", "00", auto, -8 .dbg sym, "CvtCount", "00", auto, -10 .dbg sym, "DigitVal", "00", auto, -11 .dbg sym, "MaxVal", "00", auto, -15 .dbg sym, "MaxDigit", "00", auto, -16 .segment "CODE" .dbg line, "common/strtoul.c", 10 jsr pushax .dbg line, "common/strtoul.c", 11 lda regbank+4 ldx regbank+5 jsr pushax ldy #$07 jsr ldaxysp sta regbank+4 stx regbank+4+1 .dbg line, "common/strtoul.c", 12 jsr pushl0 .dbg line, "common/strtoul.c", 13 jsr pusha .dbg line, "common/strtoul.c", 14 jsr pusha .dbg line, "common/strtoul.c", 15 jsr push0 .dbg line, "common/strtoul.c", 22 jsr decsp6 bra L0004 .dbg line, "common/strtoul.c", 23 L0002: inc regbank+4 bne L0004 inc regbank+4+1 .dbg line, "common/strtoul.c", 22 L0004: ldx #$00 lda (regbank+4) jsr _isspace stx tmp1 ora tmp1 bne L0002 .dbg line, "common/strtoul.c", 27 lda (regbank+4) .dbg line, "common/strtoul.c", 33 cmp #$2B beq L0009 cmp #$2D bne L0007 .dbg line, "common/strtoul.c", 29 lda #$01 ldy #$09 sta (c_sp),y .dbg line, "common/strtoul.c", 32 L0009: inc regbank+4 bne L0007 inc regbank+4+1 .dbg line, "common/strtoul.c", 38 L0007: ldy #$10 lda (c_sp),y iny ora (c_sp),y bne L0040 .dbg line, "common/strtoul.c", 39 tax lda (regbank+4) cmp #$30 bne L003F .dbg line, "common/strtoul.c", 40 inc regbank+4 bne L000E inc regbank+4+1 .dbg line, "common/strtoul.c", 41 L000E: lda (regbank+4) cmp #$58 beq L003D cmp #$D8 bne L003E .dbg line, "common/strtoul.c", 42 L003D: inc regbank+4 bne L0012 inc regbank+4+1 .dbg line, "common/strtoul.c", 43 L0012: lda #$10 .dbg line, "common/strtoul.c", 44 bra L0050 .dbg line, "common/strtoul.c", 45 L003E: lda #$08 dey jsr staxysp .dbg line, "common/strtoul.c", 47 bra L0016 .dbg line, "common/strtoul.c", 48 L003F: lda #$0A L0050: dey jsr staxysp .dbg line, "common/strtoul.c", 50 bra L0016 L0040: lda (c_sp),y bne L0016 dey lda (c_sp),y cmp #$10 bne L0016 lda (regbank+4) cmp #$30 bne L0016 lda regbank+4 ldx regbank+4+1 ina bne L0019 inx L0019: sta ptr1 stx ptr1+1 lda (ptr1) cmp #$58 beq L0045 lda regbank+4 ldx regbank+4+1 ina bne L001B inx L001B: sta ptr1 stx ptr1+1 lda (ptr1) cmp #$D8 bne L0016 .dbg line, "common/strtoul.c", 51 L0045: lda #$02 clc adc regbank+4 sta regbank+4 bcc L0016 inc regbank+4+1 .dbg line, "common/strtoul.c", 57 L0016: lda #$FF sta sreg+1 sta sreg tax jsr pusheax ldy #$15 jsr ldaxysp jsr axlong jsr tosumodeax sta (c_sp) .dbg line, "common/strtoul.c", 58 lda #$FF sta sreg+1 sta sreg tax jsr pusheax ldy #$15 jsr ldaxysp jsr axlong jsr tosudiveax ldy #$01 jsr steaxysp .dbg line, "common/strtoul.c", 64 L0020: ldx #$00 lda (regbank+4) jsr _isdigit stx tmp1 ora tmp1 beq L0023 .dbg line, "common/strtoul.c", 65 ldx #$00 lda (regbank+4) ldy #$30 .dbg line, "common/strtoul.c", 66 bra L0055 L0023: tax lda (regbank+4) jsr _isupper stx tmp1 ora tmp1 beq L0025 .dbg line, "common/strtoul.c", 67 ldx #$00 lda (regbank+4) ldy #$B7 .dbg line, "common/strtoul.c", 68 bra L0055 L0025: tax lda (regbank+4) jsr _islower stx tmp1 ora tmp1 jeq L0021 .dbg line, "common/strtoul.c", 69 ldx #$00 lda (regbank+4) ldy #$37 L0055: jsr decaxy ldy #$05 sta (c_sp),y .dbg line, "common/strtoul.c", 76 ldy #$10 cmp (c_sp),y .dbg line, "common/strtoul.c", 69 lda #$00 .dbg line, "common/strtoul.c", 76 iny sbc (c_sp),y bvs L0039 eor #$80 .dbg line, "common/strtoul.c", 77 L0039: bmi L0021 .dbg line, "common/strtoul.c", 81 ldy #$0D jsr ldeaxysp jsr pusheax ldy #$08 jsr ldeaxysp jsr tosugteax bne L002B ldy #$0D jsr ldeaxysp jsr pusheax ldy #$08 jsr ldeaxysp jsr toseqeax beq L002A ldy #$05 lda (c_sp),y cmp (c_sp) beq L002A bcc L002A .dbg line, "common/strtoul.c", 82 L002B: lda #$01 ldy #$08 sta (c_sp),y .dbg line, "common/strtoul.c", 86 L002A: ldy #$08 lda (c_sp),y bne L0030 .dbg line, "common/strtoul.c", 87 ldy #$0D jsr ldeaxysp jsr pusheax ldy #$15 jsr ldaxysp jsr axlong jsr tosumuleax jsr pusheax ldy #$09 ldx #$00 lda (c_sp),y jsr axulong jsr tosaddeax ldy #$0A jsr steaxysp .dbg line, "common/strtoul.c", 88 ldy #$06 ldx #$00 lda #$01 jsr addeqysp .dbg line, "common/strtoul.c", 92 L0030: inc regbank+4 jne L0020 inc regbank+4+1 .dbg line, "common/strtoul.c", 61 jmp L0020 .dbg line, "common/strtoul.c", 98 L0021: ldy #$13 lda (c_sp),y dey ora (c_sp),y beq L0035 .dbg line, "common/strtoul.c", 99 ldy #$06 lda (c_sp),y iny ora (c_sp),y beq L0033 .dbg line, "common/strtoul.c", 100 ldy #$13 jsr ldptr1ysp lda regbank+4 sta (ptr1) ldy #$01 lda regbank+4+1 .dbg line, "common/strtoul.c", 101 bra L0052 .dbg line, "common/strtoul.c", 102 L0033: ldy #$13 jsr ldptr1ysp ldy #$15 jsr ldaxysp sta (ptr1) ldy #$01 txa L0052: sta (ptr1),y .dbg line, "common/strtoul.c", 107 L0035: ldy #$08 lda (c_sp),y beq L0036 .dbg line, "common/strtoul.c", 108 lda #$0F jsr ___seterrno .dbg line, "common/strtoul.c", 109 lda #$FF sta sreg+1 sta sreg tax bra L0038 .dbg line, "common/strtoul.c", 113 L0036: iny lda (c_sp),y beq L0037 .dbg line, "common/strtoul.c", 114 ldy #$0D jsr ldeaxysp jsr negeax bra L0038 .dbg line, "common/strtoul.c", 116 L0037: ldy #$0D jsr ldeaxysp .dbg line, "common/strtoul.c", 118 L0038: pha ldy #$0E lda (c_sp),y sta regbank+4 iny lda (c_sp),y sta regbank+5 pla ldy #$16 jmp addysp .dbg line .endproc