用迪文屏模拟了个加密键盘功能

今日头条

1142人已加入

描述

今天用一个DGUS II的屏模拟了一下键盘加密(类似于网银加密键盘),很简单也很实用。具体视频和说明请参照http://bbs.elecfans.com/user/3035995/articles/来看下效果吧~


1:第一次录入

 


2:第二次录入



3:第三次录入


代码如下:

ORG       1000H

GOTO    START

NOP

NOP

NOP

 

ORG       1080H

 

START:

       LDWR    R0,5000H

        LDADR STRING

        MOVC R100,64

        MOVXR      R100,0,32

        LDWR  R20,5AA5H

        LDWR  R22,0000H;上电禁用掉数据录入控件

        LDWR  R24,0100H

        LDWR  R26,0000H

        LDWR  R0,00B0H

        MOVXR      R20,0,4

       

MAIN:

       CALL      ANYA_CHUFA

        CALL    CK_LURU

        CALL    CK_CHANGE

        GOTO  MAIN

        ;====================

        ;====================

ANYA_CHUFA:

       LDWR    R0,1F00H

        MOVXR      R10,1,1

        IJNE     R11,0,1

        RET

        LDWR  R0,00B0H

LOOP:    MOVXR R10,1,1

       IJNE       R10,0,LOOP  ;开启本条指令

        IJNE     R11,0,LOOP

        LDWR  R20,5AA5H

        LDWR  R22,0000H

        LDWR  R24,0100H

        LDWR  R26,0001H

        LDWR  R0,00B0H

        MOVXR      R20,0,4

      

LOOP1:  MOVXR R10,1,1

       IJNE       R10,0,LOOP1       ;模拟触发本条指令     

        IJNE     R11,0,LOOP1 

        LDWR  R20,5AA5H

        LDWR  R22,0004H

        LDWR  R24,100

        LDWR  R26,100

        LDWR  R0,00D4H

        MOVXR      R20,0,4

      

        LDWR  R10,0

        LDWR  R0,1F00H

        MOVXR      R10,0,1

        RET

;====================================

;====================================

CK_LURU:

       LDWR    R0,1F01H

        MOVXR      R10,1,1

        IJNE     R11,0,1

        RET

        LDWR  R10,1

        LDWR  R0,1F02H

        MOVXR      R10,0,1

        RET

;============================

CK_CHANGE:

       LDWR    R0,1F02H;检查标志位是不是1

        MOVXR      R10,1,1

        IJNE     R11,0,1

        RET

       LDWR    R0,1F01H;在标志位是1的情况下检查是不是在录入状态

        MOVXR      R10,1,1

        IJNE     R11,1,1

        RET;录入状态直接返回

        LDWR  R0,1F02H;标志位清零

        LDWR  R10,0

        MOVXR      R10,0,1

        LDWR  R0,5011H

        MOVXR      R10,1,1

        DEC     R10,1,1

        IJNE     R11,1,1

        LDWR  R10,12

        MOVXR      R10,0,1

        LDWR  R0,5000H;录入过程中调用的界面更改

        MOVXR      R10,1,32

        LDWR  R0,00B4H

        MOVXR      R10,0,32  

        LDWR  R10,5AA5H;更改该条触控指令

        LDWR  R12,0000H

        LDWR  R14,0100H

        LDWR  R16,0003H

        LDWR  R0,00B0H

        MOVXR      R10,0,4

;        LDWR R0,00B0H

LOOP3:  MOVXR R10,1,1

       IJNE       R10,0,LOOP3 

        IJNE     R11,0,LOOP3   

        LDWR  R20,5AA5H

        LDWR  R22,0000H

        LDWR  R24,0100H

        LDWR  R26,0000H;禁用该条指令

        LDWR  R0,00B0H

        MOVXR      R20,0,4   

  

CK_CHANGE_RET:

       NOP

        RET       

;=======================================

STRING:

DB  00H,00H,00H,00H,00H,00H,01H,03H,00H,B5H,FFH,00H,FFH,00H,FDH,00H,FEH,20H,00H,01H,08H,00H,01H,6AH,01H,5DH,00H,00H,00H,10H,00H,01H,FEH,01H,00H,0CH,00H,62H,01H,4CH,01H,7EH,02H,A5H,00H,62H,01H,4CH,FEH,00H,00H,00H,00H,00H,00H,00H,00H,00H,5AH,1FH,01H,00H,01H,00H

 



打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分