; ; File generated by cc65 v 2.19 - Git fe19dd1 ; .fopt compiler,"cc65 v 2.19 - Git fe19dd1" .setcpu "6502" .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/_scanf.c", 27245, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/stddef.h", 3037, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/stdarg.h", 2913, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/stdbool.h", 2506, 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/string.h", 5678, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/setjmp.h", 2848, 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/errno.h", 5854, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/ctype.h", 4485, 1794640055 .dbg file, "common/_scanf.h", 978, 1794640055 .import _memset .import ___setjmp .import _longjmp .import ___seterrno .import _isdigit .import _isspace .import _isxdigit .import _tolower .export __scanf .segment "RODATA" _Bits: .byte $01 .byte $02 .byte $04 .byte $08 .byte $10 .byte $20 .byte $40 .byte $80 .segment "BSS" _format: .res 2,$00 _D_: .res 2,$00 _ap: .res 2,$00 _JumpBuf: .res 5,$00 _F: .res 1,$00 _CharCount: .res 2,$00 _C: .res 2,$00 _Width: .res 2,$00 _IntVal: .res 4,$00 _Assignments: .res 2,$00 _IntBytes: .res 1,$00 _Converted: .res 1,$00 _Positive: .res 1,$00 _NoAssign: .res 1,$00 _Invert: .res 1,$00 _CharSet: .res 32,$00 ; --------------------------------------------------------------- ; int __near__ __fastcall__ _scanf (const struct scanfdata *D, const char *format_, unsigned char *ap_) ; --------------------------------------------------------------- .segment "CODE" .proc __scanf: near .dbg func, "_scanf", "00", static, "__scanf" .dbg sym, "D", "00", auto, 4 .dbg sym, "format_", "00", auto, 2 .dbg sym, "ap_", "00", auto, 0 .dbg sym, "S", "00", register, "regbank", 4 .segment "CODE" .dbg line, "common/_scanf.c", 488 jsr pushax .dbg line, "common/_scanf.c", 489 lda regbank+4 ldx regbank+5 jsr pushax .dbg line, "common/_scanf.c", 498 ldy #$07 jsr ldaxysp sta _D_ stx _D_+1 .dbg line, "common/_scanf.c", 499 ldy #$05 jsr ldaxysp sta _format stx _format+1 .dbg line, "common/_scanf.c", 500 ldy #$03 jsr ldaxysp sta _ap stx _ap+1 .dbg line, "common/_scanf.c", 503 lda #$00 sta _Converted .dbg line, "common/_scanf.c", 504 sta _Assignments sta _Assignments+1 .dbg line, "common/_scanf.c", 505 sta _CharCount sta _CharCount+1 .dbg line, "common/_scanf.c", 510 lda #<(_JumpBuf) ldx #>(_JumpBuf) jsr ___setjmp cmp #$00 jne L0002 .dbg line, "common/_scanf.c", 514 L0003: jsr _ReadChar .dbg line, "common/_scanf.c", 517 jmp L0022 .dbg line, "common/_scanf.c", 520 L0004: lda _F cmp #$A5 beq L0007 .dbg line, "common/_scanf.c", 523 ldx #$00 lda _F jsr _isspace tax beq L0093 .dbg line, "common/_scanf.c", 529 jsr _SkipWhite .dbg line, "common/_scanf.c", 530 jmp L0022 .dbg line, "common/_scanf.c", 537 L0008: ldx #$00 L0093: lda _F cpx _C+1 jne L0002 cmp _C beq L0003 .dbg line, "common/_scanf.c", 542 jmp L0002 .dbg line, "common/_scanf.c", 552 L0007: jsr _GetFormat cmp #$A5 .dbg line, "common/_scanf.c", 553 beq L0008 .dbg line, "common/_scanf.c", 557 lda _F cmp #$AA jsr booleq sta _NoAssign .dbg line, "common/_scanf.c", 558 lda _NoAssign beq L000E .dbg line, "common/_scanf.c", 559 jsr _GetFormat .dbg line, "common/_scanf.c", 563 L000E: lda #$FF sta _Width sta _Width+1 .dbg line, "common/_scanf.c", 564 ldx #$00 lda _F jsr _isdigit sta M0001 .dbg line, "common/_scanf.c", 565 lda M0001 beq L0011 .dbg line, "common/_scanf.c", 566 lda #$00 sta _Width sta _Width+1 .dbg line, "common/_scanf.c", 569 L0010: lda _Width ldx _Width+1 jsr mulax10 sta ptr1 stx ptr1+1 lda _F and #$0F clc adc ptr1 ldx ptr1+1 bcc L008C inx L008C: sta _Width stx _Width+1 .dbg line, "common/_scanf.c", 570 jsr _GetFormat jsr _isdigit tax bne L0010 .dbg line, "common/_scanf.c", 572 L0011: lda _Width ora _Width+1 bne L0013 .dbg line, "common/_scanf.c", 578 lda #$07 jsr ___seterrno .dbg line, "common/_scanf.c", 581 jmp L00B6 .dbg line, "common/_scanf.c", 587 L0013: lda _Width ldx _Width+1 jsr complax sta _Width stx _Width+1 .dbg line, "common/_scanf.c", 590 lda #$01 sta _IntBytes .dbg line, "common/_scanf.c", 591 lda _F .dbg line, "common/_scanf.c", 616 cmp #$48 beq L0017 cmp #$4A beq L0094 cmp #$4C beq L001A cmp #$54 beq L001E cmp #$5A beq L001E cmp #$CC beq L001E jmp L0095 .dbg line, "common/_scanf.c", 593 L0017: lda _format+1 sta ptr1+1 lda _format sta ptr1 ldy #$00 lda (ptr1),y cmp #$48 bne L001E .dbg line, "common/_scanf.c", 594 sty _IntBytes .dbg line, "common/_scanf.c", 595 inc _format bne L001E inc _format+1 .dbg line, "common/_scanf.c", 598 jmp L001E .dbg line, "common/_scanf.c", 601 L001A: lda _format+1 sta ptr1+1 lda _format sta ptr1 ldy #$00 lda (ptr1),y cmp #$4C bne L0094 .dbg line, "common/_scanf.c", 603 inc _format bne L0094 inc _format+1 .dbg line, "common/_scanf.c", 607 L0094: lda #$03 sta _IntBytes .dbg line, "common/_scanf.c", 615 L001E: jsr _GetFormat .dbg line, "common/_scanf.c", 619 L0095: lda _F .dbg line, "common/_scanf.c", 845 cmp #$41 jeq L00AB cmp #$43 jeq L009E cmp #$44 beq L0096 cmp #$45 jeq L00AB cmp #$46 jeq L00AB cmp #$47 jeq L00AB cmp #$49 beq L0097 cmp #$4E jeq L0074 cmp #$4F beq L0098 cmp #$50 jeq L006D cmp #$53 beq L0029 cmp #$55 beq L0096 cmp #$58 beq L0099 cmp #$C1 jeq L00AB cmp #$C3 jeq L00AB cmp #$C5 jeq L00AB cmp #$C6 jeq L00AB cmp #$C7 jeq L00AB cmp #$D3 jeq L00AB cmp #$D8 beq L0099 cmp #$DB jeq L0047 jmp L00AC .dbg line, "common/_scanf.c", 626 L0096: lda #$0A jsr _ScanInt .dbg line, "common/_scanf.c", 627 jmp L0022 .dbg line, "common/_scanf.c", 631 L0097: lda #$00 jsr _ScanInt .dbg line, "common/_scanf.c", 632 jmp L0022 .dbg line, "common/_scanf.c", 636 L0098: lda #$08 jsr _ScanInt .dbg line, "common/_scanf.c", 637 jmp L0022 .dbg line, "common/_scanf.c", 642 L0099: lda #$10 jsr _ScanInt .dbg line, "common/_scanf.c", 643 jmp L0022 .dbg line, "common/_scanf.c", 647 L0029: jsr _SkipWhite .dbg line, "common/_scanf.c", 648 jsr _CheckEnd .dbg line, "common/_scanf.c", 649 lda #$01 sta _Converted .dbg line, "common/_scanf.c", 650 lda _NoAssign bne L002E .dbg line, "common/_scanf.c", 651 lda _ap sec sbc #$02 sta _ap bcs L002B dec _ap+1 L002B: ldx _ap+1 jsr ldaxi sta regbank+4 stx regbank+4+1 .dbg line, "common/_scanf.c", 653 jmp L002E .dbg line, "common/_scanf.c", 656 L009A: lda _NoAssign bne L0035 .dbg line, "common/_scanf.c", 657 lda _C ldy #$00 sta (regbank+4),y inc regbank+4 bne L0035 inc regbank+4+1 .dbg line, "common/_scanf.c", 659 L0035: jsr _ReadChar .dbg line, "common/_scanf.c", 653 L002E: lda _C+1 .dbg line, "common/_scanf.c", 654 cmp #$FF bne L00B0 .dbg line, "common/_scanf.c", 653 lda _C .dbg line, "common/_scanf.c", 654 cmp #$FF beq L009D L00B0: lda _C ldx _C+1 jsr _isspace .dbg line, "common/_scanf.c", 655 cmp #$00 bne L009D inc _Width bne L0031 inc _Width+1 L0031: lda _Width ora _Width+1 bne L009A .dbg line, "common/_scanf.c", 662 L009D: lda _NoAssign jne L0022 .dbg line, "common/_scanf.c", 663 tay sta (regbank+4),y .dbg line, "common/_scanf.c", 664 inc _Assignments jne L0022 inc _Assignments+1 .dbg line, "common/_scanf.c", 666 jmp L0022 .dbg line, "common/_scanf.c", 670 L009E: lda M0001 bne L0039 .dbg line, "common/_scanf.c", 672 ldx #$FF lda #$FE sta _Width stx _Width+1 .dbg line, "common/_scanf.c", 674 L0039: jsr _CheckEnd .dbg line, "common/_scanf.c", 675 lda #$01 sta _Converted .dbg line, "common/_scanf.c", 676 lda _NoAssign bne L0045 .dbg line, "common/_scanf.c", 677 lda _ap sec sbc #$02 sta _ap bcs L003B dec _ap+1 L003B: ldx _ap+1 jsr ldaxi sta regbank+4 stx regbank+4+1 .dbg line, "common/_scanf.c", 682 jmp L003E .dbg line, "common/_scanf.c", 683 L003C: jsr _CheckEnd .dbg line, "common/_scanf.c", 684 lda _C ldy #$00 sta (regbank+4),y inc regbank+4 bne L0040 inc regbank+4+1 .dbg line, "common/_scanf.c", 685 L0040: jsr _ReadChar .dbg line, "common/_scanf.c", 682 L003E: inc _Width bne L003F inc _Width+1 L003F: lda _Width ora _Width+1 bne L003C .dbg line, "common/_scanf.c", 687 inc _Assignments jne L0022 inc _Assignments+1 .dbg line, "common/_scanf.c", 688 jmp L0022 .dbg line, "common/_scanf.c", 691 L0043: jsr _CheckEnd .dbg line, "common/_scanf.c", 692 jsr _ReadChar .dbg line, "common/_scanf.c", 690 L0045: inc _Width bne L0046 inc _Width+1 L0046: lda _Width ora _Width+1 bne L0043 .dbg line, "common/_scanf.c", 695 jmp L0022 .dbg line, "common/_scanf.c", 700 L0047: lda #>(_CharSet) sta ptr1+1 lda #<(_CharSet) sta ptr1 lda #$00 ldy #$1F L008B: sta (ptr1),y dey bpl L008B .dbg line, "common/_scanf.c", 702 jsr _GetFormat cmp #$DE jsr booleq sta _Invert .dbg line, "common/_scanf.c", 703 lda _Invert beq L009F .dbg line, "common/_scanf.c", 704 jsr _GetFormat .dbg line, "common/_scanf.c", 706 L009F: lda _F cmp #$DD bne L00A1 .dbg line, "common/_scanf.c", 714 jmp L00A0 .dbg line, "common/_scanf.c", 715 L004A: lda _format+1 sta ptr1+1 lda _format sta ptr1 ldy #$00 lda (ptr1),y cmp #$AD bne L00A0 .dbg line, "common/_scanf.c", 717 lda _F sta M0003 .dbg line, "common/_scanf.c", 718 inc _format bne L0051 inc _format+1 .dbg line, "common/_scanf.c", 719 L0051: jsr _GetFormat .dbg line, "common/_scanf.c", 739 cmp #$00 beq L0054 cmp #$DD bne L0057 .dbg line, "common/_scanf.c", 723 L0054: lda M0003 jsr _AddCharToSet .dbg line, "common/_scanf.c", 724 lda #$AD jsr _AddCharToSet .dbg line, "common/_scanf.c", 725 jmp L00A1 .dbg line, "common/_scanf.c", 731 L0057: lda M0003 jsr _AddCharToSet .dbg line, "common/_scanf.c", 732 lda M0003 cmp _F .dbg line, "common/_scanf.c", 733 beq L0092 .dbg line, "common/_scanf.c", 735 inc M0003 .dbg line, "common/_scanf.c", 730 jmp L0057 .dbg line, "common/_scanf.c", 742 L00A0: lda _F jsr _AddCharToSet .dbg line, "common/_scanf.c", 744 L0092: jsr _GetFormat .dbg line, "common/_scanf.c", 714 L00A1: lda _F beq L00A5 cmp #$DD bne L004A .dbg line, "common/_scanf.c", 749 L00A5: lda _F bne L005C .dbg line, "common/_scanf.c", 750 ldx _format bne L005D dec _format+1 L005D: dex stx _format .dbg line, "common/_scanf.c", 754 L005C: lda _Invert beq L00B3 .dbg line, "common/_scanf.c", 755 jsr _InvertCharSet .dbg line, "common/_scanf.c", 762 lda #$00 L00B3: sta M0002 .dbg line, "common/_scanf.c", 763 lda _NoAssign bne L0063 .dbg line, "common/_scanf.c", 764 lda _ap sec sbc #$02 sta _ap bcs L0060 dec _ap+1 L0060: ldx _ap+1 jsr ldaxi sta regbank+4 stx regbank+4+1 .dbg line, "common/_scanf.c", 766 jmp L0063 .dbg line, "common/_scanf.c", 767 L00A6: lda _NoAssign bne L00A7 .dbg line, "common/_scanf.c", 768 lda _C ldy #$00 sta (regbank+4),y inc regbank+4 bne L00A7 inc regbank+4+1 .dbg line, "common/_scanf.c", 770 L00A7: lda #$01 sta _Converted sta M0002 .dbg line, "common/_scanf.c", 771 jsr _ReadChar .dbg line, "common/_scanf.c", 766 L0063: jsr _IsCharInSet tax beq L00AA inc _Width bne L0065 inc _Width+1 L0065: lda _Width ora _Width+1 bne L00A6 .dbg line, "common/_scanf.c", 774 L00AA: lda M0002 .dbg line, "common/_scanf.c", 775 jeq L0002 .dbg line, "common/_scanf.c", 777 lda _NoAssign jne L0022 .dbg line, "common/_scanf.c", 778 tay sta (regbank+4),y .dbg line, "common/_scanf.c", 779 inc _Assignments jne L0022 inc _Assignments+1 .dbg line, "common/_scanf.c", 781 jmp L0022 .dbg line, "common/_scanf.c", 789 L006D: jsr _SkipWhite .dbg line, "common/_scanf.c", 790 lda _C cmp #$B0 .dbg line, "common/_scanf.c", 791 jne L0002 .dbg line, "common/_scanf.c", 793 lda #$01 sta _Converted .dbg line, "common/_scanf.c", 794 jsr _ReadChar .dbg line, "common/_scanf.c", 795 lda _C .dbg line, "common/_scanf.c", 801 cmp #$58 beq L0070 cmp #$D8 bne L0002 .dbg line, "common/_scanf.c", 802 L0070: jsr _ReadChar .dbg line, "common/_scanf.c", 803 lda #$10 jsr _ReadInt .dbg line, "common/_scanf.c", 804 jsr _AssignInt .dbg line, "common/_scanf.c", 805 jmp L0022 .dbg line, "common/_scanf.c", 811 L0074: lda _CharCount ldx _CharCount+1 jsr pushax lda _C+1 cmp #$FF bne L0076 lda _C cmp #$FF bne L0076 lda #$00 jmp L0077 L0076: lda #$01 L0077: jsr tossuba0 jsr axulong sta _IntVal stx _IntVal+1 ldy sreg sty _IntVal+2 ldy sreg+1 sty _IntVal+3 .dbg line, "common/_scanf.c", 812 jsr _AssignInt .dbg line, "common/_scanf.c", 814 lda _NoAssign bne L0022 .dbg line, "common/_scanf.c", 815 ldx _Assignments bne L0079 dec _Assignments+1 L0079: dex stx _Assignments .dbg line, "common/_scanf.c", 817 jmp L0022 .dbg line, "common/_scanf.c", 834 L00AB: lda #$0D jsr ___seterrno .dbg line, "common/_scanf.c", 837 jmp L00B6 .dbg line, "common/_scanf.c", 841 L00AC: lda #$07 jsr ___seterrno .dbg line, "common/_scanf.c", 844 jmp L00B6 .dbg line, "common/_scanf.c", 517 L0022: jsr _GetFormat tax jne L0004 .dbg line, "common/_scanf.c", 848 jmp L0086 .dbg line, "common/_scanf.c", 855 L0002: lda _C+1 cmp #$FF bne L0086 lda _C cmp #$FF bne L0086 lda _Converted bne L0086 .dbg line, "common/_scanf.c", 856 L00B6: lda #$FF sta _Assignments sta _Assignments+1 .dbg line, "common/_scanf.c", 861 L0086: jsr _PushBack .dbg line, "common/_scanf.c", 864 lda _Assignments ldx _Assignments+1 .dbg line, "common/_scanf.c", 865 pha ldy #$00 lda (c_sp),y sta regbank+4 iny lda (c_sp),y sta regbank+5 pla jmp incsp8 .dbg line .segment "RODATA" M0006: .word $0000 M0009: .word $0000 M000A: .word $0000 M000B: .word $0000 .segment "BSS" M0001: .res 1,$00 M0002: .res 1,$00 M0003: .res 1,$00 .endproc ; --------------------------------------------------------------- ; unsigned int __near__ FindBit (void) ; --------------------------------------------------------------- .segment "CODE" .proc _FindBit: near .dbg func, "FindBit", "00", static, "_FindBit" .segment "CODE" .dbg line, "common/_scanf.c", 107 pha .dbg line, "common/_scanf.c", 108 lsr a .dbg line, "common/_scanf.c", 109 lsr a .dbg line, "common/_scanf.c", 110 lsr a .dbg line, "common/_scanf.c", 111 tax .dbg line, "common/_scanf.c", 112 pla .dbg line, "common/_scanf.c", 113 and #$07 .dbg line, "common/_scanf.c", 114 tay .dbg line, "common/_scanf.c", 115 lda _Bits,y .dbg line, "common/_scanf.c", 116 jmp L0001 .dbg line, "common/_scanf.c", 117 L0001: rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ __fastcall__ AddCharToSet (unsigned char) ; --------------------------------------------------------------- .segment "CODE" .proc _AddCharToSet: near .dbg func, "AddCharToSet", "00", static, "_AddCharToSet" .dbg sym, "$anon-param-0002", "00", auto, 0 .segment "CODE" .dbg line, "common/_scanf.c", 124 jsr pusha .dbg line, "common/_scanf.c", 125 jsr _FindBit .dbg line, "common/_scanf.c", 126 ora _CharSet,x .dbg line, "common/_scanf.c", 127 sta _CharSet,x .dbg line, "common/_scanf.c", 128 jmp incsp1 .dbg line .endproc ; --------------------------------------------------------------- ; unsigned char __near__ IsCharInSet (void) ; --------------------------------------------------------------- .segment "CODE" .proc _IsCharInSet: near .dbg func, "IsCharInSet", "00", static, "_IsCharInSet" .segment "CODE" .dbg line, "common/_scanf.c", 138 lda #$00 .dbg line, "common/_scanf.c", 139 ldx _C+1 .dbg line, "common/_scanf.c", 140 bne L1 .dbg line, "common/_scanf.c", 141 lda _C .dbg line, "common/_scanf.c", 142 jsr _FindBit .dbg line, "common/_scanf.c", 143 and _CharSet,x .dbg line, "common/_scanf.c", 145 L1: ldx #$00 .dbg line, "common/_scanf.c", 146 jmp L0001 .dbg line, "common/_scanf.c", 147 L0001: rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ InvertCharSet (void) ; --------------------------------------------------------------- .segment "CODE" .proc _InvertCharSet: near .dbg func, "InvertCharSet", "00", static, "_InvertCharSet" .segment "CODE" .dbg line, "common/_scanf.c", 156 ldy #$1F .dbg line, "common/_scanf.c", 158 L1: lda _CharSet,y .dbg line, "common/_scanf.c", 159 eor #$FF .dbg line, "common/_scanf.c", 160 sta _CharSet,y .dbg line, "common/_scanf.c", 161 dey .dbg line, "common/_scanf.c", 162 bpl L1 .dbg line, "common/_scanf.c", 163 rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ PushBack (void) ; --------------------------------------------------------------- .segment "CODE" .proc _PushBack: near .dbg func, "PushBack", "00", static, "_PushBack" .segment "CODE" .dbg line, "common/_scanf.c", 178 ldx _C+1 .dbg line, "common/_scanf.c", 179 bne L0002 .dbg line, "common/_scanf.c", 180 lda _C .dbg line, "common/_scanf.c", 183 jsr pusha0 .dbg line, "common/_scanf.c", 186 lda _D_+1 .dbg line, "common/_scanf.c", 188 sta ptr1+1 .dbg line, "common/_scanf.c", 186 lda _D_ .dbg line, "common/_scanf.c", 187 sta ptr1 .dbg line, "common/_scanf.c", 191 ldy #$02 .dbg line, "common/_scanf.c", 192 lda (ptr1),y .dbg line, "common/_scanf.c", 193 sta jmpvec+1 .dbg line, "common/_scanf.c", 194 iny .dbg line, "common/_scanf.c", 195 lda (ptr1),y .dbg line, "common/_scanf.c", 196 sta jmpvec+2 .dbg line, "common/_scanf.c", 199 ldy #$05 .dbg line, "common/_scanf.c", 200 lda (ptr1),y .dbg line, "common/_scanf.c", 201 tax .dbg line, "common/_scanf.c", 202 dey .dbg line, "common/_scanf.c", 203 lda (ptr1),y .dbg line, "common/_scanf.c", 206 jsr jmpvec .dbg line, "common/_scanf.c", 209 lda _CharCount .dbg line, "common/_scanf.c", 210 bne L0003 .dbg line, "common/_scanf.c", 211 dec _CharCount+1 .dbg line, "common/_scanf.c", 213 L0003: dec _CharCount .dbg line, "common/_scanf.c", 217 L0002: rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ ReadChar (void) ; --------------------------------------------------------------- .segment "CODE" .proc _ReadChar: near .dbg func, "ReadChar", "00", static, "_ReadChar" .segment "CODE" .dbg line, "common/_scanf.c", 226 lda _D_+1 .dbg line, "common/_scanf.c", 228 sta ptr1+1 .dbg line, "common/_scanf.c", 225 lda _D_ .dbg line, "common/_scanf.c", 227 sta ptr1 .dbg line, "common/_scanf.c", 231 ldy #$00 .dbg line, "common/_scanf.c", 232 lda (ptr1),y .dbg line, "common/_scanf.c", 233 sta jmpvec+1 .dbg line, "common/_scanf.c", 234 iny .dbg line, "common/_scanf.c", 235 lda (ptr1),y .dbg line, "common/_scanf.c", 236 sta jmpvec+2 .dbg line, "common/_scanf.c", 239 ldy #$05 .dbg line, "common/_scanf.c", 240 lda (ptr1),y .dbg line, "common/_scanf.c", 241 tax .dbg line, "common/_scanf.c", 242 dey .dbg line, "common/_scanf.c", 243 lda (ptr1),y .dbg line, "common/_scanf.c", 246 jsr jmpvec .dbg line, "common/_scanf.c", 249 sta _C .dbg line, "common/_scanf.c", 250 stx _C+1 .dbg line, "common/_scanf.c", 255 inx .dbg line, "common/_scanf.c", 256 beq L0002 .dbg line, "common/_scanf.c", 259 inc _CharCount .dbg line, "common/_scanf.c", 260 bne L0002 .dbg line, "common/_scanf.c", 261 inc _CharCount+1 .dbg line, "common/_scanf.c", 265 L0002: rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ __fastcall__ Error (unsigned char) ; --------------------------------------------------------------- .segment "CODE" .proc _Error: near .dbg func, "Error", "00", static, "_Error" .dbg sym, "$anon-param-0003", "00", auto, 0 .segment "CODE" .dbg line, "common/_scanf.c", 273 jsr pusha .dbg line, "common/_scanf.c", 274 pha .dbg line, "common/_scanf.c", 275 lda #<(_JumpBuf) ldx #>(_JumpBuf) .dbg line, "common/_scanf.c", 276 jsr pushax .dbg line, "common/_scanf.c", 277 pla .dbg line, "common/_scanf.c", 278 ldx #>$0000 .dbg line, "common/_scanf.c", 279 jmp _longjmp .dbg line, "common/_scanf.c", 280 jsr incsp1 rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ CheckEnd (void) ; --------------------------------------------------------------- .segment "CODE" .proc _CheckEnd: near .dbg func, "CheckEnd", "00", static, "_CheckEnd" .segment "CODE" .dbg line, "common/_scanf.c", 290 ldx _C+1 .dbg line, "common/_scanf.c", 291 beq L0002 .dbg line, "common/_scanf.c", 293 lda #$02 jmp _Error .dbg line, "common/_scanf.c", 296 L0002: rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ SkipWhite (void) ; --------------------------------------------------------------- .segment "CODE" .proc _SkipWhite: near .dbg func, "SkipWhite", "00", static, "_SkipWhite" .segment "CODE" .dbg line, "common/_scanf.c", 303 jmp L0004 .dbg line, "common/_scanf.c", 304 L0002: jsr _ReadChar .dbg line, "common/_scanf.c", 303 L0004: lda _C ldx _C+1 jsr _isspace tax bne L0002 .dbg line, "common/_scanf.c", 306 rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ ReadSign (void) ; --------------------------------------------------------------- .segment "CODE" .proc _ReadSign: near .dbg func, "ReadSign", "00", static, "_ReadSign" .segment "CODE" .dbg line, "common/_scanf.c", 320 lda _C .dbg line, "common/_scanf.c", 321 cmp #'-' .dbg line, "common/_scanf.c", 322 bne L0002 .dbg line, "common/_scanf.c", 325 sta _Converted .dbg line, "common/_scanf.c", 326 jsr _ReadChar .dbg line, "common/_scanf.c", 327 lda #$00 .dbg line, "common/_scanf.c", 328 beq L0003 .dbg line, "common/_scanf.c", 332 L0002: cmp #'+' .dbg line, "common/_scanf.c", 333 bne L0004 .dbg line, "common/_scanf.c", 334 sta _Converted .dbg line, "common/_scanf.c", 335 jsr _ReadChar .dbg line, "common/_scanf.c", 337 L0004: lda #$01 .dbg line, "common/_scanf.c", 339 L0003: sta _Positive .dbg line, "common/_scanf.c", 340 rts .dbg line .endproc ; --------------------------------------------------------------- ; unsigned char __near__ __fastcall__ HexVal (char C) ; --------------------------------------------------------------- .segment "CODE" .proc _HexVal: near .dbg func, "HexVal", "00", static, "_HexVal" .dbg sym, "C", "00", auto, 0 .segment "CODE" .dbg line, "common/_scanf.c", 348 jsr pusha .dbg line, "common/_scanf.c", 349 ldx #$00 lda (c_sp,x) jsr _isdigit tax beq L0002 .dbg line, "common/_scanf.c", 350 ldx #$00 lda (c_sp,x) ldy #$B0 jmp L0004 .dbg line, "common/_scanf.c", 351 L0002: lda (c_sp,x) jsr _tolower ldx #$00 ldy #$37 L0004: jsr decaxy ldx #$00 .dbg line, "common/_scanf.c", 352 jmp incsp1 .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ __fastcall__ ReadInt (unsigned char Base) ; --------------------------------------------------------------- .segment "CODE" .proc _ReadInt: near .dbg func, "ReadInt", "00", static, "_ReadInt" .dbg sym, "Base", "00", auto, 0 .segment "CODE" .dbg line, "common/_scanf.c", 358 jsr pusha .dbg line, "common/_scanf.c", 359 lda #$00 sta M0002 .dbg line, "common/_scanf.c", 362 sta _IntVal+3 sta _IntVal+2 sta _IntVal+1 sta _IntVal .dbg line, "common/_scanf.c", 363 jmp L0004 .dbg line, "common/_scanf.c", 365 L000C: inc M0002 .dbg line, "common/_scanf.c", 366 lda _IntVal+3 sta sreg+1 lda _IntVal+2 sta sreg ldx _IntVal+1 lda _IntVal jsr pusheax ldy #$04 ldx #$00 lda (c_sp),y jsr axulong jsr tosmuleax jsr pusheax ldx #$00 lda M0001 jsr axulong jsr tosaddeax sta _IntVal stx _IntVal+1 ldy sreg sty _IntVal+2 ldy sreg+1 sty _IntVal+3 .dbg line, "common/_scanf.c", 367 jsr _ReadChar .dbg line, "common/_scanf.c", 363 L0004: lda _C ldx _C+1 jsr _isxdigit tax beq L000F inc _Width bne L0006 inc _Width+1 L0006: lda _Width ora _Width+1 .dbg line, "common/_scanf.c", 364 beq L000F lda _C jsr _HexVal sta M0001 ldy #$00 cmp (c_sp),y txa sbc #$00 bcc L000C .dbg line, "common/_scanf.c", 371 L000F: lda M0002 bne L0010 .dbg line, "common/_scanf.c", 372 lda #$01 jsr _Error .dbg line, "common/_scanf.c", 376 L0010: lda #$01 sta _Converted .dbg line, "common/_scanf.c", 377 jmp incsp1 .dbg line .segment "BSS" M0001: .res 1,$00 M0002: .res 1,$00 .endproc ; --------------------------------------------------------------- ; void __near__ AssignInt (void) ; --------------------------------------------------------------- .segment "CODE" .proc _AssignInt: near .dbg func, "AssignInt", "00", static, "_AssignInt" .segment "CODE" .dbg line, "common/_scanf.c", 389 lda _NoAssign bne L0005 .dbg line, "common/_scanf.c", 392 lda _ap sec sbc #$02 sta _ap bcs L0003 dec _ap+1 L0003: ldx _ap+1 jsr ldaxi .dbg line, "common/_scanf.c", 395 sta ptr1 .dbg line, "common/_scanf.c", 396 stx ptr1+1 .dbg line, "common/_scanf.c", 399 ldy _IntBytes .dbg line, "common/_scanf.c", 402 L0004: lda _IntVal,y .dbg line, "common/_scanf.c", 403 sta (ptr1),y .dbg line, "common/_scanf.c", 404 dey .dbg line, "common/_scanf.c", 405 bpl L0004 .dbg line, "common/_scanf.c", 408 inc _Assignments .dbg line, "common/_scanf.c", 409 bne L0005 .dbg line, "common/_scanf.c", 410 inc _Assignments+1 .dbg line, "common/_scanf.c", 413 L0005: rts .dbg line .endproc ; --------------------------------------------------------------- ; void __near__ __fastcall__ ScanInt (unsigned char Base) ; --------------------------------------------------------------- .segment "CODE" .proc _ScanInt: near .dbg func, "ScanInt", "00", static, "_ScanInt" .dbg sym, "Base", "00", auto, 0 .segment "CODE" .dbg line, "common/_scanf.c", 421 jsr pusha .dbg line, "common/_scanf.c", 423 jsr _SkipWhite .dbg line, "common/_scanf.c", 426 jsr _ReadSign .dbg line, "common/_scanf.c", 429 ldy #$00 lda (c_sp),y bne L000F .dbg line, "common/_scanf.c", 430 lda _C cmp #$B0 bne L000D .dbg line, "common/_scanf.c", 431 jsr _ReadChar .dbg line, "common/_scanf.c", 432 lda _C .dbg line, "common/_scanf.c", 447 cmp #$58 beq L000B cmp #$D8 bne L000C .dbg line, "common/_scanf.c", 435 L000B: lda #$10 ldy #$00 sta (c_sp),y .dbg line, "common/_scanf.c", 436 lda #$01 sta _Converted .dbg line, "common/_scanf.c", 437 jsr _ReadChar .dbg line, "common/_scanf.c", 438 jmp L0009 .dbg line, "common/_scanf.c", 440 L000C: lda #$08 ldy #$00 sta (c_sp),y .dbg line, "common/_scanf.c", 445 jsr _PushBack .dbg line, "common/_scanf.c", 446 ldx #$00 lda #$B0 sta _C stx _C+1 .dbg line, "common/_scanf.c", 447 jmp L0009 .dbg line, "common/_scanf.c", 449 L000D: lda #$0A sta (c_sp),y .dbg line, "common/_scanf.c", 454 L0009: ldy #$00 L000F: lda (c_sp),y jsr _ReadInt .dbg line, "common/_scanf.c", 457 lda _Positive bne L000A .dbg line, "common/_scanf.c", 458 lda _IntVal+3 sta sreg+1 lda _IntVal+2 sta sreg ldx _IntVal+1 lda _IntVal jsr negeax sta _IntVal stx _IntVal+1 ldy sreg sty _IntVal+2 ldy sreg+1 sty _IntVal+3 .dbg line, "common/_scanf.c", 462 L000A: jsr _AssignInt .dbg line, "common/_scanf.c", 463 jmp incsp1 .dbg line .endproc ; --------------------------------------------------------------- ; char __near__ GetFormat (void) ; --------------------------------------------------------------- .segment "CODE" .proc _GetFormat: near .dbg func, "GetFormat", "00", static, "_GetFormat" .segment "CODE" .dbg line, "common/_scanf.c", 471 lda _format+1 .dbg line, "common/_scanf.c", 473 sta regsave+1 .dbg line, "common/_scanf.c", 471 lda _format .dbg line, "common/_scanf.c", 472 sta regsave .dbg line, "common/_scanf.c", 474 inc _format bne L0002 inc _format+1 .dbg line, "common/_scanf.c", 475 L0002: ldy #0 .dbg line, "common/_scanf.c", 476 lda (regsave),y .dbg line, "common/_scanf.c", 477 ldx #>$0000 .dbg line, "common/_scanf.c", 478 sta _F .dbg line, "common/_scanf.c", 479 rts .dbg line .endproc