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

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

?? usbkey.asm

?? Cypress 的(鼠標+鍵盤)復合設備匯編源程序
?? ASM
字號:
;========================================================================
;   FILE: usbkey.asm
;
;   This file contains the code that implements the usb-specific
;   routines to handle key scans.
;
;   REVISIONS:
;
;   02/2/99
;   rewrote usb_scan_keys, moved idle function into usbmain instead
;   12/28/98
;   removed RAM allocation for error code buffer to save space.
;   The error codes are now sent from a ROM table (see changes
;   to usbmain.asm)
;   11/9/98 modified to send bit-field for power, sleep, and wake
;   in accordance with latest PC98 specifications. This change
;   accompanies changes to the endpoint 2 descriptor and code
;   in usbmain to send the new usage.
;
;   modified scan codes for power, sleep, and wake keys to be old
;   style 0x66,0x67, and 0x68, respectively.  This passes the current
;   (August 98) Keyboard WHQL tests.
;
;========================================================================


;========================================================================
; Global Variables
;========================================================================



USB_KEY_BUFFER_SIZE:            EQU 8

; keyboard duplicate input report buffer (8 bytes)
; This buffer is sent to the host as a USB keyboard packet

usb_current_state:  		    equ (usbkey_ram_base + 0);storage for type of last report
                                                            ;(error report or key report)

usb_key_count:                  equ  (usbkey_ram_base + 1)        ; indicates number of keys pressed
usb_tx_required:                equ  (usbkey_ram_base + 2)        ; indicates a key(s) changed state
usb_power_id:                   equ  (usbkey_ram_base + 3)
usb_power_keys:			  equ  (usbkey_ram_base + 4)
usb_power_flag:                 equ  (usbkey_ram_base + 5)
usb_consumer_id:			  equ  (usbkey_ram_base + 6)
usb_consumer_keys:		  equ  (usbkey_ram_base + 7)
usb_consumer_flag:              equ  (usbkey_ram_base + 8)
usb_report_buffer:              equ  (usbkey_ram_base + 9)  
usb_last_mod:                   equ  usb_report_buffer         ; last modifier
USBKEY_RAM_SIZE:                equ   9 + USB_KEY_BUFFER_SIZE


USB_NO_REPORT:      equ 0
USB_REPORT_ERROR:   equ 1
USB_REPORT_KEY:     equ 2
;========================================================================
; FUNCTION:usb_scan_keys
;
;   This is the main entry point for the start of key scanning.
;   This function calls the key scanner, which will generate calls to
;   usbkey_putkey from the internal scanning loop of the key scanner.
;
;
;
;========================================================================
usbkey_scan_keys:
    call    ksc_scan_keys                           ; scan the keys
    jc      .send_error                             ; phantom situation,send error to host
	mov     A, [usb_key_count]                      ; are there more than 6 keys pressed?
	cmp     A, 7
	jnc    .send_error                              ; yes, then send error to host
    mov     A,0                                     ; no errors, clear the error byte
    mov     [usb_current_state],A                   ; and return
    jmp     .exit
                                                    
.send_error:                                     
 												
    mov     A,USB_REPORT_ERROR                      ; there's currently an error,
    mov     [usb_tx_required],A
    mov     [usb_current_state],A                   ; mark as such
.exit:
    ret



;========================================================================
; FUNCTION:usbkey_putkey 
;
;handles key presses in usb environment.
;
; This function is called from within the key scanning loop, each time a
; valid key event has been recognized.  A key event is defined as whenever 
; an individual key changes state, either up or down.  the key is 
; identified by a unique number in the accumulator  from 1 to XXX, 
; where XXX is GENERALLY the corresponding AT101 keyboard number, with
; few execptions (see at101.inc).
;========================================================================


usbkey_putkey:
    call    usb_power_key
    jc     .done_putkey

    call	usb_consumer_key
    jc	.done_putkey
    
    call    ksc_modifier                           ;check for a modifier
    jnc      .non_modifiers
 	mov		A, USB_REPORT_KEY                      ; show that a report is required
	mov		[usb_tx_required], A
    mov     A,[ksc_mod0]
    mov     [usb_last_mod],A
    jmp     .done_putkey

.non_modifiers:
    index   usb_usage_table
	push	X                                       ; save X on stack
	push	A                                       ; save key code on stack

	mov		A, USB_REPORT_KEY                       ; show that a report is required
	mov		[usb_tx_required], A

	mov		A, [ksc_down_up]
	cmp		A, 0
	jnz		.add_key_to_buffer				        ; key down
													; otherwise, key is up


.remove_key_from_buffer:                            ; key is up, so remove if from buffer
	mov		A, [usb_key_count]
	cmp		A, 0                                    ; decrement key count (unless it's 0)
	jz		.skip_decrement_key_count
	dec		[usb_key_count]
.skip_decrement_key_count:
	mov		X, 2
.find_key_in_buffer:                                ; find the key in the report buffer
	pop		A
	push	A
	cmp		A, [X + usb_report_buffer]
	jz		.clear_buffer_position
	inc		X
	mov		A, X
	cmp		A, 8
	jc		.find_key_in_buffer
	pop		A
	jmp		.non_modifiers_done                     ; done search

.clear_buffer_position:                             ; key found in buffer, so clear position
	pop		A
	mov		A, 0
	mov		[X + usb_report_buffer], A
	jmp		.non_modifiers_done

	
.add_key_to_buffer:                                 ; key went down, so put it in the buffer
	mov		A, [usb_key_count]
	cmp		A, FFh                                  ; increment key count (unless it's 255)
	jz		.skip_increment_key_count
	inc		[usb_key_count]
.skip_increment_key_count:
	mov		X, 2
.find_free_buffer_position:                         ; find a free buffer position
	mov		A, 0
	cmp		A, [X + usb_report_buffer]
	jz .put_key_in_buffer_position
	inc		X
	mov		A, X
	cmp		A, 8
	jc		.find_free_buffer_position
	pop		A
	jmp		.non_modifiers_done                     ; could not find a free position
						                            ; more than 6 keys pressed

.put_key_in_buffer_position:                        ; found a free buffer position, so put key code there
	pop		A
	mov		[X + usb_report_buffer], A

.non_modifiers_done:
	pop		X  

.done_putkey:
    ret  


    XPAGEOFF
power_key_table:
    db      AT101KB_POWER,AT101KB_SLEEP,AT101KB_WAKE
power_bit_table:
    db      1,2,4

consumer_key_table:
    db	AT101KB_VOL_INC, AT101KB_VOL_DEC, AT101KB_MUTE
consumer_bit_table:
    db	1,2,4

    XPAGEON

NUM_POWER_KEYS:    equ 3
NUM_CONSUMER_KEYS: equ 3

;========================================================================
; FUNCTION:usb_power_key 
;
;handles power, sleep, and wake key presses in usb environment.
;
; This function was invented to trap the power, sleep, and wake key presses
; and maintain a single byte whose format is as follows:
;
; bit 1:  1 = power key pressed
; bit 2:  1 = sleep key pressed
; bit 3   1 = wake key pressed
;
; if any of these three keys changes state, the corresponding bit in the
; bit field is modified and the usb_power_flag is set to indicate that the
; state of the power keys has changed.
;========================================================================


usb_power_key:

    push	X
    push    A
    mov		X,usb_power_keys

.lp0:
    mov     [ksc_work],A                            ;store key in work byte
    mov     A,(NUM_POWER_KEYS - 1)                   ;initialize A to number of power keys
.lp1:
    push    A                                       ;save index
    index   power_key_table                           ;get lookup
    cmp     A,[ksc_work]                            ;compare to key
    pop     A                                       ;restore index
    jz      .lp2                                    ;compare was a success, key found
    dec      A          
    jc      .non_modifier                           ;index < 0, non-power key
    jmp     .lp1

.lp2:
    index   power_bit_table                           ;now index into bit to set/clear
	push	A										; clear or set bit
	mov		A, [ksc_down_up]                      ; depending on if key went
	cmp		A, 00h                                  ; up or down
	pop		A                                       ; restore bit pattern
	jz		.mod0_up                                ; key went down
	or		[X + 0], A                              ; set bit
	jmp		.done_putkey
.mod0_up:									        ; else, key went up
	cpl                                             ; so clear bit
	and		[X + 0], A       
.done_putkey:                                       ;set carry indicating key found
    mov     A,0ffh
    mov     [usb_power_flag],A
    SETC    
.exit:
    pop     A                                       ;restore A,X
	pop		X
	ret

.non_modifier:                                      ;clear carry indicating no key found
    CLEARC                  
    jmp     .exit

    

usb_init_keyscan:
    CLEARRAM    usbkey_ram_base,USBKEY_RAM_SIZE
    mov A,POWER_REPORT_ID
    mov [usb_power_id],A
    mov A,CONSUMER_REPORT_ID
    mov [usb_consumer_id], A
    ret

;========================================================================
; FUNCTION:usb_consumer_key 
;
;handles volume inc, volume dec, and mute key presses in usb environment.
;
; This function was invented to trap the consumer key presses
; and maintain a single byte whose format is as follows:
;
; bit 1:  1 = volume inc key pressed
; bit 2:  1 = volume dec key pressed
; bit 3:   1 = mute key pressed
;
; if any of these three keys changes state, the corresponding bit in the
; bit field is modified and the usb_consumer_flag is set to indicate that the
; state of the consumer keys has changed.
;========================================================================

usb_consumer_key:

    push	X
    push    A

    mov		X,usb_consumer_keys

.lp0:
    mov     [ksc_work],A                            ;store key in work byte
    mov     A,(NUM_CONSUMER_KEYS - 1)                   ;initialize A to number of consumer keys
.lp1:
    push    A                                       ;save index
    index  consumer_key_table                           ;get lookup
    cmp     A,[ksc_work]                            ;compare to key
    pop     A                                       ;restore index
    jz      .lp2                                    ;compare was a success, key found
    dec      A          
    jc      .non_modifier                           ;index < 0, non-power key
    jmp     .lp1

.lp2:
    index   consumer_bit_table                           ;now index into bit to set/clear
	push	A										; clear or set bit
	mov		A, [ksc_down_up]                      ; depending on if key went
	cmp		A, 00h                                  ; up or down
	pop		A                                       ; restore bit pattern
	jz		.mod0_up                                ; key went down
	or		[X + 0], A                              ; set bit
	jmp		.done_putkey
.mod0_up:									        ; else, key went up

	cpl                                             ; so clear bit
	and		[X + 0], A       
.done_putkey:                                       ;set carry indicating key found
    mov     A,0ffh
    mov     [usb_consumer_flag],A
    SETC    
.exit:
    pop     A                                       ;restore A,X
	pop		X
	ret

.non_modifier:                                      ;clear carry indicating no key found
    CLEARC                  
    jmp     .exit

    
usb_init_keyscan2:
    CLEARRAM    usbkey_ram_base,USBKEY_RAM_SIZE
    mov A,CONSUMER_REPORT_ID
    mov [usb_consumer_id],A
    ret

    XPAGEOFF

usb_usage_table:
	db			000h,035h,01eh,01fh,020h,021h,022h,023h	;0-7
	db			024h,025h,026h,027h,02dh,02eh,000h,02ah	;8-15
	db			02bh,014h,01ah,008h,015h,017h,01ch,018h	;16-23
	db			00ch,012h,013h,2fh,030h,031h,039h,004h	;24-31
	db			016h,007h,009h,00ah,00bh,00dh,00eh,00fh ;32-39
	db			033h,034h,032h,028h,0e1h,064h,01dh,01bh	;40-47
	db			006h,019h,005h,011h,010h,036h,037h,038h	;48-55
	db			000h,0e5h,0e0h,000h,0e2h,02ch,0e6h,000h	;56-63
	db			0e4h,000h,000h,000h,000h,000h,000h,000h ;64-71
	db			000h,000h,000h,049h,04ch,000h,000h,050h ;72-79
	db			04ah,04dh,000h,052h,051h,04bh,04eh,000h	;80-87
	db			000h,04fh,053h,05fh,05ch,059h,000h,054h	;88-95
	db			060h,05dh,05ah,062h,055h,061h,05eh,05bh	;96-103
	db			063h,056h,057h,000h,058h,000h,029h,000h	;104-111
	db			03ah,03bh,03ch,03dh,03eh,03fh,040h,041h	;112-119
	db			042h,043h,044h,045h,046h,047h,048h,0e3h	;120-127
	db			0e7h,065h,066h,067h,068h,000h,000h,000h	;128-235

    XPAGEON

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品嫩草影院av蜜臀| 蜜桃在线一区二区三区| 色呦呦日韩精品| 亚洲卡通动漫在线| 欧美综合欧美视频| 午夜久久电影网| 三级久久三级久久久| 激情文学综合丁香| 国产一区二区三区视频在线播放| 国产99久久久国产精品潘金网站| 蜜臀av一区二区在线观看 | 91在线视频官网| 国产成人午夜99999| 久久精品久久99精品久久| 国产精品一卡二| 欧美中文一区二区三区| 久久久久国产成人精品亚洲午夜| 久久这里只有精品首页| 亚洲一区国产视频| 国产揄拍国内精品对白| 色婷婷久久综合| 国产亚洲va综合人人澡精品| 天天av天天翘天天综合网| 99视频有精品| 亚洲欧美自拍偷拍| 国产精品乱码一区二区三区软件 | 亚洲午夜一二三区视频| 国产ts人妖一区二区| 91精品国产欧美一区二区18 | 成人免费视频免费观看| 欧美韩国日本不卡| 综合婷婷亚洲小说| 国产精品一区一区| 久久久久久久久久看片| 免费成人在线观看视频| 91麻豆精品国产自产在线| 性久久久久久久久久久久| 91精品久久久久久蜜臀| 蜜桃久久久久久| 久久久久久亚洲综合| 色老汉一区二区三区| 337p亚洲精品色噜噜噜| 亚洲午夜久久久久久久久久久 | 26uuu精品一区二区三区四区在线| 亚洲成人免费在线| xf在线a精品一区二区视频网站| 老司机精品视频在线| 国产亚洲精品aa午夜观看| 91丨porny丨国产入口| 丝袜亚洲精品中文字幕一区| 国产一区二区三区免费播放| 精品日韩av一区二区| 亚洲人成在线观看一区二区| 精品在线观看免费| 日韩欧美国产1| 在线观看欧美日本| 国产精品资源网站| 国产三级精品三级| 色综合久久久久| 成人国产亚洲欧美成人综合网| 极品少妇一区二区三区精品视频 | 亚洲一区电影777| 久久这里只有精品6| 精品第一国产综合精品aⅴ| 欧美一卡二卡三卡四卡| 欧美日韩高清一区二区不卡| 欧洲中文字幕精品| 色综合天天综合狠狠| 成人小视频免费在线观看| 视频精品一区二区| 久久精品男人的天堂| 91精品欧美综合在线观看最新| 91视频一区二区| 国产69精品久久777的优势| 国产精品亚洲第一区在线暖暖韩国| 国产成人鲁色资源国产91色综 | 欧美视频日韩视频| 国产成人自拍高清视频在线免费播放| 亚洲精品va在线观看| 久久综合九色综合97_久久久| 91一区二区在线观看| www.色综合.com| caoporn国产精品| 成人午夜私人影院| 99精品国产99久久久久久白柏| 91免费精品国自产拍在线不卡| 99视频一区二区| 正在播放一区二区| 久久久久国产成人精品亚洲午夜| 欧美国产成人在线| 亚洲国产毛片aaaaa无费看 | 国产a精品视频| 成人永久免费视频| 男女男精品网站| 成人免费视频视频在线观看免费 | 免费成人av在线| 99re成人在线| 日韩一区二区高清| 欧美一区二区视频在线观看2020| 国产日韩视频一区二区三区| ㊣最新国产の精品bt伙计久久| 午夜日韩在线电影| 福利一区二区在线观看| 欧美一级免费大片| 国产精品区一区二区三| 久久精品久久精品| 在线看日韩精品电影| 国产女主播在线一区二区| 免费的国产精品| 欧美一区午夜视频在线观看| 亚洲美女精品一区| 91免费视频观看| 国产精品久久精品日日| 国内精品伊人久久久久影院对白| 欧美主播一区二区三区美女| 日韩成人午夜精品| 欧美激情一区二区三区在线| 91在线视频18| 国产一区二区在线观看视频| 亚洲精品一区二区三区精华液| 国产一区免费电影| 亚洲精品综合在线| 日韩一级免费一区| 成人精品高清在线| 日本系列欧美系列| 一区在线中文字幕| 精品电影一区二区| 精品污污网站免费看| 成人小视频在线观看| 蜜桃一区二区三区四区| 亚洲美女在线一区| 国产精品色在线观看| 99精品国产91久久久久久| 日韩一区精品字幕| 国产精品人人做人人爽人人添| 在线亚洲精品福利网址导航| 性久久久久久久久久久久| 国产精品情趣视频| 欧美男同性恋视频网站| 不卡的av电影在线观看| 午夜精品国产更新| 国产精品久久久久aaaa樱花 | 国产精品女人毛片| 欧美一区二区三区不卡| 久久久精品国产免费观看同学| 一本久久综合亚洲鲁鲁五月天| 国产精品66部| 国产91精品一区二区麻豆亚洲| 石原莉奈一区二区三区在线观看| 亚洲自拍偷拍综合| 91日韩在线专区| 日韩不卡手机在线v区| 26uuu亚洲综合色| 一本久久精品一区二区| 久久精品国产精品青草| 亚洲欧洲日韩女同| 2014亚洲片线观看视频免费| 欧美在线不卡视频| 国产精品一区2区| 蜜桃视频一区二区| 亚洲午夜激情av| 亚洲欧美怡红院| 国产性天天综合网| 精品国产乱码久久久久久图片| 欧美在线你懂的| 91蝌蚪porny| 色哦色哦哦色天天综合| 成人午夜视频在线观看| 高清免费成人av| 国产精品一品视频| 东方aⅴ免费观看久久av| 国产综合色产在线精品| 人人爽香蕉精品| 日本午夜精品视频在线观看| 亚洲一区二区3| 亚洲444eee在线观看| 日韩影院免费视频| 免费av成人在线| 国产精品一区二区三区四区| 高清在线成人网| 91视频免费看| 欧美一级日韩不卡播放免费| 91精品国产欧美一区二区18 | 日韩高清在线不卡| 精品一区在线看| 处破女av一区二区| 91丨porny丨户外露出| 91 com成人网| 国产欧美一区视频| 午夜精品久久久久久久久久| 青青草国产成人99久久| 国产精品中文字幕欧美| 色94色欧美sute亚洲线路一久 | 亚洲午夜电影网| 韩国av一区二区| 欧美日韩视频在线第一区| 精品久久久影院| 亚洲va国产天堂va久久en| 国产成人av电影在线| 91.com在线观看|