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

📄 jb8-psu.lst

📁 MC68HC608JB8的固件例程源程序.zip
💻 LST
📖 第 1 页 / 共 3 页
字号:
                 102  * ====== Variable Definations ===========================
                                                              =================
                 103  
 0040            104          ORG     RAM_BEG
                 105  * ====== Begin of System RAM area =======================
                                                              =================
 0040            106  SRAM_Beg    equ     *
                 107  
                 108  * --- PORT E --------------------------------------------
                                                              -----------------
 0040            109  V_PTE           ds      1                 ; store value 
                                                                       of PORTE
                 110  
                 111  * --- OC/IC Timer ---------------------------------------
                                                              -----------------
 0041            112  K_Fcpu          equ     3000              ; CPU clock 
                                                              freq.       [KHz]
 0041            113  K_Ftim          equ     {K_Fcpu/4}        ; Timer clock 
                                                                rate      [KHz]
                 114  *
                 115  * Tmr CH0 periodic interrupt - for USB suspend timeout
                 116  * USB suspend time changed to 8ms 2 May 2000 *
 0041            117  K_Tch0          equ     8                 ; CH0 OCMP 
                                                              period       [ms]
 0041            118  K_Nch0          equ     {K_Tch0*K_Ftim}   ;              
                                                                         [cnts]
                 119  *
                 120  * Tmr CH1 periodic interrupt - for keyboard idle 
                                                        timeout, 40ms time tick
 0041            121  K_Tch1          equ     4                 ; CH1 OCMP 
                                                              period       [ms]
 0041            122  K_Nch1          equ     {K_Tch1*K_Ftim}   ;              
                                                                         [cnts]
                 123  *
 0041            124  V_TmrH          ds      1       ; Temp storage of TACNT_H
                 125  *
                 126  * (dec. by timer Ch1 interrupt - every 4ms)
 0042            127  VC_Kidle        ds      1       ; Counter for Kbd. 
                                                            Report Idle Timeout
                 128                                  ; (dec. for every 4ms 
                                                                     time tick)
                 129  *
                 130  * (dec. by timer Ch1 interrupt - every 4ms)
 0043            131  KC_40ms         equ     10      ; init. value for VC_40ms
 0043            132  VC_40ms         ds      1       ; counter for 40ms time 
                                                                           tick
                 133  *
 0044            134  KC_10s          equ     200
 0044            135  KC_400ms        equ     8       ; for POR delay
 0044            136  KC_350ms        equ     7       ; for BAT test delay
 0044            137  KC_150ms        equ     3
 0044            138  VC_Xms          ds      1       ; counter for 350ms,400ms
                                                                      ,3s delay
                 139  *
 0045            140  VS_TIMER        ds      1       ; Timer Status Byte
 0046            141  b_T4MS          equ 0           ;  -1  4ms time tick
 0046            142  b_T40MS         equ 1           ;  -1  40ms time tick


jb8-psu.ASM            Assembled with CASM08Z  1/23/2003  9:57:47 PM  PAGE 7



 0046            143  b_Tsus          equ 2           ;  -1  suspend timeout
                 144  
 0046            145  K_N50ms         equ     {50*K_Ftim}       ; timer counts 
                                                                for 50ms  [cnt]
                 146  
                 147  *
                 148  
                 149  ;* (bit definition follow LED pins of port D)
                 150  ;V_LED           ds      1       ; LEDs status byte (PS2 
                                                                        report)
                 151  ;b_SCRL          equ 2           ;  =1    SCROLL lock 
                                                                         enable
                 152  ;b_CAPS          equ 3           ;  =1    CAPS lock 
                                                                         enable
                 153  ;b_NUM           equ 4           ;  =1    NUM lock enable
                 154  *
                 155  *
 0046            156  V_USBPS2    ds      1           ;
 0047            157  b_PS2Sys    equ 0
 0047            158  b_BatOKSent equ 1
                 159  
                 160  
                 161  * ====== Begin of PS2/USB RAM area ======================
                                                           ====================
 0047            162  URAM_BEG    equ     *
                 163  *
                 164  *
                 165  * --- Scan Keyboard -------------------------------------
                                                              -----------------
 0047            166  K_RowMax    Equ     8           ; 8 rows
 0047            167  K_ColMax    Equ     18          ; 18 columns
                 168  *
 0047            169  V_ScnStat   ds      1           ; Keyboard Scan Status
 0048            170  b_PKPress    equ 0              ;  =1    key press 
                                                        detected(on prev. scan)
 0048            171  b_CKPress    equ 1              ;  =1    key press 
                                                        detected(on curr. scan)
 0048            172  b_BrkKey     equ 2              ;  =1    BREAK key
 0048            173  b_Kghost     equ 3              ;  =1    ghost key 
                                                                       detected
 0048            174  b_NewScan    equ 4              ;  =1    signal SCAN_HDLR
                                                             to handle new scan
 0048            175  b_FOorun     equ 5              ;  =1    FIFO overrun
 0048            176  b_ScanEn     equ 6              ;  =1    enable scan 
                                                                    kbd. matrix
                 177  *
 0048            178  V_KbdStat   ds      1           ; keyboard status byte
 0049            179  b_LSFT       equ 0              ;  =1    <L-SHIFT> key 
                                                                        pressed
 0049            180  b_RSFT       equ 1              ;  =1    <R-SHIFT> key 
                                                                        pressed
 0049            181  b_LALT       equ 2              ;  =1    <L-ALT> key 
                                                                        pressed
 0049            182  b_LCTL       equ 3              ;  =1    <L-CTRL> key 
                                                                        pressed
 0049            183  b_RCTL       equ 4              ;  =1    <R-CTRL> key 
                                                                        pressed
 0049            184  b_CTRL       equ 5              ;  =1    <L-CTRL> or/and 


jb8-psu.ASM            Assembled with CASM08Z  1/23/2003  9:57:47 PM  PAGE 8



                                                           <R-CTRL> key pressed
 0049            185  b_RALT       equ 6              ;  =1    <R-ALT> key 
                                                                        pressed
 0049            186  b_SHIFT      equ 7              ;  =1    <L-SFT> or/and 
                                                            <R-SFT> key pressed
                 187  *
 0049            188  V_KeyNum    ds      1           ; key number
                 189  *
 004A            190  Q_CScan     ds      K_ColMax    ; queue to store curr. 
                                                                    scan result
 005C            191  Q_PScan     ds      K_ColMax    ; queue to store prev. 
                                                                    scan result
                 192  *
 006E            193  V_ColVal    ds      1           ; row values of curr. 
                                                                         column
                 194  *
 006F            195  VP_Col      ds      1           ; ptr to current column
 0070            196  VP_Row      ds      1           ; ptr to current row
                 197  *
                 198  * (if blank key at col i / row j, then j-th bit of 
                                                               Q_ColMsk[i] = 0)
 0071            199  Q_ColMsk    ds      K_ColMax    ; column masks of blank 
                                                                           keys
                 200  *
                 201  *
                 202  * --- Ghost Key Detector --------------------------------
                                                              -----------------
 0083            203  VC_One      ds      1           ; bit '1' counter
 0084            204  VP_ChkCol   ds      1           ; storage row values of 
                                                                   check column
                 205  *
 0085            206  V_GkeyRow   ds      1           ; ghost keys overlap 
                                                                        pattern
 0086            207  V_Gkeymsk   ds      1           ; ghost key rows mask
                 208  *
 0087            209  V_LED_PTD       ds      1       ; Image of PTD_LED
 0088            210  b_SCRL          equ 2           ;  =1    SCROLL lock 
                                                                         enable
 0088            211  b_CAPS          equ 3           ;  =1    CAPS lock enable
 0088            212  b_NUM           equ 4           ;  =1    NUM lock enable
                 213  
                 214  * --- Scan Matrix Keyboard ------------------------------
                                                              -----------------
                 215  *
 0088            216  VS_Scan         ds      1       ; Keyboard Scan Status 
                                                                           Byte
                 217  ;b_PKPress       equ     0       ;  1- key press 
                                                        detected for prev. scan
                 218  ;b_CKPress       equ     1       ;  1- key press 
                                                        detected for curr. scan
                 219  ;b_Kghost        equ     3       ;  1- ghost key detected
 0089            220  b_K_Fn_Fnd      equ     2
 0089            221  b_K_Fn_Tggl     equ     4
 0089            222  b_Fn_State        equ     5
 0089            223  b_Fn_Ctrl       equ     5       ;  PS2 use
 0089            224  b_Kovf          equ     6       ;  1- kbd report overflow
 0089            225  b_Fn_Alt        equ     7       ;  PS2 use
                 226  *


jb8-psu.ASM            Assembled with CASM08Z  1/23/2003  9:57:47 PM  PAGE 9



                 227  *
 0089            228  V_3_Zero        ds      1       ; Process of tri-zeros
 008A            229  b_Send_Ovr      equ     4       ; 1 - all bytes are sent
 008A            230  b_InH_3Z        equ     5       ; indicate the ON/OFF 
                                                                          state
 008A            231  b_3Z_Key_P      equ     6       ; indicate the '000' key 
                                                                     is pressed
 008A            232  b_3z_Key        equ     7       ; the Tri-zero key is 
                                                                        pressed
                 233  *
                 234  *
                 235  *
                 236  * -----------------------------------------------
 008A            237  COMRAMEND       equ     *
                 238  
                 239  
                 240  * -- PS2 RAM --------------------------------------------
                                                              -----------------
                 241  * --- Device Status -------------------------------------
                                                              -----------------
 008A            242  V_DevStat       ds      1       ; device status byte
 008B            243  b_KbdOff        equ 0           ;  =1    kbd disable
                 244  *
                 245  * --- KBD PS/2 Serial Rx Handler ------------------------
                                                              -----------------
 008B            246  V_RxKBD     ds      1           ; KBD Rx Status Byte
 008C            247  b_RxByte     equ 0              ;  1= new Rx data fm KBC
 008C            248  b_WData      equ 1              ;  1= wait for data byte

⌨️ 快捷键说明

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