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

📄 main.asm

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

        STZ     <LCTR

        LInitIO_Bug

        rmb7    <SysF           ;; Clear power off states flag.

        lda     <PA             ;; Reload last state of port A.
        rmb3    <EFlag          ;; Clear Key down event flag.

        lda     #CataMode       ;; PreSet Clock mode.
        bbr5    <SF0,pop7       ;;sf0.5=1 alarm ok
        rmb5    <SF0
        lda     #alarmmode
pop7:   sta     <Mode
        stz     <ExtraMode      ;; Clear extra mode.
        jsr     InitAll_Bug         ;; Initial all register.

        bbs0    <SF0,pop8       ;; Branch if Hourly alarm.
        lda     AlarmFlag2
        and     #00100000b      ;; Branch if Alarm or Schedule alarm.
        bne     pop8
        lkeytone
pop8:
        jmp     SetMode5_bug        ;;

pwoend:
        jmp     Main0_Bug

;
;
;
InitAll_Bug:
;; PreClear ZData area.即清CData
        ldx     #ZDataSize-1
inia2:  stz     ZData,x
        dex
        bpl     inia2

;; PreClear PData area.(100H ~ 18FH)
        ldx     #0
inia4:  stz     MenuBuff,x
        inx
        cpx     #stack_last_ram-MenuBuff  ;;清:帮助用RAM,lcd用的临时RAM
        bne     inia4
        lSetScreen   1
;; Random generation off.
        lRandomOff
;; Set cursor to normal size.
        lSetCursorSize  1
;; Stop timer.
        lsettimer    0
Inia5_bug:

;; Sound off.
        lSoundOff        ;; Turn off all sound.

;; Stop ScanF.
        stz     <SCanFF
        lCursorOff       ;; Set cursor off.

        rts

;///////////// Main Loop End /////////////////////
;
;
;

;\\\\\\\\\\ Cursor Flash And Input Function //////

trowtab:
        db      00h,20,40,60,80,100,120,140,160,180,200
curflash_bug:
        lda     <ScanFF
        bpl     CurFlash_0              ;;should be test
        and     #00110011b
        beq     FlashEnglishIn
CurFlash_0:
        ldx     <CurY
        lda     trowtab,x       ;; CurY * 16.
        clc
        adc     <CurX
        tax
        lda     TextBuffor,x
        tax

        lda     <CurY
        asl
        asl
        asl
        asl
        sta     <OY
        lda     <CurX
        asl
        asl
        asl
        sta     <OX

        lda     #7
        cpx     #0a1h
        bcc     FlashCursor7
        lda     #15
FlashCursor7:
        sta     <image_width
        bbr0    <CursorSize,FlashCursor7xx
        lda     #8
        bbr1    <CursorSize,FlashCursor7x
        lda     #16
        bra     FlashCursor7x
FlashCursor7xx:
        clc
        lda     #16
        bbr1    <CursorSize,FlashCursor8xxx
        lda     #8
FlashCursor8xxx:
        adc     <oy
        sta     <oy
        lda     #1
FlashCursor7x:
        sta     <image_hight_temp

      	LBlockInvert
        rts

FlashEnglishIn:
        jsr     SetChinInBuf
        ldy     #0
        lda     (<IND),y
        cmp     #' '
        beq     CurFlash_0
        lda     <CurX
        pha
        lda     <CurY
        pha
        lda     <CursorSize
        pha
        lda     #03h            ;;cursor mode = 3
        sta     <CursorSize
FlashEnglishIn_0:
        iny
        lda     (<IND),y
        cmp     #' '
        bne     FlashEnglishIn_0
        tya
        clc
        adc     #5
        sta     <CurX
        lda     #4
        sta     <CurY
        jsr     CurFlash_0
        pla
        sta     <CursorSize
        pla
        sta     <CurY
        pla
        sta     <CurX
        rts

	rts
;
;\\\\\\\\\\\\\\\\\\\\\\\input char///////////////////////
;
;;[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_bug:
        LKeyTone
        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
;;      bcc     dci85
;;      smb0    <ScanFState
;;      dec     <CurY
dci85:
;;      ldx     #6
;;      jmp     main33

Dci9:
        smb6    <EFlag          ;; Set key press even flag.
        jmp     call_input_lmainu
Fu_Hao_char_in:
        rmb1    <scanff
        smb0    <scanff
        ldx     #0ffh
Fu_Hao_char_in_1:
        inx
        lda     fu_hao_key_define,x
        bmi     if_fu_hao_select

        cmp     <KeyNo
        bne     Fu_Hao_char_in_1
        txa
        asl

⌨️ 快捷键说明

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