📄 input.asm
字号:
; ***************************************************************************
; * Project : Electronic Dictionary *
; * Date : 2003.9 *
; * File Name : INPUT.ASM *
; ***************************************************************************
pw 128
case off
externs on
include ST2202.def ; Include ST2100 I/O define.
include Data.def ; Data RAM define.
include Bios.h
include Graphics.h
include Graph.def
include KeyDef.def
include DataBank.def
public myexitscanf
public print_ins
public MyScanF
public MyScanFu
public Print
public ScanF
public ScanFU
public InitScanF
public CharInput
public ClrRow
public ClrRow0
public ClrRow1
public ClrRow2
public ClrRow3
public ClrRow4
public ClrRow5
public ClrRow6
public ClrRow7
public ClrRow8
public ClrRow9
public SetChinInBuf
public trowtab
public fu_hao_table1
public engchrtab
public engktab
public digchrtab1
public digktab1
public bkey_and_nkey
public selktab
public fu_hao_key_define
public digchrtab
public digktab
public dgfktab
public ascchrtab
public ascktab
public enfktab
public shiftchartab
public shiftasctab
public md1keytab
public md0keytab
temp_ox_for_input equ 95h
temp_oy_for_input equ 96h
temp_y_for_input equ 97h
ds0 .SECTION
error:
db '错误',0
;;[T]-----------------------------------------------[T]
;; 数字 key define.
;;[T]-----------------------------------------------[T]
DigKTab:
db SpaceKey,UpKey,PointKey
DigKTab1:
db K0Key,K1Key,K2Key,K3Key,K4Key
db K5Key,K6Key,K7Key,K8Key,K9Key
db NullKey
;;[T]-----------------------------------------------[T]
;; 数字 char define.
;;[T]-----------------------------------------------[T]
DigChrTab:
db ' -.'
DigChrTab1:
db '01234'
db '56789'
;;[T]-----------------------------------------------[T]
;; 英文 key define.
;;[T]-----------------------------------------------[T]
ShiftAscTab:
db LeftKey,DownKey,RightKey
db pgup,UpKey,pgdown,SpaceKey,PointKey,QuesKey
AscKTab:
db SpaceKey,PointKey
DicEngKTab:
db QuesKey
EngKTab:
db ZKey
db AKey,BKey,CKey,DKey,EKey
db FKey,GKey,HKey,IKey,JKey
db KKey,LKey,MKey,NKey,OKey
db PKey,QKey,RKey,SKey,TKey
db UKey,VKey,WKey,XKey,YKey
db NullKey
;[T]-----------------------------------------------[T]
; 英文 char define.
;[T]-----------------------------------------------[T]
ShiftCharTab:
db '()@'
db '#-:;,*'
AscChrTab:
db ' .'
DicEngChrTab:
db '?'
EngChrTab:
db 'z'
db 'abcde'
db 'fghij'
db 'klmno'
db 'pqrst'
db 'uvwxy'
;[T]-----------------------------------------------[T]
; Select key table.
;[T]-----------------------------------------------[T]
SelKTab:
db Sel1Key ;; '1'
db Sel2Key ;; '2'
db Sel3Key ;; '3'
db Sel4Key ;; '4'
db Sel5Key ;; '5'
db Sel6Key ;; '6'
db Sel7Key ;; '7'
db Sel8Key ;; '8'
db Sel9Key ;; '9'
db Sel0Key ;; '0'
db NullKey ;; End of table.
;[T]-----------------------------------------------[T]
; Digit input mode function key table.
;[T]-----------------------------------------------[T]
DgFKTab:
db LanKey ;; 中/英
db InsertKey
db EnterKey ;; Enter
db EscKey ;; 'ESC' key.
db UpKey ;;'-'
db DownKey ;;'+'
db LKey
db NullKey ;; End of table.
;[T]-----------------------------------------------[T]
; English input mode function key table.
;[T]-----------------------------------------------[T]
EnFKTab:
db LanKey ;; 中/英
db InsertKey
db EnterKey ;; Enter
db EscKey ;; 'ESC' key.
db queskey ;; '*'
db NullKey ;; End of table.
;[T]-----------------------------------------------[T]
; Mode 0 : Function key table for 中文输入。
;[T]-----------------------------------------------[T]
Md0KeyTab:
db LanKey ;; 中/英
db LeftKey ;; <-
db EnterKey ;; Enter
db EscKey ;; 'ESC' key.
db SpaceKey ;; Space key.
db QuesKey ;; '?' : 与0共key,在笔划输入会有重key问题
db PointKey ;; '.'
db DelKey
db InsertKey
db NullKey ;; End of table.
;[T]-----------------------------------------------[T]
; Mode 1 : Function key table.
;[T]-----------------------------------------------[T]
Md1KeyTab:
db LanKey ;; 中/英
db LeftKey ;; <-
db RightKey ;; ->
db EscKey ;; 'ESC' key.
db NullKey ;; End of table.
fu_hao_key_define:
db LanKey ;; 符号—>拼
db leftkey
db rightkey
db spacekey
db DelKey
db InsertKey
db SpaceKey
db upkey
db downkey
db enterkey
db esckey
db NullKey ;; End of table.
bkey_and_nkey:
db BKey,Nkey
fu_hao_table1:
db '[符] , . ; ~ ` ! @ # $ % ^ & * ( ) + | \ / = - ] [ { } " : ? > < ',0
PS0 .SECTION
BankNo equ graphics_bank
;;[T]-----------------------------------------------[T]
;; Extera mode index look-up table.
;;[T]-----------------------------------------------[T]
Sel1Key equ BKey ;; '1'
Sel2Key equ NKey ;; '2'
Sel3Key equ MKey ;; '3'
Sel4Key equ GKey ;; '4'
Sel5Key equ HKey ;; '5'
Sel6Key equ JKey ;; '6'
Sel7Key equ TKey ;; '7'
Sel8Key equ YKey ;; '8'
Sel9Key equ UKey ;; '9'
Sel0Key equ QuesKey ;; '0'
; Digit input key define.
K0Key equ QuesKey ;; '0'
K1Key equ BKey ;; '1'
K2Key equ NKey ;; '2'
K3Key equ MKey ;; '3'
K4Key equ GKey ;; '4'
K5Key equ HKey ;; '5'
K6Key equ JKey ;; '6'
K7Key equ TKey ;; '7'
K8Key equ YKey ;; '8'
K9Key equ UKey ;; '9'
ErrMsg:
db '查无此字',0
InLenTab: ;;2001-4-18 16:27
db '[拼]'
db '[五]'
db '[笔]'
db '[部]'
db '[符]'
db '[数]'
db '[英小写]'
db '[英大写]'
;[T]-----------------------------------------------[T]
; Digit input mode function key process table.
;[T]-----------------------------------------------[T]
DgFPrcTab:
dw Dg2Ch-1 ;; 中/英
dw BSPrc1-1 ;; <-
dw EndScanF1-1 ;; Enter
dw EndScanF1-1 ;; ESC.
dw Dci9-1
dw Dci9-1
dw Dci9-1
;[T]-----------------------------------------------[T]
; English input mode function key process table.
;[T]-----------------------------------------------[T]
EnFPrcTab:
dw En2Dig-1 ;; 中/英
dw BSPrc1-1 ;; <-
dw EndScanF1-1 ;; Enter
dw EndScanF1-1 ;; 'SEC' key
dw StarIn-1 ;; '*'
;[T]-----------------------------------------------[T]
; Mode 0 : Funcation key process entry address
; for 中文输入。
;[T]-----------------------------------------------[T]
Md0PrcTab:
dw ExIME-1 ;; 中->英切换
dw BSPrc-1 ;; <-
dw EnterPrc-1 ;; Enter
dw ESC0Prc-1 ;; 'ESC' key.
dw SpaceIn-1 ;; Space key.
dw QuesIn-1 ;; '?'
dw PointIn-1 ;; '.'
dw BSPrc-1 ;; delete
dw BSPrc1-1 ;;
fu_hao_key_function:
dw fu_hao_LanKey_proc-1 ;; 符号—>拼
dw fu_hao_leftkey_proc-1
dw fu_hao_rightkey_proc-1
dw SpaceIn-1
dw Dci9-1
dw BSPrc1-1 ;;
dw Dci9-1
dw Dci9-1
dw Dci9-1
dw EndScanF1-1 ;; Enter
dw EndScanF1-1 ;; ESC.
;;[T]-----------------------------------------------[T]
;; Mode 1 : Funcation key process entry address.
;;[T]-----------------------------------------------[T]
Md1PrcTab:
dw ExIME-1 ;; 中->英切换
dw LastGrp-1 ;; <-
dw NextGrp-1 ;; ->
dw ESC1Prc-1 ;; 'ESC' key.
;;[T]-----------------------------------------------[T]
;; Mode 2 : Function key table.
;;[T]-----------------------------------------------[T]
Md2KeyTab:
db NullKey
;;[T]-----------------------------------------------[T]
;; Mode 2 : Funcation key process entry address.
;;[T]-----------------------------------------------[T]
Md2PrcTab:
;;[T]-----------------------------------------------[T]
;; Mode 3 : Function key table.
;;[T]-----------------------------------------------[T]
Md3KeyTab:
db NullKey
;;[T]-----------------------------------------------[T]
;; Mode 3 : Funcation key process entry address.
;;[T]-----------------------------------------------[T]
Md3PrcTab:
;;[T]-----------------------------------------------[T]
;; Mode key process table.
;;[T]-----------------------------------------------[T]
MdKpTab:
dw Md0Keytab ;; Input mode funcation table.
dw Md0Prctab
dw Md1Keytab ;; Select mode funcation table.
dw Md1Prctab
dw Md2Keytab ;;空的
dw Md2Prctab ;;
dw Md3Keytab ;; Error mode funcation table.
dw Md3Prctab
;;[T]-----------------------------------------------[T]
;; Normal key process table.
;; for 罗马拼音。
;;[T]-----------------------------------------------[T]
CNKPrcTab:
dw CMd0NKPrc-1
dw Md1NKPrc-1
dw Md2NKPrc-1
dw Md3NKPrc-1 ;; Error mode.
;;[T]-----------------------------------------------[T]
;; Normal key process table.
;; 总笔划输入法。
;;[T]-----------------------------------------------[T]
SNKPrcTab:
dw SNK0Prc-1
dw Md1NKPrc-1
dw SNK2Prc-1
dw Md3NKPrc-1 ;; Error mode.
;;[P]-----------------------------------------------[P]
;; Char Input.
;;[P]-----------------------------------------------[P]
chiTab: dw ChineseChrIn-1
dw EngChrIn-1
dw DigChrIn-1
dw Fu_Hao_char_in-1
CharInput:
jsr jsr_keytone
rmb0 <ScanFState ;; Clear BOL.
rmb1 <ScanFState ;; Clear EOL.
lda <ScanFF ;; ScanF flag.
and #00110000b
lsr
lsr
lsr
tax
lda chiTab+1,x
pha
lda chiTab,x
pha
rts
;;[P]-----------------------------------------------[P]
;; Char Input for "英文" 输入法。
;;[P]-----------------------------------------------[P]
EngChrIn_0:
ldx #0ffh
EngChrIn_1:
inx
lda ShiftAscTab,x
bmi echi3
cmp <KeyNo
bne EngChrIn_1
lda #IconShift&0ffh
trb IconShift>>8
cpx #10
bcs EngChrIn_2
lda #NullKey
sta <KeyNo
lda ShiftCharTab,x
jmp Dci8
EngChrIn_2:
lda ShiftCharTab,x
bbs6 <ScanFF,EngChrIn_3 ;;Branch if UpCase.
sec
sbc #20h
EngChrIn_3:
jmp Dci8
;;*******************************************
EngChrIn:
lda #IconShift&0ffh
and IconShift>>8
bne EngChrIn_0
echi3:
ldx #0ffh
echi2: inx
lda EnFKTab,x
bmi eci0 ;; End of table.
cmp <KeyNo
bne echi2
txa
asl
tax
lda EnFPrcTab+1,x
pha
lda EnFPrcTab,x
pha
rts
eci0:
ldx #0ffh
;;bbr2 <ScanFF,eci1 ;; Branch if not on fix. english mode.
;;ldx #0
eci1: inx
lda AscKTab,x
bpl eci5
jmp Dci9 ;; End of table.
eci5:
cmp <KeyNo
bne eci1
lda AscChrTab,x
bbr6 <ScanFF,Dci8 ;; Branch if LowCase.
bbs2 <ScanFF,Dci8 ;; Branch if Fix. english input mode.
cmp #'a'
bcc Dci8
cmp #'z'+1
bcs Dci8
clc
adc #'A'-'a' ;; LowCase -> UpCase.
bra Dci8
;;[P]-----------------------------------------------[P]
;; Char Input for "数字" 输入法。
;;[P]-----------------------------------------------[P]
DigChrIn:
ldx #0ffh
dchi2: inx
lda DgFKTab,x
bmi dci0 ;; End of table.
cmp <KeyNo
bne dchi2
txa
asl
tax
lda DgFPrcTab+1,x
pha
lda DgFPrcTab,x
pha
rts
dci0: ldx #0ffh
dci1: inx
lda DigKTab,x
bmi dci9 ;; End of table.
cmp <KeyNo
bne dci1
lda DigChrTab,x
Dci8:
bbs2 <InputFlag,Dci9 ;;2001-5-17 10:01 ;;=1input have full
sta <CharL ;;2001-4-25 20:29
smb0 <InputFlag ;;=1char prepare ok
;; pha
;; jsr EraIns ;; Erase one word (English or Chinese)
;; plx
;; jsr PutChar
;; smb6 <EFlag ;; Set key press even flag.
;; ldy <CurY
;; cpy #4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -