⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.asm

📁 辞典 dict3.asm.grammar.asm,newword.asm 学习 learn.asm 名片 userinf.asm 备忘 userinf.asm 提醒 userinf
💻 ASM
📖 第 1 页 / 共 5 页
字号:

PccEnd:
        pla
        sta     <DRRl                    ;; Restore DRR.(Data bank).
        pla
        sta     <DRRh                    ;; Restore DRR.(Data bank).


        jmp   call_input_lmain

PhonErr:
        smb0    <ScanFF         ;; Set error mode.
        smb1    <ScanFF

        jsr     ClrInputArea    ;; Clear chinese input screen..
        jsr     SINDChrInLoc    ;; Set IND to Char input loction.

        ;;yiadd 2-8-7
        lda     #<TextBuffor+85
        sta     <INDL
        lda     #>TextBuffor+85
        sta     <INDH
        ldy     #7
phe3:   lda     ErrMsg,y
        sta     (<IND),y
        dey
        bpl     phe3
        bra     PccEnd

;;[S]-----------------------------------------------[S]
;;       Show phonetic word.
;;[S]-----------------------------------------------[S]
spwimeBTab:
        db      RomBank         ;; 拼音输入法 Bank   !!!!!!!!改
        db      IME5Bank0       ;; 五笔输入法 Bank   !!!!!!!!改
        db      AtBank0Bank     ;; 笔划输入法 Bank   !!!!!!!!改
ShowPhonWord:
        lda     <DRRh
        pha
        lda     <DRRl
        pha
        jsr     ClrInputArea    ;; Clear chinese input screen..
        jsr     SINDChrInLoc    ;; Set IND to Char input loction.
        ldx     <IME
        lda     spwimeBTab,x    ;;
        sta     <DRRl            ;; Branch if Comples(Taiwan) mode.
        lda     #>RomBank
        sta     <drrh
        cpx     #IMEStroke      ;; '笔划输入法' ?
        bne     ?1
        jmp     ShowStrWord
?1:
        cpx     #IMEStroke+1    ;; '部首输入法' ?
        beq     ShowStrWord
        cpx     #IMEStroke+2    ;; '部首输入法' ?
        beq     ShowStrWord
        clc
        lda     PhonStr         ;; Get phonetic word start address.
        adc     PhonLoc
        sta     <INSL
        lda     PhonStr+1
        adc     #0
        sta     <INSH

        clc
        lda     PhonNo          ;; Get numbers of  phonetic word .
        adc     PhonStr         ;; INS = IND + (numbers of  phonetic word)*2.
        sta     <StrInx
        lda     PhonStr+1
        adc     #0
        sta     <StrInx+1

        lda     PhonLoc
        bne     spw1            ;; On start location.

        lda     PhonNo
        cmp     #20+2
        bcc     spw5
        bra     spw3

spw1:   clc
        adc     #20
        cmp     PhonNo
        bcs     spw2
        llight_lcd_icon  iconleft
        llight_lcd_icon  IconRight
        bra     spw4

spw2:
        ;lda     #1              ;; '←'
        ;sta     IconRight>>8
        llight_lcd_icon  iconleft
        loff_lcd_icon    IconRight
        bra     spw4
spw3:
        ;lda     #10h            ;; '→'
        ;sta     IconRight>>8
        llight_lcd_icon  IconRight
        loff_lcd_icon    iconleft
Spw4:
spw5:   ldy     #0
spw6:   phy
        ldy     #1
        lda     (<INS),y        ;; Get high byte of chinese char.
        tax                     ;; Store high byte of chinese char.
        dey
        lda     (<INS),y        ;; Get low byte of chinese char.

        ply
        sta     (<IND),y        ;; Put low byte of chinese char.
        iny                     ;; Next chinese input buffor.
        txa                     ;; Get high byte of chinese char.
        sta     (<IND),y        ;; Put high byte of chinese char.
        iny                     ;; Next chinese input buffor.
        cpy     #20
        bcs     spw8            ;; Branch if over 6 char of chinese.
        jsr     NxCpINS
        bcc     spw6            ;; INS+=2 < StrInx
Spw8:
        pla
        sta     <DRRl                    ;; Restore DRR.(Data bank).
        pla
        sta     <DRRh                    ;; Restore DRR.(Data bank).
        rts

;;[S]-----------------------------------------------[S]
;;       Show '笔划' 选择字组。
;;[S]-----------------------------------------------[S]
ShowStrWord:
        jsr     SINDChrInLoc    ;; Set IND to Char input loction.

        lda     PhonNo
        sta     <INSL
        lda     PhonNo+1
        sta     <INSH

        ldy     #0ffh
ssw1:   iny
        cpy     #20
        bcs     ssw5            ;; Buffor full.

ssw3:
        lda     (<INS)
        sta     (<IND),y
        jsr     NxINS
        lda     (<INS)
        iny
        sta     (<IND),y

        jsr     NxINS
        lda     <INSH
        cmp     PhonEnd+1
        bcc     ssw1
        bne     ssw5

        lda     <INSL
        cmp     PhonEnd
        bcc     ssw1

ssw5:
        ;lda     #1
        ;sta     IconRight>>8
        llight_lcd_icon  iconleft
        loff_lcd_icon    IconRight
        clc
        lda     PhonNo+1
        cmp     PhonStr+1
        bne     ssw6
        lda     PhonNo
        cmp     PhonStr
        bne     ssw6
        ;stz     IconRight>>8
        loff_lcd_icon    IconRight
        loff_lcd_icon    Iconleft

ssw6:   lda     <INSL
        cmp     PhonEnd
        bne     ssw65
        lda     <INSH
        cmp     PhonEnd+1
        bne     ssw65

        ;lda     IconRight>>8
        ;and     #1
        ;sta     IconRight>>8

        ;llight_lcd_icon  iconleft
        loff_lcd_icon    IconRight

        bra     ssw7
ssw65:
        ;lda     IconRight>>8
        ;ora     #10h
        ;sta     IconRight>>8
        llight_lcd_icon  iconright
        ;loff_lcd_icon    IconRight
ssw7:
        jmp     Spw8

;;[S]-----------------------------------------------[S]
;;       Check input buffor.
;;[S]-----------------------------------------------[S]
ChkInBuf:
        jsr     SetChinInBuf    ;; Set chinese input buffor location.
        ldy     #7
        lda     #' '
chib3:  ora     (<IND),y
        dey
        bpl     chib3
        cmp     #' '
        rts

;;[S]-----------------------------------------------[S]
;;       INS+=1. and compare INS with StrInx
;;[S]-----------------------------------------------[S]
NxCpINS:
        clc
        lda     <INS
        adc     #2
        sta     <INS
        lda     <INS+1
        adc     #0
        sta     <INS+1

        lda     <INSH
        cmp     <StrInx+1
        bne     nxis8
        lda     <INSL
        cmp     <StrInx
nxis8:
        rts

;;[S]-----------------------------------------------[S]
;;       Set to input mode 0.
;;[S]-----------------------------------------------[S]
MyInitScanF:
        rmb0    <ScanFF         ;;
        rmb1    <ScanFF         ;; Set to input mode 0.
        ;stz     IconLeft>>8     ;;2001-11-14
        ;llight_lcd_icon  iconleft

        bra     MyScanFU1
;;[S]-----------------------------------------------[S]
;;       Read one line.
;;[S]-----------------------------------------------[S]
MyScanF:  lda     #80h            ;; Set ScanF active.
MyScanFU: sta     <ScanFF         ;; Set ScanF mode and set to '中文输入'。

MyScanFU1:
          ;;yiadd 2-8-15
          loff_lcd_icon    IconRight
          loff_lcd_icon    Iconleft
          smb5    <SysF           ;; Set cursor on
;;[S]-----------------------------------------------[S]
;;       显示输入法.
;;[S]-----------------------------------------------[S]
ShowInLen:
        jsr     SINDChrInLoc    ;; Set IND to Char input loction.
        lda     <ScanFF        ;;yiadd2-6-29 11:45
        and     #00110000b
        cmp     #00110000b
        beq     fu_hao_input
        lda     <ScanFF
        and     #00110000b
        beq     shil5           ;; Branch if on Chinese input mode.

        bbs2    <ScanFF,shil8   ;; Fix English or Digit mode

        jsr     ClrInputArea    ;; Clear char input line 2 of text screen.

        lda     #16+4+4             ;;英
        bbs4    <ScanFF,shila   ;;2001-4-18 17:04
        lda     #12+4+4             ;;数
        bra     shil6

shil5:
        jsr     ClrInputArea    ;; Clear char input line 2 of text screen.
        lda     <IME
        asl
        asl                     ;;2001-4-18 16:33
shil6:
        ldy     #0              ;;2001-4-18 16:33
        tax
shil7:
        lda     InLenTab,x
        sta     (<IND),y
        inx
        iny
        cpy     #4              ;;
        bcc     shil7

shil8:  rts

shila:
        ldy     #0
        ldx     #20+4   ;;16
        bbr6    <ScanFF,shila_0   ;; Branch if 小写。
        ldx     #28+4   ;;24
shila_0:
        lda     InLenTab,x
        sta     (<IND),y
        inx
        iny
        cpy     #8              ;;
        bcc     shila_0
        rts
fu_hao_input:
        lda     #>fu_hao_table1
        sta     phonno+1
        lda     #<fu_hao_table1
        sta     phonno
        clc
        adc     #60
        sta     phonstr
fu_hao_input_0:
        lda     <curx
        pha
        lda     <cury
        pha
        jsr     ClrRow4
        lsetcur 0,4
        ldx     phonno+1
        ldy     phonno
        lprint
        pla
        sta     <cury
        pla
        sta     <curx
        rmb1    <scanff
        smb0    <scanff
        lda     phonno
        cmp     #<fu_hao_table1
        beq     fu_hao_no1
        cmp     phonstr
        bcs     fu_hao_end
        llight_lcd_icon  iconright
        llight_lcd_icon  iconleft
        ;lda     #00010001b        ;;亮左右键
        ;sta     IconRight>>8
        rts
fu_hao_no1:
        ;lda     #00010000b
        ;sta     IconRight>>8      ;;灭左亮右
        llight_lcd_icon  iconright
        loff_lcd_icon    iconleft
        rts
fu_hao_end:
        loff_lcd_icon    iconright
        llight_lcd_icon  iconleft
        ;lda     #00000001b        ;;灭右亮左
        ;sta     IconRight>>8
        rts
;;[S]-----------------------------------------------[S]
;;       set chinese input buffor location.
;;[S]-----------------------------------------------[S]
SetChinInBuf:
        lda     #<textbuffor+85 ;85
SetChinInBuf_1:
        sta     <INDL
        lda     #>TextBuffor+85
        sta     <INDH
        rts

;;[S]-----------------------------------------------[S]
;;       Set IND to Char input loction.
;;[S]-----------------------------------------------[S]
SINDChrInLoc:
        lda     #<textbuffor+80 ;#80
        sta     <INDL
        lda     #>TextBuffor+80
        sta     <INDH
        rts

EraInsChinese:
        bbr3    <ScanFState,EraIns ;; Branch if 'BackSpace' key active.
        jsr     EraIns
;;[S]-----------------------------------------------[S]
;;       Erase or Instert one word.
;;[S]-----------------------------------------------[S]
EraIns:
        clc
        ldx     <CurY
        lda     trowtab,x       ;; CurY * 16.
        tay
        adc     <CurX
        tax
        bbr3    <ScanFState,ewd2 ;; Branch if 'BackSpace' key active.
        tya
        adc     #19
        tay
ewd1:   lda     TextBuffor-1,y
        sta     TextBuffor,y
        dey
        tya
        sta     TextBuffor,y
        txa
        cmp     TextBuffor,y
        bcc     ewd1            ;; Branch if x < y.
        bra     ewd5

ewd2:   lda     TextBuffor,x    ;; Clear cursor bar.
        bpl     ewd5            ;; It's english word.
ewd3:   lda     #' '
        sta     TextBuffor,x
        sta     TextBuffor+1,x

        rts

ewd5:   lda     #' '
        sta     TextBuffor,x

        rts

;;[S]-----------------------------------------------[S]
;;       Exit ScanF
;;[S]-----------------------------------------------[S]
MyExitScanF:
        stz     <ScanFF         ;; Clear ScanF falg.
        rmb5    <SysF           ;; Set cursor off.
        rts

ClrInputArea:
        ldx     #80
        ;lda     <IME
        ;cmp     #maxIME
        ;bne     ?NOT_FU_HAO
        ;ldx     #85
;?NOT_FU_HAO:
        ldy     #20-1
        lda     #' '
cll5:   sta     TextBuffor,x
        inx
        dey
        bpl     cll5
        rts

fu_hao_LanKey_proc:     ;; 符号—>拼
        lda     <ScanFF
        and     #00001100b
        beq     ?fu_hao_LanKey_proc_1
        jmp     call_input_lmainu
?fu_hao_LanKey_proc_1:
        lda     <ScanFF
        and     #10001100b        ;; Remain fix flag.
        ora     #10000000b
        jsr     MyScanFU          ;; Set to chinese input mode.
        jmp     call_input_lmain
fu_hao_leftkey_proc:
        lda     Iconleft>>8    ;;left arrow
        and     #<Iconleft
        bne     fu_hao_left_1
        jmp     call_input_lmain
fu_hao_left_1:
        lda     PhonNo
        sec
        sbc     #20
        sta     PhonNo
        lda     PhonNo+1
        sbc     #0
        sta     PhonNo+1
        jsr     fu_hao_input_0
        jmp     call_input_lmain
fu_hao_rightkey_proc:
        lda     IconRight>>8
        and     #<IconRight            ;;Right arrow
        bne     fu_hao_right_key1
        jmp     call_input_lmain

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -