亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
免费成人在线影院| 欧美二区在线观看| 337p亚洲精品色噜噜| 国产视频一区在线播放| 亚洲电影一级黄| 丰满白嫩尤物一区二区| 欧美一卡在线观看| 亚洲一区日韩精品中文字幕| 国产剧情一区二区三区| 欧美精品一卡两卡| 亚洲人吸女人奶水| 国产成人免费视| 欧美成人精品二区三区99精品| 玉米视频成人免费看| 懂色av噜噜一区二区三区av| 日韩欧美激情在线| 天堂影院一区二区| 欧美视频在线观看一区| 亚洲人成网站色在线观看| 国产精品一区三区| 337p粉嫩大胆噜噜噜噜噜91av| 香蕉成人啪国产精品视频综合网| 91美女精品福利| 国产精品久久二区二区| 国产不卡视频在线播放| 欧美zozozo| 捆绑调教美女网站视频一区| 欧美剧在线免费观看网站| 亚洲免费三区一区二区| 99久久久无码国产精品| 中文字幕亚洲精品在线观看| 成熟亚洲日本毛茸茸凸凹| 久久久久久毛片| 国产成人午夜电影网| 精品国产一区二区三区不卡| 久久国产精品色婷婷| 精品欧美黑人一区二区三区| 久久国产三级精品| 久久综合久久鬼色| 高清在线不卡av| 国产精品国产自产拍高清av| 成人性生交大片免费看中文| 国产精品夫妻自拍| 一本一道久久a久久精品| 亚洲精品久久久久久国产精华液| 91在线丨porny丨国产| 一区二区三区四区亚洲| 欧美色电影在线| 蜜桃av一区二区三区电影| 精品国产一区二区三区久久影院 | 日韩三级.com| 老司机免费视频一区二区| www国产成人免费观看视频 深夜成人网| 麻豆精品国产91久久久久久| 久久久久国产免费免费| a美女胸又www黄视频久久| 亚洲欧美偷拍另类a∨色屁股| 欧美亚洲综合另类| 美脚の诱脚舐め脚责91| 久久久青草青青国产亚洲免观| 成人app网站| 五月天久久比比资源色| 精品国产污污免费网站入口 | 国产一区免费电影| 中文字幕一区二区三区蜜月 | 在线91免费看| 国产精品一二三在| 夜夜夜精品看看| 精品国产伦理网| 99精品热视频| 免费的成人av| 亚洲啪啪综合av一区二区三区| 欧美剧在线免费观看网站| 国产露脸91国语对白| 亚洲一二三区视频在线观看| 久久久五月婷婷| 欧美日韩一区二区欧美激情| 国产一区二区三区最好精华液| 亚洲精品久久久蜜桃| www精品美女久久久tv| 欧美探花视频资源| 国产成人精品影视| 日本中文字幕一区二区视频| 国产精品午夜春色av| 欧美一级在线观看| 91国偷自产一区二区使用方法| 国产一区不卡视频| 午夜精品123| 最新高清无码专区| 国产日韩欧美精品在线| 制服丝袜亚洲色图| 91在线精品秘密一区二区| 激情综合网激情| 日韩精品电影在线| 亚洲免费在线视频一区 二区| 国产亚洲一区二区三区四区 | 91精品国产品国语在线不卡| 成人黄色小视频| 国产一区二区三区久久久| 亚洲成a人片在线观看中文| 亚洲欧美怡红院| 久久精品综合网| 2021中文字幕一区亚洲| 欧美一级日韩一级| 欧美日韩国产精品自在自线| 91免费观看国产| 色综合久久久久综合体| av中文一区二区三区| 成人丝袜18视频在线观看| 国产精品中文字幕日韩精品| 黑人巨大精品欧美黑白配亚洲| 免费美女久久99| 日韩电影网1区2区| 日本伊人精品一区二区三区观看方式| 一区二区三区欧美日韩| 亚洲激情在线播放| 亚洲免费观看高清在线观看| 中文字幕一区三区| 中文字幕一区二区三区不卡在线| 欧美国产97人人爽人人喊| 久久久久九九视频| 国产精品沙发午睡系列990531| 久久这里只有精品首页| 久久久电影一区二区三区| 久久精品在线观看| 国产精品久久久久天堂| 国产精品电影一区二区| 亚洲欧美日韩成人高清在线一区| 亚洲欧美成人一区二区三区| 亚洲一区在线电影| 日本在线不卡一区| 极品少妇xxxx精品少妇偷拍| 国产精品18久久久久久久网站| 国产成人激情av| 91香蕉视频mp4| 在线视频欧美精品| 91精品久久久久久久99蜜桃| 久久久亚洲高清| 国产精品久久福利| 丝袜诱惑制服诱惑色一区在线观看| 日韩成人av影视| 国产福利精品导航| 色爱区综合激月婷婷| 欧美日韩色一区| 久久先锋资源网| 亚洲精品v日韩精品| 日本不卡的三区四区五区| 国内精品免费在线观看| 97精品久久久午夜一区二区三区| 国产精品国产成人国产三级| 亚洲成人tv网| 国产成人亚洲综合a∨猫咪| 在线一区二区三区四区五区 | 日韩成人一区二区| 国产福利一区二区三区视频在线| 一本色道久久加勒比精品| 69成人精品免费视频| 国产精品毛片无遮挡高清| 亚洲成人资源在线| 大尺度一区二区| 日韩一区和二区| 中文字幕一区二区日韩精品绯色| 日韩av网站免费在线| av高清久久久| 精品久久久久久久一区二区蜜臀| 亚洲欧美日韩久久| 国产精品一区二区在线播放| 在线精品亚洲一区二区不卡| 久久综合久色欧美综合狠狠| 亚洲国产视频在线| 成人黄色电影在线 | 日韩电影在线观看一区| 不卡视频在线观看| 性做久久久久久久久| 成人中文字幕合集| 欧美大胆人体bbbb| 亚洲国产一二三| 91丝袜高跟美女视频| 久久久精品国产免大香伊| 日韩av电影免费观看高清完整版| aaa欧美大片| 国产网红主播福利一区二区| 麻豆一区二区99久久久久| 一本一道综合狠狠老| 亚洲欧美中日韩| 成人99免费视频| 国产欧美一区二区三区网站 | 国产精品久久久久四虎| 激情五月播播久久久精品| 欧美肥妇bbw| 亚洲无线码一区二区三区| 色欧美乱欧美15图片| 中文字幕在线不卡| 国产大陆亚洲精品国产| 久久久久青草大香线综合精品| 蜜臀av性久久久久蜜臀aⅴ流畅 | 色综合久久综合网97色综合| 紧缚捆绑精品一区二区| 日韩美女一区二区三区| 免费高清视频精品|