; ; File generated by cc65 v 2.19 - Git fe19dd1 ; .fopt compiler,"cc65 v 2.19 - Git fe19dd1" .setcpu "4510" .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 jmp 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,x) jsr _isspace stx tmp1 ora tmp1 bne L0002 .dbg line, "common/strtoul.c", 27 tay lda (regbank+4),y .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 L003E .dbg line, "common/strtoul.c", 39 tax lda (regbank+4,x) cmp #$30 bne L003D .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,x) cmp #$58 beq L003B cmp #$D8 bne L003C .dbg line, "common/strtoul.c", 42 L003B: inc regbank+4 bne L0012 inc regbank+4+1 .dbg line, "common/strtoul.c", 43 L0012: lda #$10 .dbg line, "common/strtoul.c", 44 jmp L004E .dbg line, "common/strtoul.c", 45 L003C: lda #$08 dey jsr staxysp .dbg line, "common/strtoul.c", 47 jmp L0016 .dbg line, "common/strtoul.c", 48 L003D: lda #$0A L004E: dey jsr staxysp .dbg line, "common/strtoul.c", 50 jmp L0016 L003E: lda (c_sp),y bne L0016 dey lda (c_sp),y cmp #$10 bne L0016 ldy #$00 lda (regbank+4),y cmp #$30 bne L0016 lda regbank+4 ldx regbank+4+1 jsr incax1 sta ptr1 stx ptr1+1 lda (ptr1),y cmp #$58 beq L0043 lda regbank+4 ldx regbank+4+1 jsr incax1 sta ptr1 stx ptr1+1 lda (ptr1),y cmp #$D8 bne L0016 .dbg line, "common/strtoul.c", 51 L0043: 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 ldy #$00 sta (c_sp),y .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 L001E: ldx #$00 lda (regbank+4,x) jsr _isdigit stx tmp1 ora tmp1 beq L0021 .dbg line, "common/strtoul.c", 65 ldx #$00 lda (regbank+4,x) ldy #$30 .dbg line, "common/strtoul.c", 66 jmp L0053 L0021: tax lda (regbank+4,x) jsr _isupper stx tmp1 ora tmp1 beq L0023 .dbg line, "common/strtoul.c", 67 ldx #$00 lda (regbank+4,x) ldy #$B7 .dbg line, "common/strtoul.c", 68 jmp L0053 L0023: tax lda (regbank+4,x) jsr _islower stx tmp1 ora tmp1 jeq L001F .dbg line, "common/strtoul.c", 69 ldx #$00 lda (regbank+4,x) ldy #$37 L0053: 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 L0037 eor #$80 .dbg line, "common/strtoul.c", 77 L0037: bmi L001F .dbg line, "common/strtoul.c", 81 ldy #$0D jsr ldeaxysp jsr pusheax ldy #$08 jsr ldeaxysp jsr tosugteax bne L0029 ldy #$0D jsr ldeaxysp jsr pusheax ldy #$08 jsr ldeaxysp jsr toseqeax beq L0028 ldy #$05 lda (c_sp),y ldy #$00 cmp (c_sp),y beq L0028 bcc L0028 .dbg line, "common/strtoul.c", 82 L0029: lda #$01 ldy #$08 sta (c_sp),y .dbg line, "common/strtoul.c", 86 L0028: ldy #$08 lda (c_sp),y bne L002E .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 L002E: inc regbank+4 jne L001E inc regbank+4+1 .dbg line, "common/strtoul.c", 61 jmp L001E .dbg line, "common/strtoul.c", 98 L001F: ldy #$13 lda (c_sp),y dey ora (c_sp),y beq L0033 .dbg line, "common/strtoul.c", 99 ldy #$06 lda (c_sp),y iny ora (c_sp),y beq L0031 .dbg line, "common/strtoul.c", 100 ldy #$13 jsr ldptr1ysp lda regbank+4 ldy #$00 sta (ptr1),y iny lda regbank+4+1 .dbg line, "common/strtoul.c", 101 jmp L0050 .dbg line, "common/strtoul.c", 102 L0031: ldy #$13 jsr ldptr1ysp ldy #$15 jsr ldaxysp ldy #$00 sta (ptr1),y iny txa L0050: sta (ptr1),y .dbg line, "common/strtoul.c", 107 L0033: ldy #$08 lda (c_sp),y beq L0034 .dbg line, "common/strtoul.c", 108 lda #$0F jsr ___seterrno .dbg line, "common/strtoul.c", 109 lda #$FF sta sreg+1 sta sreg tax jmp L0036 .dbg line, "common/strtoul.c", 113 L0034: iny lda (c_sp),y beq L0035 .dbg line, "common/strtoul.c", 114 ldy #$0D jsr ldeaxysp jsr negeax jmp L0036 .dbg line, "common/strtoul.c", 116 L0035: ldy #$0D jsr ldeaxysp .dbg line, "common/strtoul.c", 118 L0036: 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