; ; 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, "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/geos.h", 3127, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gconst.h", 1493, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gstruct.h", 5199, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gsym.h", 12804, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gdisk.h", 2287, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gfile.h", 2118, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gprocess.h", 557, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/ggraph.h", 5463, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gmenu.h", 1221, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gsprite.h", 2353, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gmemory.h", 1099, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gsys.h", 1300, 1794640055 .dbg file, "/data/emu/lynx-python/reference/src/cc65/include/geos/gdlgbox.h", 3490, 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 L001A eor #$80 L001A: asl a lda #$00 jcc L0026 .dbg line, "conio/cgets.c", 42 jsr _cgetc ldy #$00 sta (c_sp),y .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: tay lda (c_sp),y .dbg line, "conio/cgets.c", 52 cmp #$08 beq L001E .dbg line, "conio/cgets.c", 54 cmp #$1D beq L001E ldx #$00 jmp L0024 .dbg line, "conio/cgets.c", 55 L001E: ldy #$05 jsr ldaxysp cmp #$01 txa sbc #$00 bvs L0010 eor #$80 L0010: 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 L0011 dey lda (c_sp),y jmp L0020 L0011: dey lda (c_sp),y sec sbc #$01 L0020: sta (c_sp),y .dbg line, "conio/cgets.c", 62 iny lda (c_sp),y beq L0013 sec sbc #$01 jmp L0022 L0013: iny lda (c_sp),y dey L0022: 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 L0024: lda (c_sp),y jsr _isprint stx tmp1 ora tmp1 jeq L0007 .dbg line, "conio/cgets.c", 70 ldy #$00 lda (c_sp),y 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 ldy #$00 lda (c_sp),y sta (ptr1),y 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 L0026: 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 tay sta (ptr1),y .dbg line, "conio/cgets.c", 79 L0002: ldy #$05 jsr ldaxysp cmp #$01 txa sbc #$00 bvs L0017 eor #$80 L0017: 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