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

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

?? ps2main.asm

?? 該程序為USB HUB程序
?? 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.
;
;6/16/99 alpha bug repairs
;
;========================================================================


       XPAGEON
                     
;========================================================================
; FUNCTION: ps2_do_command
;
; host command processor switch statement
;
; Returns: nothing
;========================================================================
ps2_do_command:
	call	ps2_xmt_flush			;new command cancels any pending transmission

   cmp		A,0f3h								;check for possible id command sequence
   jz		ps2_start_command
   push		A									;not part of id sequence,
   mov     		A,ID_TABLE_LEN-1						;reset id sequence state variable
   mov		[ps2_id_state],A
   pop		A


ps2_start_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
   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_invalid_command
    jmp    ps2_invalid_command
    jmp    ps2_invalid_command
    jmp    ps2_invalid_command
    jmp    ps2_invalid_command
    jmp    ps2_invalid_command
    jmp    ps2_invalid_command
    jmp    ps2_resend
    jmp    ps2_reset

XPAGEON
    
endswitch:
    ret
;-------------------------------------------------------------------------
; PS2 Initialization ( BAT, FLAG, ... )
;-------------------------------------------------------------------------

PS2_Init:
;   PUSH    A

	MOV     A, [p3_shadow]
;	OR      A, (PS2_CONNECT+PS2_CLOCK_BIT+PS2_DATA_BIT)  ;Keep PS2_CONNECT and PS2_CLOCK high
	AND     A, ~(PS2_DATA_BIT)
	MOV     [p3_shadow], A
	iowr    PS2_PORT          
	
    ;clear variables local to this module

    mov     A,0
    mov     [dual_ifc_1ms],A

    mov   	A,ID_TABLE_LEN-1			    ;reset id sequence state variable
    mov	    [ps2_id_state],A
    call    ksc_init_keyscan                ;initialize the key scanner
    call    ps2key_init                     ;and ps2-specific key scanning routines        

	mov     A,PS2_KEYBOARD
	mov     [dual_ifc_keyboard],A

    ; PS2 BAT
    DI
    
    mov     A,178
    mov     [ps2_delay],A                       ;set up BAT timeout to 356 msec
                                                ;(contents of ps2_delay * 2)
    EI                                                
    call    ps2_BAT                             ;test the system
	call	ps2_put_byte			            ;queue BAT result for transmission
    SETBIT  PS2_SCAN_KBD,ps2_flags              ;enable scanning
    mov     A,PS2_SCAN_INTERVAL                 ;initialize scan timer
    mov     [ps2_scan_timeout],A
	mov	    A,PS2_SEND_INTERVAL		            ;init transmission timer
	mov	    [ps2_send_timeout],a
;	POP     A
	RET
	

;========================================================================
; 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                   ;operate the transmitter if necessary
    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     PS2_PORT							    ;if host inhibit condition,           
   and      A,PS2_CLOCK_BIT                      
   jz       .no                                     ;skip this whole operation

   iord     PS2_PORT                                ;if no start bit
   and      A,PS2_DATA_BIT                          ;skip too
   jnz      .no                                 

   iord     PS2_PORT                  ;check for inhibit again
   and      A,PS2_CLOCK_BIT
   jz       .no

    call	ps2_xmt_flush		;received byte flushes xmit buffer

IFDEF   CombiKB
    DI
ENDIF
   call     ps2_receive                             ;receive a byte
IFDEF   CombiKB
    EI
ENDIF

   jc       .no1                                    ;branch on receive error
   SETC                                             ;else, set carry and exit
   ret

.no1:		;something went awry - request a resend
	mov	A,PS2_RSND			;queue a resend
	call	ps2_put_byte
.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:
;   iowr WATCHDOG_REG
	TSTBIT	PS2_1MS,ps2_flags		;1mS tick?
	jz	.pi2					;branch if not

;* service 1mS tick counters
	CLRBIT	PS2_1MS,ps2_flags		;else, clear it
	dec	[ps2_scan_timeout]		;decrement scan time counter
	jnc	.pi1					;branch if not underflow
	inc	[ps2_scan_timeout]		;don't let it underflow
.pi1:	dec	[ps2_send_timeout]		;decrement key send timer
	jnc	.pi2					;branch if no underflow
	inc	[ps2_send_timeout]		;don't let it underflow

.pi2:
   call     ps2_send_byte                            ;send anything that may be queued

       ret                                     ;that is it



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

ps2_invalid_command:
	mov	    A,PS2_RSND				;ask for a resend
	call	ps2_put_byte
    ret



;========================================================================
; 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
.ed00:
    call    ps2_wait_byte               ;wait for 2nd byte
    cmp     A,0EDh                      ;is it another command?
    jnc     ps2_start_command           ;yes, go process it
    cmp     A,8                         ;if 2nd byte invalid
    jc      .ed0 
    call    ps2_invalid_command         ;tell the host and
    jmp     .ed00                       ;wait for another try    

.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
    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
    jmp     endswitch

;========================================================================
;   FUNCTION: ps2_select_alternate_scan_code
;
; Returns:
;
;   C: 0 if command was sucessful
;   C: 1 if command failed 
;========================================================================

ps2_select_alternate_scan_code:
    call    ps2_ack_byte                        ;ack this byte
.sas00:
    call    ps2_wait_byte                       ;wait for alternate code byte
    cmp     A,0EDh                              ;is it another command?
    jnc      ps2_start_command                   ;yes, go process it
    cmp     A,3                                 ;if not out of range
    jc      .sas0                               ;keep going
    call    ps2_invalid_command                 ;else tell the host and
    jmp     .sas00                              ;wait for another try    
.sas0:
    call    ps2key_clear_key_buffer             ;clear out buffer and stop any typematic stuff       
    call    ps2key_disable_typematic_action
    or      A,0                                 ;else if 1-2
    jz      .send                                                     
    mov     [ps2key_scan_set],A                 ;  save it
    call    ps2_ack_byte                        ;  ack the byte
    jmp     .exit
.send:                                          ;else, a 0 indicates to send back current scan set
    call    ps2_ack_byte                        ;ack the byte
    mov     A,[ps2key_scan_set]                 ;return current scan set 
    call       ps2_put_byte
.exit:
    jmp     endswitch

;========================================================================
; FUNCTION: ps2_read_id
;
;
; Returns:
;   C: 0, command can't fail
;========================================================================


ps2_read_id:
    call    ps2_ack_byte                        ;ack the byte

    mov     A,0abh                              ;respond with hard coded id bytes
    call    ps2_put_byte                     
    mov     A,83h
    call    ps2_put_byte
    ;special case! wait for both of these bytes to be sent.
.loop:
    call    ps2_idle_loop
    TSTBIT  PS2_XMIT,ps2_flags                  ;wait for these to go out
    jnz     .loop
    call     ps2key_clear_key_buffer             ;clear the key buffer
    SETBIT   PS2_SCAN_KBD,ps2_flags              ;enable scanning
.exit:
    jmp     endswitch

;========================================================================
; FUNCTION: ps2_set_typematic_rate_delay
;
; sets the global typematic rate and delay settings.
; this routine uses 2 lookups to convert the values sent by the host,
; into the proper 4ms counts that will be used to achieve the rate and delay
; functions.  the rate table was derived from an excel spreadsheet rate.xls;
; the shorter delay table was derived by hand
;
; Returns:
;
;   C: 0 if command was sucessful
;   C: 1 if command failed 
;
;========================================================================
XPAGEOFF
ps2_typematic_rate_table:                   ;table of 4ms counts to achieve rate

    db      8,9,10,11,14,14,15,16
    db      17,19,21,23,25,27,29,31
    db      33,38,42,46,50,54,58,63
    db      67,75,83,92,100,108,117,125

ps2_typematic_delay_table:                  ;table of 4ms counts to achieve delay
    db      62,125,187,250
XPAGEON

ps2_set_typematic_rate_delay:
    call    ps2_ack_byte						;ack the byte
.strd0:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜免费视频| 久久久久久日产精品| 99久久久免费精品国产一区二区| 热久久久久久久| 91精品国产色综合久久不卡蜜臀| 亚洲欧洲成人自拍| 亚洲一线二线三线久久久| 中文字幕乱码日本亚洲一区二区| 久久久久久综合| 日韩免费高清av| 国产激情精品久久久第一区二区| 91女人视频在线观看| 亚洲欧洲在线观看av| 日韩欧美久久久| 亚洲欧美韩国综合色| 国产一区二区在线观看免费| 色综合天天综合| 久久伊人蜜桃av一区二区| 日韩激情一区二区| 欧美日韩中文字幕一区二区| 亚洲日穴在线视频| 成人性色生活片| 精品区一区二区| 老鸭窝一区二区久久精品| 欧美浪妇xxxx高跟鞋交| 一区二区视频在线看| 91在线视频播放地址| 国产精品国产三级国产aⅴ原创 | 日本午夜一区二区| 色噜噜夜夜夜综合网| **欧美大码日韩| 成人妖精视频yjsp地址| 国产精品福利在线播放| 国产suv精品一区二区6| 国产精品久久久久久户外露出 | 亚洲精品视频在线观看网站| 不卡在线视频中文字幕| 中文字幕一区av| 91麻豆高清视频| 午夜视频久久久久久| 宅男在线国产精品| 久久精品99国产国产精| 久久久不卡影院| 不卡的看片网站| 夜色激情一区二区| 日韩一区二区免费高清| 激情欧美一区二区三区在线观看| 国产欧美中文在线| 色呦呦网站一区| 视频一区二区不卡| 久久久综合精品| 91在线观看高清| 五月天激情综合| 26uuu亚洲综合色| 91免费视频观看| 日韩黄色小视频| 国产蜜臀97一区二区三区| 91丨九色丨黑人外教| 爽好多水快深点欧美视频| 精品久久久三级丝袜| 色综合天天综合网国产成人综合天| 亚洲一区二区五区| 久久精品视频在线看| 在线免费观看日韩欧美| 精品影视av免费| 亚洲免费在线看| 日韩精品一区二区三区视频播放 | 色婷婷久久综合| 日av在线不卡| 中文字幕一区二区视频| 欧美精品乱码久久久久久按摩| 激情欧美日韩一区二区| 一区二区三区蜜桃| 久久精品人人爽人人爽| 欧美三级乱人伦电影| 成人免费观看男女羞羞视频| 日韩av网站在线观看| 亚洲欧美综合色| 久久品道一品道久久精品| 欧美性色黄大片| 不卡区在线中文字幕| 精品中文字幕一区二区小辣椒| 国产精品国产三级国产a| 精品久久久久久久久久久久久久久久久 | 偷窥少妇高潮呻吟av久久免费| 国产亚洲成年网址在线观看| 欧美精品自拍偷拍动漫精品| 成人一区在线看| 狠狠色丁香久久婷婷综| 天堂午夜影视日韩欧美一区二区| 国产精品美女一区二区三区| 日韩欧美中文字幕一区| 精品视频免费看| 91九色02白丝porn| av电影天堂一区二区在线| 精品亚洲成a人在线观看| 亚洲成人在线网站| 亚洲四区在线观看| 欧美国产欧美综合| 久久影院午夜片一区| 91精品在线一区二区| 欧美亚洲国产bt| 91久久人澡人人添人人爽欧美 | 樱花草国产18久久久久| 欧美国产97人人爽人人喊| 久久一夜天堂av一区二区三区| 欧美一区午夜视频在线观看| 欧美日韩另类一区| 欧美怡红院视频| 欧美性色aⅴ视频一区日韩精品| 色综合一个色综合亚洲| 99久久99久久久精品齐齐| aa级大片欧美| 色综合视频一区二区三区高清| 97精品电影院| 欧美在线制服丝袜| 911精品国产一区二区在线| 91精品国产综合久久久久久久| 欧美四级电影在线观看| 在线成人av影院| 精品久久久久久久人人人人传媒| 精品免费视频一区二区| 国产亚洲一区二区三区四区| 欧美高清一级片在线观看| 亚洲欧洲日本在线| 亚洲午夜激情av| 人人狠狠综合久久亚洲| 国产精品一区二区在线播放 | 国产伦精一区二区三区| 国产成人av一区二区三区在线观看| 国产不卡在线视频| 91亚洲精品久久久蜜桃| 欧美日韩视频一区二区| 欧美大胆一级视频| 国产精品久久久久精k8| 亚洲国产精品麻豆| 国产一区二区三区久久悠悠色av | 91精品国产入口| 26uuu色噜噜精品一区二区| 欧美激情一区二区三区全黄| 亚洲最新在线观看| 麻豆精品精品国产自在97香蕉| 国产成人免费视| 欧美日韩中文国产| 久久精品人人做人人综合| 一区二区三区四区激情| 国产一区日韩二区欧美三区| 91在线观看地址| 欧美成人国产一区二区| 成人欧美一区二区三区白人| 日韩电影在线一区| 成人教育av在线| 777久久久精品| 中文字幕一区二区三区蜜月 | 欧美成人午夜电影| 综合久久久久久久| 久热成人在线视频| 色偷偷久久人人79超碰人人澡| 欧美一区二区三区精品| 亚洲欧美国产毛片在线| 国内精品久久久久影院一蜜桃| 色94色欧美sute亚洲13| 久久精品夜色噜噜亚洲a∨| 午夜精品爽啪视频| av网站一区二区三区| 久久综合九色综合欧美就去吻| 一区二区三区四区国产精品| 国产+成+人+亚洲欧洲自线| 91 com成人网| 亚洲黄色在线视频| 高清免费成人av| 日韩写真欧美这视频| 亚洲男人的天堂在线aⅴ视频| 国产一区二区视频在线播放| 在线电影院国产精品| 亚洲综合在线免费观看| 粉嫩嫩av羞羞动漫久久久 | 91精品国产一区二区人妖| 1区2区3区国产精品| 国产伦理精品不卡| 久久综合成人精品亚洲另类欧美| 亚洲午夜精品17c| 色天使久久综合网天天| 国产精品麻豆视频| 国产99久久久精品| 国产亚洲欧美一级| 国产精品69久久久久水密桃| 精品裸体舞一区二区三区| 另类小说一区二区三区| 欧美日韩激情在线| 亚洲国产va精品久久久不卡综合| 色婷婷av一区二区三区之一色屋| 中文一区二区在线观看| 国产jizzjizz一区二区| 欧美国产精品一区二区三区| 国产精品影视天天线| 国产亚洲欧美一级| 成人免费观看av| 亚洲三级免费电影| 欧美最猛性xxxxx直播|