亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ps2main.asm

?? Cypress 的(鼠標+鍵盤)復合設備匯編源程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;========================================================================
;   FILE: ps2main.asm
;
;   This file contains the code that implements the ps2 interface to the
;   host. 
;
;REVISION_HISTORY:
;
;3/26/99 replaced command processor jump table "calls" with "jmps"
;
;2/10/99 Added XPAGEOFF,XPAGEON around command processor jump table
;
;8/25/98 Added a 250 usec delay after the reception of a RESET command but
;prior to the ACK of the command.  Some PC's did not like it without this delay.
;
;========================================================================


       XPAGEON

;RAM use for this module

ps2_flags:                      equ       ps2main_ram_base+0 ;flag byte
ps2_last_xmit:                  equ       ps2main_ram_base+1 ;last sent byte     
ps2_xmit_holding_reg:           equ       ps2main_ram_base+2 ;next byte to send
ps2_temp0:                      equ       ps2main_ram_base+3 ;temp register 1
ps2_temp1:                      equ       ps2main_ram_base+4 ;temp register 2
ps2_delay:                      equ       ps2main_ram_base+5 ;used for generating delays
ps2_ghost_flagsV:			  equ       ps2main_ram_base+6 ;used to detect PS2 ghost
c750ms_high_byteV:		  equ       ps2main_ram_base+7 ;used for generating delay
c750ms_low_byteV:			  equ       ps2main_ram_base+8 ;used for generating delay
PS2MAIN_RAM_SIZE:               equ       9

                     
;========================================================================
;   FUNCTION: ps2main
;
;   Main entry point for ps2. Sets up ports, initializes RAM,
;   calls initialization function for various modules, calls
;   the BAT function, then enters the main processing loop.
;
;
;
;========================================================================
soft_reset:
    di
    mov     a,0                             ;set psp stack to 0
    mov     psp,a                           ; 
    mov     a,0ffh                          ;set dsp stack to 0xff
    swap    a,dsp                           ;now we can call functions

ps2main:
    iowr    WATCHDOG_REG
    mov     A,NORMAL                         ;configure GPIO reg
    iowr    GPIO_CONFIG_REG
    mov     A,CLKH_DATAH
    iowr    USB_STATUS_CONTROL_REG          ;initialize control reg    

    ;clear variables local to this module

    CLEARRAM ps2main_ram_base,PS2MAIN_RAM_SIZE

    call    ksc_init_keyscan                    ;initialize the key scanner
    call    ps2key_init                         ;and ps2-specific key scanning routines        
    mov     A,PS2_ENABLED_INTERRUPTS            ;enable ps2 interrupts        
    iowr    GLOBAL_INTERRUPT_REG
    ei                                          ;enable interrupts                                                       
    call    ps2_BAT                             ;test the system
    mov     [ ps2_xmit_holding_reg],A           ;place result in holding register for transmission
    SETBIT  PS2_XMIT,ps2_flags                  ;set bit to indicate transmission necessary
    SETBIT   PS2_SCAN_KBD,ps2_flags              ;enable scanning
    mov     A,0
    mov     [dual_ifc_1ms],A
.loop:
    iowr    WATCHDOG_REG
    call    ps2_idle_loop                       ;do all stuff we need to whilst sitting around
    call    ps2_get_byte                        ;see if a byte has come in
    jnc     .l0
    call    ps2_do_command                      ;it has, kick off command processor
.l0:
    mov     A,[dual_ifc_1ms]                       ;else check for scanning interval  
    cmp     A,PS2_SCAN_INTERVAL                 ; 
    jc      .l1                                 ;not time to scan yet, loop

    mov     A,0                                 ;reset scanning interval
    mov     [dual_ifc_1ms],A       

    TSTBIT  PS2_SCAN_KBD,ps2_flags              ;if scanning enabled
    jz      .l1                                           
    call    ps2_scan_keys                       ;  scan the keyboard                       
.l1:
    TSTBIT  PS2_XMIT,ps2_flags                  ;  and if we're not sending something else
    jnz     .l2                                 
    call    ps2_getkey                          ;  see if the keyboard scan resulted in something
    jc      .l2                                 
    mov     [ ps2_xmit_holding_reg],A           ;  get it if so, place in holding register
    SETBIT  PS2_XMIT,ps2_flags                  ;  set flag indicating transmission necessary
.l2:
    jmp     .loop                               ;  and loop




;========================================================================
; FUNCTION: ps2_wait_byte
;
;
; waits for reception of a byte from the host. This is called to get
; extra bytes in a command from the host. While the byte is waited for,
; the idle loop is called to keep other tasks going.
;
; Returns:  A:  received byte from host
;           C:  1
;
;
;========================================================================

ps2_wait_byte:
    call    ps2_idle_loop                   ;do boring stuff
    call    ps2_get_byte                    ;see if host has sent us something
    jnc     ps2_wait_byte                   ;no, continue to wait
    ret                                     ;yes, return with carry set




;========================================================================
; FUNCTION: ps2_get_byte
;
;
; tries to get a byte from the host
;
; Returns:  A:  received byte from host
;           C:  1 if A is valid, 0 if no byte received
;
;========================================================================

ps2_get_byte:
   iord     USB_STATUS_CONTROL_REG                  ;if host inhibit condition,           
   and      A,PS2_CLOCK_BIT                      
   jz       .no                                     ;skip this whole operation
   iord     USB_STATUS_CONTROL_REG                  ;if host holding us off
   and      A,PS2_DATA_BIT                          ;skip too
   jnz      .no                                 

   iord     USB_STATUS_CONTROL_REG                  ;check for inhibit again
   and      A,PS2_CLOCK_BIT
   jz       .no                                 
   call     ps2_receive                             ;all ok, try for byte
   jc       .no1                                    ;if byte received
   SETC                                             ;set carry and exit
   ret

.no1:
   SETBIT       PS2_RESEND_REQUESTED,ps2_flags      ;if something went awry during reception,
                                                    ;flag a resend request
.no:
   CLEARC                                           ;indicate nothing gotten,gained

   ret


;========================================================================
; FUNCTION: ps2_idle_loop
;
; the idle loop does the things that must be done during times when nothing
; else is happening.
;
; Returns: nothing
;========================================================================

ps2_idle_loop:
   iord     USB_STATUS_CONTROL_REG              ;if host inhibit                  
   and      A,PS2_CLOCK_BIT                     ;don't bother with anything
   jz       .il2                                 
   TSTBIT   PS2_RESEND_REQUESTED,ps2_flags      ;if we need last transmission resent
   jz       .il0                             

   mov      A,PS2_RSND                          ;send a resend request
   call     ps2_send
   jc       .il2                             
   CLRBIT   PS2_RESEND_REQUESTED,ps2_flags      ;and clear the resend requirement
   jmp      .il2                             

.il0:
   TSTBIT   PS2_RESEND,ps2_flags                ;if host wants last byte resent
   jz       .il1                             

   mov      A,[ps2_last_xmit]                   ;get it
   call     ps2_send                            ;resent it
   jc       .il2                             
   CLRBIT   PS2_RESEND,ps2_flags                ;reset flag
   jmp  .il2                             

.il1:
   TSTBIT   PS2_XMIT,ps2_flags                  ;if we've got something interesting to send
   jz       .il2                             

   mov      A,[ps2_xmit_holding_reg]            ;get it
   call     ps2_send                            ;send it
   jc       .il2                             
   CLRBIT   PS2_XMIT,ps2_flags                  ;clear flag saying we've got something
   mov      A,[ps2_xmit_holding_reg]            ;save last transmission
   mov      [ ps2_last_xmit],A                   

.il2:
       ret                                     ;that is it



;========================================================================
; FUNCTION: ps2_do_command
;
; host command processor switch statement
;
; Returns: nothing
;========================================================================

ps2_do_command:

   sub      A,0EDh                              ;subtract off base of command                  
   jc       ps2_invalid_command                 ;whoops, bad command
   mov      X,A                                 ;else save zero-based command in X
                                                ;clear all resend requirementd
   CLRBIT  (PS2_RESEND_REQUESTED + PS2_RESEND),ps2_flags       
   mov      A,X                                 ;get back zero-based command
   rlc                                          ;prepare for case jump
                                             ;to proper routine
   jacc    .switch              

XPAGEOFF
.switch:
    jmp    ps2_set_status_indicators
    jmp    ps2_echo_enable
    jmp    ps2_invalid_command
    jmp    ps2_select_alternate_scan_code
    jmp    ps2_invalid_command
    jmp    ps2_read_id
    jmp    ps2_set_typematic_rate_delay
    jmp    ps2_enable
    jmp    ps2_default_disable
    jmp    ps2_set_default
    jmp    ps2_set_keys
    jmp    ps2_set_keys
    jmp    ps2_set_keys
    jmp    ps2_set_keys
    jmp    ps2_set_key_type
    jmp    ps2_set_key_type
    jmp    ps2_set_key_type
    jmp    ps2_resend
    jmp    ps2_reset
endswitch:
    jc      ps2_do_command                          ;if command failed,
    ret
XPAGEON

;========================================================================
; FUNCTION: ps2_invalid_command
;
; handles invalid commands
;
;
; Returns:
;   C = 0 for success
;========================================================================

ps2_invalid_command:
    SETBIT  PS2_RESEND_REQUESTED,ps2_flags          ;flag that we need a resend
    CLEARC                                          ;clear C indicating we're done
    jmp     endswitch                               ;and return



;========================================================================
; FUNCTION: ps2_set_status_indicators
;
; sets indicator leds
;
; Returns:
;
;   C: 0 if command was sucessful
;   C: 1 if command failed 
;
;========================================================================

ps2_set_status_indicators:
    call    ps2_ack_byte                ;ack this command
    call    ps2_wait_byte               ;wait for 2nd byte
    cmp           A,8                   ;if 2nd byte invalid                             
    jc           .ed0                                
    SETC                                ;indicate it
    jmp     endswitch                   ;and return

.ed0:                                   ;else
    and     A,7                         ;mask off all but 3 ls bits
    index   ps2_led_tbl                 ;use translation table 
    push    A                           ;save it
    call    ksc_writeLED              ;write the leds
    pop     A                           ;get it back
    and     A,NUM_LOCK_LED              ;save state of numlock
    mov     [ps2key_numlock],A          ;locally
    call    ps2_ack_byte                ;ack this byte too
    CLEARC                              ;indicate we are done
    jmp     endswitch


;table to translate ps2-command enumeration of leds into our own bits
XPAGEOFF
ps2_led_tbl:
    db  0
    db  SCROLL_LOCK_LED
       db       NUM_LOCK_LED
    db  SCROLL_LOCK_LED + NUM_LOCK_LED
    db  CAPS_LOCK_LED
    db  CAPS_LOCK_LED + SCROLL_LOCK_LED
    db  CAPS_LOCK_LED + NUM_LOCK_LED
    db  CAPS_LOCK_LED + NUM_LOCK_LED + SCROLL_LOCK_LED       
XPAGEON





;========================================================================
; 
; FUNCTION: ps2_echo_enable -- burps back an echo byte
;
; Returns:
;
;   C: 0 command can't fail
;========================================================================

ps2_echo_enable:
    mov     A,PS2_ECHO                      ;send echo response
    call    ps2_put_byte                        ;and respond
    CLEARC
    jmp     endswitch

;========================================================================
;   FUNCTION: ps2_select_alternate_scan_code
;
; Returns:
;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
九九精品一区二区| 亚洲一区二区在线观看视频| 国产精品一二三四区| 久久免费国产精品| av亚洲精华国产精华| 亚洲欧美偷拍另类a∨色屁股| av网站免费线看精品| 一区二区三区四区中文字幕| 欧美性三三影院| 麻豆精品在线播放| 国产欧美1区2区3区| 91久久免费观看| 麻豆91在线播放免费| 国产欧美一区二区三区鸳鸯浴| av在线综合网| 亚洲.国产.中文慕字在线| 久久一夜天堂av一区二区三区| 成人一区二区三区| 亚洲电影视频在线| 精品人伦一区二区色婷婷| 国产成a人亚洲精| 亚洲成人在线免费| 久久久99久久| 欧美日韩在线观看一区二区 | 中文字幕色av一区二区三区| 91免费观看在线| 日本特黄久久久高潮| 国产嫩草影院久久久久| 欧美久久久影院| 高清不卡一二三区| 日本色综合中文字幕| 亚洲同性同志一二三专区| 欧美电影免费观看高清完整版在 | 亚洲欧美一区二区久久| 欧美精品乱码久久久久久| 国产一区二区三区| 亚洲国产精品久久人人爱蜜臀| 久久久久99精品国产片| 91成人网在线| 成人黄色av电影| 裸体歌舞表演一区二区| 亚洲激情男女视频| 国产欧美一区二区三区鸳鸯浴| 欧美日本视频在线| a在线播放不卡| 激情国产一区二区| 亚洲一区av在线| 国产精品久久久久影院| 日韩精品综合一本久道在线视频| 色综合久久久久综合| 国产精品996| 日韩va亚洲va欧美va久久| 亚洲免费伊人电影| 欧美经典三级视频一区二区三区| 精品视频全国免费看| 97久久超碰国产精品| 国产又黄又大久久| 蜜桃视频在线一区| 亚洲1区2区3区4区| 亚洲电影欧美电影有声小说| 亚洲青青青在线视频| 国产精品美女久久久久aⅴ| 精品国产成人在线影院| 日韩欧美国产综合一区| 欧美高清视频不卡网| 欧美在线色视频| 在线免费观看日本一区| 97精品久久久午夜一区二区三区| 成人免费三级在线| 国产精品一色哟哟哟| 国产一区 二区| 国产乱色国产精品免费视频| 麻豆精品新av中文字幕| 青青草97国产精品免费观看 | 九一久久久久久| 日韩精品成人一区二区在线| 婷婷久久综合九色综合伊人色| 洋洋成人永久网站入口| 一区二区三区不卡视频| 一区二区三区波多野结衣在线观看| 亚洲欧洲国产日韩| 亚洲色图另类专区| 亚洲欧美日本韩国| 亚洲一区自拍偷拍| 丝袜美腿高跟呻吟高潮一区| 蜜桃视频第一区免费观看| 久久电影网电视剧免费观看| 麻豆91在线播放免费| 国产在线不卡视频| 成人国产电影网| 在线观看www91| 7777精品伊人久久久大香线蕉 | 精品久久国产97色综合| 久久综合视频网| 国产精品久久久久三级| 一区二区三区在线视频免费| 丝袜诱惑亚洲看片| 国产在线看一区| 99久久精品情趣| 欧美日韩国产小视频| 日韩午夜激情免费电影| 久久久久久**毛片大全| 亚洲天堂免费看| 日韩和欧美一区二区| 韩国毛片一区二区三区| 成人免费精品视频| 欧美日韩黄色影视| 国产亚洲一区二区三区在线观看 | 亚洲精品老司机| 日韩高清在线电影| 成人在线视频一区二区| 在线观看一区二区视频| 26uuu精品一区二区三区四区在线| 中文字幕亚洲在| 免费在线看成人av| 91性感美女视频| 精品免费99久久| 亚洲精品国产精华液| 麻豆91在线播放免费| 99国产精品久久久久久久久久| 欧美放荡的少妇| 欧美国产丝袜视频| 秋霞电影网一区二区| 色综合久久天天综合网| 精品久久久久久亚洲综合网| 亚洲男人都懂的| 国产精品夜夜爽| 欧美日韩国产综合一区二区三区 | 亚洲一区二区三区四区不卡| 精彩视频一区二区三区| 欧美午夜一区二区三区免费大片| 久久久www成人免费无遮挡大片| 亚洲精品乱码久久久久久日本蜜臀| 久久国产精品99精品国产 | 91精品国产免费久久综合| 国产精品视频线看| 麻豆精品视频在线| 欧美视频在线一区二区三区| 国产精品久久三区| 国产福利精品导航| 欧美成人精品高清在线播放| 午夜激情一区二区| 日本乱人伦一区| 欧美激情综合网| 国产一区二区三区不卡在线观看| 91精品综合久久久久久| 亚洲国产你懂的| 在线免费观看一区| 亚洲天堂a在线| gogogo免费视频观看亚洲一| 精品国产伦一区二区三区观看方式 | 亚洲综合色自拍一区| 成人激情午夜影院| 久久久久久久久久久久久久久99| 日韩精品亚洲一区二区三区免费| 欧美性猛片aaaaaaa做受| 国产精品久久免费看| 国产成人av网站| 国产三级精品在线| 国产一区二区主播在线| 精品捆绑美女sm三区| 日本伊人精品一区二区三区观看方式 | 视频一区中文字幕国产| 欧美日韩在线播放三区四区| 亚洲专区一二三| 91电影在线观看| 亚洲妇熟xx妇色黄| 欧美人妇做爰xxxⅹ性高电影| 亚洲成人tv网| 欧美一区在线视频| 免费欧美日韩国产三级电影| 日韩免费观看2025年上映的电影| 男人的j进女人的j一区| 日韩欧美中文字幕一区| 麻豆91免费看| 国产女同性恋一区二区| gogo大胆日本视频一区| 亚洲欧洲综合另类在线| 色8久久精品久久久久久蜜| 亚洲午夜一二三区视频| 91精品国产色综合久久ai换脸| 久久97超碰国产精品超碰| 国产视频一区在线观看| av在线不卡观看免费观看| 一区二区三区欧美在线观看| 欧美亚日韩国产aⅴ精品中极品| 天天影视涩香欲综合网| 精品国产露脸精彩对白| 国产91在线观看丝袜| 一区二区三区在线视频观看| 欧美系列亚洲系列| 捆绑调教一区二区三区| 国产欧美一区二区精品性色| 一本久道中文字幕精品亚洲嫩| 亚洲国产欧美在线| 91官网在线观看| 亚洲综合色区另类av| 久久久午夜电影| 久久国产精品99久久人人澡| 91久久精品一区二区三|