; ; File generated by cc65 v 2.19 - Git fe19dd1 ; .fopt compiler,"cc65 v 2.19 - Git fe19dd1" .setcpu "45GS02" .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/strtol.c", 2960, 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 _strtol ; --------------------------------------------------------------- ; long __near__ __fastcall__ strtol (const char *nptr, char **endptr, int base) ; --------------------------------------------------------------- .segment "CODE" .proc _strtol: near .dbg func, "strtol", "00", static, "_strtol" .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/strtol.c", 10 jsr pushax .dbg line, "common/strtol.c", 11 lda regbank+4 ldx regbank+5 jsr pushax ldy #$07 jsr ldaxysp sta regbank+4 stx regbank+4+1 .dbg line, "common/strtol.c", 12 jsr pushl0 .dbg line, "common/strtol.c", 13 jsr pusha .dbg line, "common/strtol.c", 14 jsr pusha .dbg line, "common/strtol.c", 15 jsr push0 .dbg line, "common/strtol.c", 22 jsr decsp6 jmp L0004 .dbg line, "common/strtol.c", 23 L0002: inc regbank+4 bne L0004 inc regbank+4+1 .dbg line, "common/strtol.c", 22 L0004: ldx #$00 lda (regbank+4,x) jsr _isspace stx tmp1 ora tmp1 bne L0002 .dbg line, "common/strtol.c", 27 tay lda (regbank+4),y .dbg line, "common/strtol.c", 33 cmp #$2B beq L0009 cmp #$2D bne L0007 .dbg line, "common/strtol.c", 29 lda #$01 ldy #$09 sta (c_sp),y .dbg line, "common/strtol.c", 32 L0009: inc regbank+4 bne L0007 inc regbank+4+1 .dbg line, "common/strtol.c", 38 L0007: ldy #$10 lda (c_sp),y iny ora (c_sp),y bne L0043 .dbg line, "common/strtol.c", 39 tax lda (regbank+4,x) cmp #$30 bne L0042 .dbg line, "common/strtol.c", 40 inc regbank+4 bne L000E inc regbank+4+1 .dbg line, "common/strtol.c", 41 L000E: lda (regbank+4,x) cmp #$58 beq L0040 cmp #$D8 bne L0041 .dbg line, "common/strtol.c", 42 L0040: inc regbank+4 bne L0012 inc regbank+4+1 .dbg line, "common/strtol.c", 43 L0012: lda #$10 .dbg line, "common/strtol.c", 44 jmp L0053 .dbg line, "common/strtol.c", 45 L0041: lda #$08 dey jsr staxysp .dbg line, "common/strtol.c", 47 jmp L0016 .dbg line, "common/strtol.c", 48 L0042: lda #$0A L0053: dey jsr staxysp .dbg line, "common/strtol.c", 50 jmp L0016 L0043: 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 L0048 lda regbank+4 ldx regbank+4+1 jsr incax1 sta ptr1 stx ptr1+1 lda (ptr1),y cmp #$D8 bne L0016 .dbg line, "common/strtol.c", 51 L0048: lda #$02 clc adc regbank+4 sta regbank+4 bcc L0016 inc regbank+4+1 .dbg line, "common/strtol.c", 57 L0016: ldy #$09 lda (c_sp),y beq L001E .dbg line, "common/strtol.c", 58 lda #$80 sta sreg+1 lda #$00 .dbg line, "common/strtol.c", 59 jmp L005B .dbg line, "common/strtol.c", 60 L001E: lda #$7F sta sreg+1 lda #$FF L005B: sta sreg tax ldy #$01 jsr steaxysp .dbg line, "common/strtol.c", 62 ldy #$04 jsr ldeaxysp jsr pusheax ldy #$15 jsr ldaxysp jsr axlong jsr tosumodeax ldy #$00 sta (c_sp),y .dbg line, "common/strtol.c", 63 ldy #$04 jsr ldeaxysp jsr pusheax ldy #$15 jsr ldaxysp jsr axlong jsr tosudiveax ldy #$01 jsr steaxysp .dbg line, "common/strtol.c", 69 L0020: ldx #$00 lda (regbank+4,x) jsr _isdigit stx tmp1 ora tmp1 beq L0023 .dbg line, "common/strtol.c", 70 ldx #$00 lda (regbank+4,x) ldy #$30 .dbg line, "common/strtol.c", 71 jmp L0059 L0023: tax lda (regbank+4,x) jsr _isupper stx tmp1 ora tmp1 beq L0025 .dbg line, "common/strtol.c", 72 ldx #$00 lda (regbank+4,x) ldy #$B7 .dbg line, "common/strtol.c", 73 jmp L0059 L0025: tax lda (regbank+4,x) jsr _islower stx tmp1 ora tmp1 jeq L0021 .dbg line, "common/strtol.c", 74 ldx #$00 lda (regbank+4,x) ldy #$37 L0059: jsr decaxy ldy #$05 sta (c_sp),y .dbg line, "common/strtol.c", 81 ldy #$10 cmp (c_sp),y .dbg line, "common/strtol.c", 74 lda #$00 .dbg line, "common/strtol.c", 81 iny sbc (c_sp),y bvs L003B eor #$80 .dbg line, "common/strtol.c", 82 L003B: bmi L0021 .dbg line, "common/strtol.c", 86 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 ldy #$00 cmp (c_sp),y beq L002A bcc L002A .dbg line, "common/strtol.c", 87 L002B: lda #$01 ldy #$08 sta (c_sp),y .dbg line, "common/strtol.c", 91 L002A: ldy #$08 lda (c_sp),y bne L0030 .dbg line, "common/strtol.c", 92 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/strtol.c", 93 ldy #$06 ldx #$00 lda #$01 jsr addeqysp .dbg line, "common/strtol.c", 97 L0030: inc regbank+4 jne L0020 inc regbank+4+1 .dbg line, "common/strtol.c", 66 jmp L0020 .dbg line, "common/strtol.c", 103 L0021: ldy #$13 lda (c_sp),y dey ora (c_sp),y beq L0035 .dbg line, "common/strtol.c", 104 ldy #$06 lda (c_sp),y iny ora (c_sp),y beq L0033 .dbg line, "common/strtol.c", 105 ldy #$13 jsr ldptr1ysp lda regbank+4 ldy #$00 sta (ptr1),y iny lda regbank+4+1 .dbg line, "common/strtol.c", 106 jmp L0056 .dbg line, "common/strtol.c", 107 L0033: ldy #$13 jsr ldptr1ysp ldy #$15 jsr ldaxysp ldy #$00 sta (ptr1),y iny txa L0056: sta (ptr1),y .dbg line, "common/strtol.c", 112 L0035: ldy #$08 lda (c_sp),y beq L0038 .dbg line, "common/strtol.c", 113 lda #$0F jsr ___seterrno .dbg line, "common/strtol.c", 114 ldy #$09 lda (c_sp),y beq L0037 .dbg line, "common/strtol.c", 115 lda #$80 sta sreg+1 lda #$00 sta sreg tax jmp L003A .dbg line, "common/strtol.c", 117 L0037: lda #$7F sta sreg+1 lda #$FF sta sreg tax jmp L003A .dbg line, "common/strtol.c", 122 L0038: iny lda (c_sp),y beq L0039 .dbg line, "common/strtol.c", 123 ldy #$0D jsr ldeaxysp jsr negeax jmp L003A .dbg line, "common/strtol.c", 125 L0039: ldy #$0D jsr ldeaxysp .dbg line, "common/strtol.c", 127 L003A: 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