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

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

?? kbscan.asm

?? 該程序為USB HUB程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
ones_table:
    db 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4
XPAGEON

count_ones:
    push    A							;save ACC
    and     A,0fh						;isolate low nibble
    index   ones_table					;get number of 1's in it
    mov     [ksc_work],A				;save temporarily
    pop     A							;get acc back
    asr     A
    asr     A
    asr     A
    asr     A
    and     A,0fh						;isolate high nibble
    index   ones_table					;get number of 1's in it
    add     A,[ksc_work]				;add two totals
    ret									;and bug out

;phantom key detection routine.  

check_phantom:
	mov	A,[ksc_row_hits]			;tally the number of 1's in ksc_row_hits (Nr) 
    call count_ones
	cmp A,[ksc_col_hits]			;Get the larger of this and Nc
	jnc .skip						;numbers into the ACC
	mov A,[ksc_col_hits]
.skip:
	cmp A,[ksc_key_count]			;if MAX (Nc,Nr) >= Nk, where Nk = number of total keys pressed
	jnc .exit  						;there is no phantom key
	mov A,1
	mov [ksc_phantom],A				
.exit:
    ret

;========================================================================
; Test debounce fifo to see if matrix address is still in it.
; If not, exit with zero flag set
;========================================================================
ksc_Debounce_test:
	push X                              ; save X
	mov X, DEBOUNCE_ARRAY_SIZE          ; initialize  
.db_loop:
	cmp A, [X + ksc_db_keys - 1]        ; test if matrix address is in the debounce array
	jz .db_exit                         ; loop until found
	dec X
	jnz .db_loop                        ; or complete fifo tested
	cmp A, 0FFh                         ; clear zero flag to show it is not here
.db_exit:
	pop X					            ; restore X
	ret

;========================================================================
; Put matrix address in A onto debounce ARRAY
;========================================================================
ksc_Debounce_keys:
	push X					            ; save X and A
	push A
	mov X, DEBOUNCE_ARRAY_SIZE          ; point to the 6th location in the array

.find_free_debounce_location:
	mov A, [X + ksc_db_keys - 1]        ; check if is a free position
	cmp A, 0FFh
	jz .start_key_debounce
	dec X
	jnz .find_free_debounce_location
    jmp .db_keys_end                  ; if all 6 location are already loaded
						                ; with a key the 7th key will ignore
.start_key_debounce:
	mov A, [ksc_matrix_addr]            ; store the key in the array
	mov [X + ksc_db_keys - 1], A         
	mov A, [ksc_down_up]              ; check if key went up or down
	cmp A, 00h              
	jz  .debounce_key_release           ;key up (release) 
    mov A, DEBOUNCE_PRESS_TIME        ;key down (press), the time constant for 
    mov [X + ksc_db_counts - 1], A    ;key press debounce is loaded 
    jmp .db_keys_end

.debounce_key_release: 
    mov A, DEBOUNCE_RELEASE_TIME      ;the time constant for 
    mov [X + ksc_db_counts - 1], A    ;key release debounce is loaded 
 
.db_keys_end:
	pop A						        ; restore A
	pop X                               ; restore X
	ret                             

;========================================================================
; Decrement the time constant in the counter ARRAY
;========================================================================
ksc_Debounce_Task:
	push X							    ; save X and A
	push A
	mov X, DEBOUNCE_ARRAY_SIZE          ;load array size

.debounce_check:
    mov A, [X + ksc_db_keys - 1]      ;check if is a free location
	cmp A, 0FFh                         ;if yes process another location
	jz  .next_value_process
	mov A, [X + ksc_db_counts - 1]      ;decrement the right counter in
	dec A                               ;the array
	mov [X + ksc_db_counts - 1], A      ;if the value is different from 0
	jnz .next_value_process             ;process another location in the array
	mov A, 0FFh                         ;if 0 (time expired) load 0FFh 
	mov [X + ksc_db_keys - 1] ,A        ;(free position)

.next_value_process:
	dec X								; decrement position
	jnz .debounce_check			        ;check this new position (if not 0)
	pop A								; restore A and X
	pop X
	ret

    XPAGEOFF
mod_key_table:
    db      AT101KB_LEFTCTRL,AT101KB_LEFTSHIFT
    db      AT101KB_LEFTALT,AT101KB_LEFTGUI
    db      AT101KB_RIGHTCTRL,AT101KB_RIGHTSHIFT
    db      AT101KB_RIGHTALT,AT101KB_RIGHTGUI
;   db      AT101KB_APPLICATION
mod_bit_table:
    db      LEFT_CTRL_BIT,LEFT_SHIFT_BIT
    db      LEFT_ALT_BIT,LEFT_GUI_BIT
    db      RIGHT_CTRL_BIT,RIGHT_SHIFT_BIT
    db      RIGHT_ALT_BIT,RIGHT_GUI_BIT
;   db      APP_BIT

    XPAGEON

;currently we are not counting the application key as a modifier key.
;so there are only 8 modifiers.
NUM_MODIFIERS: equ 8


ksc_modifier:

	push	X
    push    A
	
    mov		X,ksc_mod0                            ;point X at mod0


    ;removed, not currently considering the application key as a modifier
    ;cmp     A,AT101KB_APPLICATION                   ;if app key
    ;jnz     .lp0
    ;mov     X,ksc_mod1                            ;point at mod1
.lp0:
    mov     [ksc_work],A                            ;store key in work byte
    mov     A,(NUM_MODIFIERS - 1)                   ;initialize A to number of modifiers
.lp1:
    push    A                                       ;save index
    index   mod_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-modifier
    jmp     .lp1

.lp2:
    index   mod_bit_table                           ;now index into bit to set/clear
	push	A										; clear or set modifier 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                                ; modifier key went down
	or		[X + 0], A                              ; set bit
	jmp		.done_putkey
.mod0_up:									        ; else, modifier key went up
	cpl                                             ; so clear bit
	and		[X + 0], A       
.done_putkey:                                       ;set carry indicating modifier found
    SETC    
.exit:
    pop     A                                       ;restore A,X
	pop		X
	ret

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


ksc_init_ports:
	mov A, 0ffh                         ; load all ones into accumulator
	iowr  PORT0_DATA_REG                     ; initialize port 0
	mov [ksc_p0out], A               ; save data written to port 0
	iowr  PORT1_DATA_REG                 ; initialize port 1
	mov [ksc_p1out], A               ; save data written to port 1
	iowr  PORT2_DATA_REG                     ; initialize port 2
    mov     A,[ksc_p3out]
IFDEF   PS2KB
    or      A,(P3_LED_MASK+PS2_CONNECT+PS2_CLOCK_BIT+PS2_DATA_BIT)
ELSE
    or      A,P3_LED_MASK
ENDIF    
	mov [ksc_p3out], A               ; save data written to port 3
	iowr PORT3_DATA_REG                     ; initialize port 3
    ret




ksc_init_keyscan:

; initialize variables
    mov     A,[ksc_p3out]           ;this variable is the shadow of port 3's contents
                                    ;it is actually initialized on power-up to 0xff, then
                                    ;modified by hub code before this routine is called.
                                    ;it will be overwritten by the call to clear ram
                                    ;below, but we want to save it and restore it
                                    ;after the clear.  It is the only crucial RAM location.
    push    A ;save shadow of P3
    CLEARRAM    ksc_ram_base,KSC_RAM_SIZE
    pop A
    mov     [ksc_p3out],A
    call        ksc_init_ports

	mov X, DEBOUNCE_ARRAY_SIZE          ; clear debounce_array 
	mov A, FFh                          ; FFh is an illegal 
						                ; index into key_code_table
.clear_debounce_array:
	mov [X + ksc_db_keys - 1], A
	dec X
	jnz .clear_debounce_array
      
    ret


ksc_writeLED:
    push  A
    mov A,[ksc_p3out]
	and A, ~(P3_LED_MASK+80h)           ; Not to make b7 as "1"
    ;	
    mov [ksc_p3out],A
    pop A
    cpl A
    and A,P3_LED_MASK
    or A,[ksc_p3out]
    mov [ksc_p3out],a
	iowr PORT3_DATA_REG
    ret


;ksc_restore_ports:
;	mov A, [ksc_p0out]                   ; restore column ports to pre-suspend values
;	iowr  PORT0_DATA_REG
;	mov A, [ksc_p1out]
;	iowr PORT1_DATA_REG
;	mov A, [ksc_p3out]                
;	iowr PORT3_DATA_REG         
;   ret
    
delay:
    mov [ksc_delay],A       

	;we got here with a fixed delay caused by the push A, mov, A, and
	;call, equal to 4+10+5 = 19 cycles.  At the end of the routine we
	;incur another 8+ 5 due to the return and pop. This gives 32 cycles
    ;of delay.


    ;our fixed delay is now 37 cycles, or very close to 3 us.
    ;now eat up the rest of the us in this loop.

	NOP                     ; 4 x 3 = 12 cycle
	NOP
	NOP

XPAGEOFF
loop:						;1us per revolution through this loop
	dec	[ksc_delay]
	jnz	loop
XPAGEON



    pop A
    ret

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色激情天天射综合网| 欧美精品一区二区三| 在线综合+亚洲+欧美中文字幕| 精品国一区二区三区| 亚洲综合视频网| 99在线热播精品免费| 精品福利一二区| 日韩和的一区二区| 欧美亚洲高清一区| 亚洲国产精品激情在线观看| 美女脱光内衣内裤视频久久影院| 一本久道久久综合中文字幕| 欧美国产一区二区在线观看| 精品一区二区三区免费播放| 欧美精品在线一区二区| 亚洲久草在线视频| hitomi一区二区三区精品| 欧美xingq一区二区| 日日夜夜免费精品| 日本道色综合久久| 亚洲男女毛片无遮挡| 成人深夜在线观看| 国产欧美精品区一区二区三区| 蜜桃久久av一区| 91麻豆精品久久久久蜜臀| 午夜激情一区二区| 欧美一区二区三区在线观看| 亚洲国产毛片aaaaa无费看| 欧美在线一区二区| 亚洲成人av福利| 7777精品伊人久久久大香线蕉的| 一级精品视频在线观看宜春院| 99久久er热在这里只有精品66| 日本一区二区成人| 色综合视频在线观看| 1区2区3区国产精品| 一本一道久久a久久精品综合蜜臀| 国产精品免费av| 99久久99久久精品免费看蜜桃 | 欧美伊人久久久久久久久影院 | 国产精品久久久久毛片软件| www.av亚洲| 亚洲女女做受ⅹxx高潮| 色拍拍在线精品视频8848| 一区二区三区不卡视频| 在线91免费看| 国产综合久久久久久鬼色| 日本一区免费视频| 色婷婷av一区二区三区大白胸| 一区二区三区免费看视频| 制服丝袜一区二区三区| 狠狠狠色丁香婷婷综合久久五月| 国产日韩视频一区二区三区| 一本到不卡精品视频在线观看| 午夜精品免费在线观看| 26uuu成人网一区二区三区| 高清成人在线观看| 亚洲午夜久久久久久久久电影院| 日韩一区二区三| 成人一道本在线| 亚洲电影你懂得| 久久色视频免费观看| 99精品国产视频| 久久精品国产精品亚洲精品| 中文字幕av一区二区三区免费看 | 日韩一二三四区| 国产91清纯白嫩初高中在线观看 | 国产精品视频观看| 欧美日韩国产区一| 国产高清成人在线| 亚洲第一狼人社区| 国产日本欧洲亚洲| 欧美精品一二三四| 成人国产精品免费| 日本不卡一区二区三区高清视频| 中文一区一区三区高中清不卡| 欧美精品 国产精品| 成人av在线播放网址| 免费观看成人鲁鲁鲁鲁鲁视频| 中文字幕在线观看一区二区| 日韩欧美一卡二卡| 91国产免费观看| 成人黄色一级视频| 黄色日韩网站视频| 日韩av一区二| 亚洲国产欧美日韩另类综合 | 国产毛片精品国产一区二区三区| 樱桃视频在线观看一区| 国产亚洲自拍一区| 日韩视频免费直播| 色94色欧美sute亚洲13| 成人三级伦理片| 国产一区二区三区高清播放| 午夜在线成人av| 亚洲综合在线第一页| 最新高清无码专区| 中文字幕不卡在线观看| 久久综合九色欧美综合狠狠| 91麻豆精品91久久久久久清纯| 色综合中文综合网| 国产精品乱人伦中文| 欧美成人性战久久| 日韩欧美在线不卡| 欧美精品国产精品| 欧美少妇性性性| 欧美色欧美亚洲另类二区| 91蜜桃免费观看视频| jiyouzz国产精品久久| 成人综合婷婷国产精品久久免费| 国产一区二区在线电影| 国产一区二区不卡| 国产盗摄一区二区三区| 国产一区二区免费在线| 国产一区二区调教| 国产精品一区二区视频| 蜜臀国产一区二区三区在线播放| 狠狠网亚洲精品| 狠狠色狠狠色综合| 国产精品99久久久久久似苏梦涵 | 亚洲小说春色综合另类电影| 一区二区三区四区视频精品免费| 成人欧美一区二区三区| 亚洲精品写真福利| 亚洲永久精品大片| 婷婷激情综合网| 久久电影网站中文字幕| 精品一区二区免费视频| 国产精品一色哟哟哟| 成人免费毛片a| 一本大道久久a久久综合| 欧美中文字幕一二三区视频| 欧美视频在线一区| 精品国产精品网麻豆系列| 欧美精品一区二区三区一线天视频| 精品久久五月天| 中文欧美字幕免费| 亚洲妇女屁股眼交7| 日韩av中文字幕一区二区 | 亚洲国产成人一区二区三区| 国产精品人人做人人爽人人添 | 精品在线免费观看| 波多野结衣中文字幕一区二区三区| 成人av免费网站| 制服丝袜亚洲精品中文字幕| 亚洲精品在线观| 亚洲夂夂婷婷色拍ww47| 麻豆传媒一区二区三区| 99精品视频在线观看免费| 欧美精品一二三四| 国产精品不卡在线观看| 日本午夜精品一区二区三区电影| 国产99久久久精品| 51精品久久久久久久蜜臀| 欧美国产日本韩| 日韩影院精彩在线| 成人性视频网站| 日韩视频永久免费| 亚洲人成网站影音先锋播放| 久久精品国产第一区二区三区| av成人免费在线观看| 欧美一区二区精品在线| 亚洲精品亚洲人成人网| 国产精品一区2区| 欧美疯狂做受xxxx富婆| 国产精品福利在线播放| 精品一区二区免费| 91精品免费观看| 亚洲人精品一区| 国产成人午夜视频| 91精品国产高清一区二区三区蜜臀| 国产精品青草综合久久久久99| 奇米精品一区二区三区在线观看一| bt7086福利一区国产| 日韩精品一区二区在线观看| 亚洲美女电影在线| 高清成人免费视频| 久久久夜色精品亚洲| 免费看黄色91| 在线电影国产精品| 亚洲一区二区三区四区不卡| 99亚偷拍自图区亚洲| 久久精品亚洲精品国产欧美kt∨| 欧美aaaaaa午夜精品| 欧美三级在线播放| 一区二区三区精品| 91成人免费网站| 又紧又大又爽精品一区二区| bt欧美亚洲午夜电影天堂| 欧美国产欧美综合| 成人一级片网址| 国产精品区一区二区三| 成人av片在线观看| 中文字幕一区三区| 99国产精品一区| 三级久久三级久久久| 欧美性猛交xxxx黑人交| 一区二区三区中文在线观看| 99久久久无码国产精品| 亚洲视频综合在线| 在线看日韩精品电影|