; ; File generated by cc65 v 2.19 - Git fe19dd1 ; .fopt compiler,"cc65 v 2.19 - Git fe19dd1" .setcpu "65SC02" .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, "conio/cgets.c", 2467, 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/conio.h", 10106, 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/target.h", 3090, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/lynx.h", 7273, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/_mikey.h", 9393, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/_suzy.h", 11804, 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/ctype.h", 4485, 1794640055 .import _gotoxy .import _wherex .import _wherey .import _cputc .import _cputs .import _cgetc .export _cgets .import _cursor .import _screensize .import _strchr .import _isprint .segment "RODATA" S0002: .byte $0D,$0A,$00 S0001 := S0002+0 ; --------------------------------------------------------------- ; char *__near__ __fastcall__ cgets (char *buffer, int size) ; --------------------------------------------------------------- .segment "CODE" .proc _cgets: near .dbg func, "cgets", "00", static, "_cgets" .dbg sym, "buffer", "00", auto, 2 .dbg sym, "size", "00", auto, 0 .dbg sym, "i", "00", auto, -2 .dbg sym, "w", "00", auto, -3 .dbg sym, "x", "00", auto, -4 .dbg sym, "y", "00", auto, -5 .dbg sym, "c", "00", auto, -6 .segment "CODE" .dbg line, "conio/cgets.c", 30 jsr pushax .dbg line, "conio/cgets.c", 31 jsr push0 .dbg line, "conio/cgets.c", 35 jsr decsp4 ldy #$09 lda (c_sp),y dey ora (c_sp),y jeq L0002 dey jsr ldaxysp cmp #$02 txa sbc #$00 bvs L0004 eor #$80 L0004: jpl L0002 .dbg line, "conio/cgets.c", 37 lda #$03 jsr leaa0sp jsr pushax lda #$03 jsr leaa0sp jsr _screensize .dbg line, "conio/cgets.c", 39 ldy #$03 lda (c_sp),y sec sbc #$01 sta (c_sp),y .dbg line, "conio/cgets.c", 40 lda #$01 jsr _cursor .dbg line, "conio/cgets.c", 41 ldx #$00 lda #$01 ldy #$06 jsr subeqysp L0007: ldy #$05 jsr ldaxysp ldy #$06 cmp (c_sp),y txa iny sbc (c_sp),y bvc L0018 eor #$80 L0018: asl a lda #$00 jcc L0023 .dbg line, "conio/cgets.c", 42 jsr _cgetc sta (c_sp) .dbg line, "conio/cgets.c", 44 lda #<(S0001) ldx #>(S0001) jsr pushax ldy #$02 ldx #$00 lda (c_sp),y jsr _strchr stx tmp1 ora tmp1 beq L000B .dbg line, "conio/cgets.c", 46 lda #<(S0002) ldx #>(S0002) jsr _cputs .dbg line, "conio/cgets.c", 47 jmp L0008 .dbg line, "conio/cgets.c", 50 L000B: tax lda (c_sp) .dbg line, "conio/cgets.c", 54 cmp #$08 bne L0021 .dbg line, "conio/cgets.c", 55 ldy #$05 jsr ldaxysp cmp #$01 txa sbc #$00 bvs L000E eor #$80 L000E: bpl L0007 .dbg line, "conio/cgets.c", 57 ldx #$00 lda #$01 ldy #$04 jsr subeqysp .dbg line, "conio/cgets.c", 59 jsr _wherey ldy #$01 sta (c_sp),y .dbg line, "conio/cgets.c", 60 jsr _wherex ldy #$02 sta (c_sp),y .dbg line, "conio/cgets.c", 61 lda (c_sp),y beq L000F dey lda (c_sp),y bra L001D L000F: dey lda (c_sp),y sec sbc #$01 L001D: sta (c_sp),y .dbg line, "conio/cgets.c", 62 iny lda (c_sp),y beq L0011 sec sbc #$01 bra L001F L0011: iny lda (c_sp),y dey L001F: sta (c_sp),y .dbg line, "conio/cgets.c", 64 jsr pusha ldy #$02 lda (c_sp),y jsr _gotoxy .dbg line, "conio/cgets.c", 65 lda #$20 jsr _cputc .dbg line, "conio/cgets.c", 66 ldy #$02 lda (c_sp),y jsr pusha ldy #$02 lda (c_sp),y jsr _gotoxy .dbg line, "conio/cgets.c", 69 jmp L0007 L0021: lda (c_sp) jsr _isprint stx tmp1 ora tmp1 jeq L0007 .dbg line, "conio/cgets.c", 70 lda (c_sp) jsr _cputc .dbg line, "conio/cgets.c", 71 ldy #$05 jsr ldaxysp clc ldy #$08 adc (c_sp),y sta ptr1 txa iny adc (c_sp),y sta ptr1+1 lda (c_sp) sta (ptr1) ldy #$04 ldx #$00 lda #$01 jsr addeqysp .dbg line, "conio/cgets.c", 73 jmp L0007 .dbg line, "conio/cgets.c", 74 L0008: lda #$00 L0023: jsr _cursor .dbg line, "conio/cgets.c", 75 ldy #$05 jsr ldaxysp clc ldy #$08 adc (c_sp),y sta ptr1 txa iny adc (c_sp),y sta ptr1+1 lda #$00 sta (ptr1) .dbg line, "conio/cgets.c", 79 L0002: ldy #$05 jsr ldaxysp cmp #$01 txa sbc #$00 bvs L0015 eor #$80 L0015: asl a lda #$00 tax bcc L0001 ldy #$09 jsr ldaxysp .dbg line, "conio/cgets.c", 80 L0001: ldy #$0A jmp addysp .dbg line .endproc