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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? kbscan.asm

?? 該程序?yàn)閁SB HUB程序
?? ASM
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
;FILE:KEYSCAN.ASM
;
;
; contains the key scanning algorithm for the keyboard scan matrix
;
;REVISION HISTORY
;
;8/13/98
; changed sense of usb connect bit in port 3
;========================================================================
;                       KEYBOARD SCAN TASK
; The keyboard is organized as 8 rows by 16 columns.  The I/O ports are
; assigned as:
; P2
; bit7               bit0
; r7 r6 r5 r4 r3 r2 r1 r0
;
; P1                             P0
; bit7       bit4           bit0 bit7                 bit0
; c15 c14 c13 c12 c11 c10 c9 c8  c7 c6 c5 c4 c3 c2 c1 c0
;
; The three LEDs are on port 3 bits[2:0]
; 
; The keycode table is organized as 16 columns with 8 rows per column.
;       ksc_x_index selects a column from 0 to 15
;       ksc_y_index selects a row from 0 to 7
;========================================================================
;------------------------------------------------------------------------
; ram variables to support the scan matrix
;------------------------------------------------------------------------
LEFT_CTRL_BIT:		equ		01h
LEFT_SHIFT_BIT:		equ		02h
LEFT_ALT_BIT:		equ		04h
LEFT_GUI_BIT:		equ		08h
RIGHT_CTRL_BIT:		equ		10h
RIGHT_SHIFT_BIT:	equ		20h
RIGHT_ALT_BIT:		equ		40h
RIGHT_GUI_BIT:		equ		80h
APP_BIT:			equ		01h


;========================================================================
; FUNCTION: ksc_putkey
;
; calls either ps2key_putkey or usbkey_putkey, depending upon the
; keyboard currently being supported.
;
;
;========================================================================

ksc_putkey:
    push    A
    mov     A,[dual_ifc_keyboard]
    cmp     A,PS2_KEYBOARD
    pop     A
    jnz     .usb
IFDEF   PS2KB
    call ps2key_putkey
ENDIF    
    ret
.usb:
IFDEF   USBKB
    call   usbkey_putkey
ENDIF    
    ret

;========================================================================
; FUNCTION: ksc_scan_keys
;
; Keyboard scanning function
;
;========================================================================
ksc_scan_keys:
	call ksc_Debounce_Task          ; task for debounce
	
	mov A, 0                        ; init. phantom key flag to false
	mov [ksc_phantom], A
	mov [ksc_col_hits],A
	mov [ksc_row_hits],A
    mov [ksc_changes],A                
    mov [ksc_key_count],A
    mov [ksc_x_index],A

	mov X, 16                       ; 16 columns
	call ksc_StartScan              ; write initial scan pattern

.column_loop:
;   DELAY 1                         ; 16 x 10us + alpha = less 200us
	iord  PORT2_DATA_REG            ; read input port
	cpl                             ; complement so down switch is '1'
	mov [ksc_mod1], A               ; save the port 2 data
;   DELAY 25	
;	iord  PORT2_DATA_REG            ; read input port
;	cpl                     
;	and [ksc_mod1], A               ; and with last look
	jz	.nokeysdown                 ; if keys are down in this column

    push A
    call    count_ones
    add A,[ksc_key_count]
    mov [ksc_key_count],A
    pop A
    or  [ksc_row_hits],A            ; keep track of all rows with keys down
    inc [ksc_col_hits]              ; and count of columns with a key down
    
.nokeysdown:
    mov A,[ksc_changes]             ; if key changes have already been found in a previous column
    cmp A, 0
    jnz .key_has_changed            ; skip to next column to scan for phantom situation
                                    ; else
	mov A, [X + ksc_image - 1]      ; get previous column data
	xor A, [ksc_mod1]               ; compare with current data
	mov [ksc_changes], A            ; and save positions where a change occurred
	cmp A, 0                        ; test for state change
	jnz .key_has_changed            ; if no key state change
    inc  [ksc_x_index]              ; increment the column
.key_has_changed:
	call ksc_NextPattern            ; write a new scan pattern
	dec X                           ; done yet?
	jnz .column_loop
.exit:

    mov A,[ksc_changes]                
    cmp A,0                         ; did we find any key changes from the above scan?
    jz  .exit1                      ; no, exit now
                                    ; yes, was there a phantom situation during the above scan?
    call check_phantom              ;
    jc  .exit1                      ; yes, exit now, because we cannot determine state of keys
    mov  A,[ksc_x_index]            ; else restore X to the proper column index
    cpl A                           ; based on the value of ksc_x_index
    add A,17
    mov X,A
    call ksc_KeyChanged             ; then call ksc_KeyChanged to record key changes
    CLEARC
.exit1:
	ret

;========================================================================
; initialize all columns to begin a keyboard scan
;       0 in c[0]
;       1 in c[19:1]
;       clear ksc_x_index to indicate column under test
;========================================================================
ksc_StartScan:
	push A                          ; save accumulator on stack
	mov A, feh                      ; write a zero to c[0]
	iowr  PORT0_DATA_REG            ; write ones to c[7:1]
	mov [ksc_p0out], A              ; remember what was written to Port0

	mov A, ffh                      ; write all ones to c[15:8]
	iowr  PORT1_DATA_REG     
	mov [ksc_p1out], A              ; remember what was written to Port1

	pop A                           ; restore accumulator from stack
	ret                             ; return

;========================================================================
; Write the columns with the next pattern in the keyboard scan.
; the pattern is generated as a left shift to walk the columns from zero
; to 15.  Increment the ksc_x_index to track the column under test.
;
;Port 1                         Port 0
;bit7                     bit0  bit7               bit0
;c15 c14 c13 c12 c11 c10 c9 c8  c7 c6 c5 c4 c3 c2 c1 c0
;========================================================================
ksc_NextPattern:
	push A                          ; save accumulator on stack
	mov A, 0ffh                     ; set the carry bit
	rlc     
	mov A, [ksc_p0out]              ; load c[7:0] data
	rlc                             ; rotate left 
	mov [ksc_p0out], A              ; update memory copy
	iowr  PORT0_DATA_REG
	mov A, [ksc_p1out]              ; load c[15:8] data
	rlc                             ; rotate left 
	mov [ksc_p1out], A              ; update memory copy
	iowr PORT1_DATA_REG 

	pop A                           ; restore accumulator from stack
	ret                             ; ret

;========================================================================
; A column had one or more buttons that changed state (up to down or down
; to up).  Scan the rows to find out which one(s) changed.
;========================================================================
ksc_KeyChanged:
	push A
	mov A, 0                        ; zero the row index
	mov [ksc_y_index], A

	mov A, 1                        ; initialize the scan bit
.row_loop:
	push A                          ; save scan bit on stack
	and A, [ksc_changes]            ; test bit position in row data
	jz .next_row                    ; keep testing
	call ksc_FoundKey               ; found a key
.next_row:
	inc [ksc_y_index]               ; increment row
	pop A                           ; restore scan bit
	rlc                             ; rotate left to test next bit
	jnc .row_loop

.done_KeyChanged:
	pop A
	ret                             ; return




;========================================================================
; We have a key identified by an ksc_x_index and a ksc_y_index.  Combine the two
; into a single index and lookup the keycode, check if up or down change.
;========================================================================
ksc_FoundKey:
	push A                              ; save accumulator on stack
	mov A, X
	mov [ksc_matrix_addr], A            ; save current scanned column
	pop A                               ; restore and save accumulator on stack
	push A

	and A, [X + ksc_image - 1]          ; see whether up or down change
	mov A, 00h                          ; key went up
	jnz .calc_matrix             
	mov	A,[dual_ifc_keyboard]			; key went down
	cmp	A,USB_KEYBOARD                  ; if we are a usb interface
	jz	.process                        ; process the key make
	TSTBIT PS2_SCAN_KBD,ps2_flags		; otherwize,if the keyboard is disabled (ps2)
	jz		.done_FoundKey      		; discard all key makes
.process:
	mov A, FFh                          ; process this key make
.calc_matrix:                             ; calculate offset into code matrix
	mov [ksc_down_up], A                ; set flag
	mov X, [ksc_matrix_addr]            ; restore current column
	mov A, [ksc_x_index]                ; load column number
	asl                                 ; multiply by eight
	asl
	asl
	add A, [ksc_y_index]                ; add in the row index
	mov [ksc_matrix_addr], A            ; store

; test debounce array for match
	call ksc_Debounce_test              ; check if debounce in progress on this key
	jnz .update_image			        ; if it is (zero flag set)
	jmp .done_FoundKey                  ; exit, do not process this key

.update_image:                                      
	pop A                               ; retrieve and save test bit
	push A
	xor [X + ksc_image - 1], A          ; update key switch ksc_image
	
	call ksc_Debounce_keys              ; push matrix address on debounce array

.get_code:
 ;   mov A,[ksc_down_up]                 ; all key breaks pass through unmolested
 ;   cmp A,0h
 ;   jnz   .make
 ;   dec    [ksc_key_count]
 ;   jmp     .put
;.make:
;   inc     [ksc_key_count]
.put:
;	mov A, [dual_ifc_option]			; depending on option 
;	and A, KEYBOARD_ID_BIT
	mov A, [ksc_matrix_addr]
;	jz  .kbd1	
;	index  at101_tbl1					; get matrix info for kbd type 2
;	jmp		.continue
;.kbd1:
	index  at101_tbl					; or kbd type 1
.continue:
	call  ksc_putkey



.done_FoundKey:
	pop A                               ; restore accumulator
	ret                                 ; return

;quick and dirty routine to count the number of 1's in a byte.
;the table below gives the number of 1's in the nibble from 0 - 15
XPAGEOFF

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本高清不卡视频| 亚洲第一福利一区| 美国十次了思思久久精品导航| 91视频一区二区| 中文字幕精品综合| 另类小说综合欧美亚洲| 欧美日韩黄色一区二区| 亚洲一区二区在线观看视频 | 国产乱人伦偷精品视频免下载 | 高潮精品一区videoshd| 日韩精品一区二区三区中文精品| 亚洲一区在线观看免费| 在线观看亚洲专区| 一卡二卡三卡日韩欧美| 在线精品视频免费观看| 亚洲制服丝袜在线| 欧美日韩1区2区| 丝袜亚洲另类欧美| 欧美一级免费观看| 麻豆精品视频在线观看视频| 日韩午夜激情视频| 狠狠色丁香久久婷婷综合_中| 精品成人一区二区| 风间由美中文字幕在线看视频国产欧美 | 亚洲一二三四在线| 欧美三级日韩在线| 日韩极品在线观看| 日韩精品中文字幕在线一区| 久久99久久99小草精品免视看| 日韩精品在线一区| 国产成人精品三级| 亚洲美腿欧美偷拍| 欧美精品粉嫩高潮一区二区| 蜜乳av一区二区三区| 久久综合网色—综合色88| 国产精品一区二区视频| 国产精品毛片a∨一区二区三区| 97se亚洲国产综合自在线| 亚洲自拍另类综合| 精品欧美久久久| 成人av在线一区二区三区| 亚洲影视资源网| 日韩亚洲欧美一区| 成人午夜电影久久影院| 一区二区免费在线播放| 3d动漫精品啪啪一区二区竹菊| 国产在线不卡视频| 亚洲色图一区二区| 91精品国产综合久久久蜜臀图片 | 欧美一二三在线| 国产99一区视频免费 | 亚洲影视在线观看| 久久丝袜美腿综合| 在线观看91视频| 国产精品自拍毛片| 一区二区三区丝袜| 2021久久国产精品不只是精品| 91蜜桃在线免费视频| 狠狠色丁香久久婷婷综| 亚洲精品成人悠悠色影视| 日韩精品资源二区在线| 91丝袜高跟美女视频| 久久国产夜色精品鲁鲁99| 国产精品久久久久久久第一福利| 欧美日产国产精品| 成人短视频下载| 蜜桃视频一区二区三区| 亚洲激情第一区| 国产亚洲精品超碰| 9191精品国产综合久久久久久| 成人高清免费在线播放| 蜜臀av一区二区在线观看| 亚洲狠狠丁香婷婷综合久久久| www日韩大片| 在线播放日韩导航| 色综合久久久久久久久久久| 国内精品国产成人国产三级粉色| 亚洲一区二区视频在线观看| 国产精品色眯眯| 日韩精品影音先锋| 欧美三日本三级三级在线播放| 成人免费精品视频| 国产在线精品免费| 免费人成精品欧美精品 | 国产欧美一区二区三区网站| 制服丝袜av成人在线看| 色噜噜夜夜夜综合网| 成人午夜av在线| 国产另类ts人妖一区二区| 日韩av一区二区三区| 亚洲午夜精品17c| 亚洲丝袜制服诱惑| 国产精品免费久久久久| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲另类一区二区| 中文av一区二区| 久久精品夜夜夜夜久久| ww亚洲ww在线观看国产| 日韩三级视频在线看| 91精品免费观看| 7777精品伊人久久久大香线蕉完整版 | 中文字幕在线免费不卡| 中文字幕一区二区三区视频| 久久久久久综合| 久久亚洲精华国产精华液| 日韩一区二区三区四区| 欧美一二三区精品| 欧美一级一区二区| 日韩免费视频一区| 精品国产91久久久久久久妲己| 欧美变态tickling挠脚心| 欧美大度的电影原声| 欧美成人一区二区三区在线观看| 欧美一区二区日韩一区二区| 日韩亚洲欧美一区| 欧美v亚洲v综合ⅴ国产v| 欧美xxxxx裸体时装秀| 精品国产免费一区二区三区四区 | 美女视频一区在线观看| 日韩国产欧美在线观看| 三级不卡在线观看| 美美哒免费高清在线观看视频一区二区 | 一区精品在线播放| 亚洲女与黑人做爰| 亚洲成人自拍一区| 日韩电影在线免费观看| 麻豆精品在线看| 蜜桃一区二区三区在线观看| 久久99国产精品久久99果冻传媒| 久久精品国产成人一区二区三区| 国产美女精品在线| 99在线精品免费| 欧美亚洲日本国产| 在线观看91av| 国产性做久久久久久| 亚洲欧洲制服丝袜| 美女视频网站黄色亚洲| 国产成人亚洲综合a∨婷婷图片 | 在线电影院国产精品| 精品蜜桃在线看| 中文字幕中文字幕中文字幕亚洲无线| 亚洲另类在线制服丝袜| 日韩精品亚洲一区| 国产一区二区三区免费看| 99精品久久只有精品| 欧美久久久久免费| 国产校园另类小说区| 亚洲精品国产第一综合99久久| 日韩精品午夜视频| 国产成人综合亚洲91猫咪| 一本一道综合狠狠老| 日韩欧美卡一卡二| 一区在线播放视频| 蜜臀av国产精品久久久久 | 欧美久久久久中文字幕| 久久精品一区二区三区av| 亚洲亚洲精品在线观看| 国产精品资源网| 欧美日韩三级在线| 日本一区二区不卡视频| 丝袜美腿亚洲一区| 99精品国产91久久久久久| 欧美电影免费观看高清完整版在线 | 亚洲最新视频在线播放| 精品午夜久久福利影院| 91片在线免费观看| 久久免费的精品国产v∧| 亚洲成国产人片在线观看| 成人国产精品免费网站| 精品免费视频.| 亚洲成人一二三| 99久久亚洲一区二区三区青草| 精品三级av在线| 香蕉久久夜色精品国产使用方法 | 国产免费久久精品| 日韩高清不卡一区| 色婷婷av一区二区三区gif| 久久久99久久| 老司机免费视频一区二区 | 91日韩精品一区| 久久综合色婷婷| 日本不卡视频一二三区| 欧美综合一区二区三区| 一区免费观看视频| 成人高清视频在线观看| 久久久亚洲欧洲日产国码αv| 美女被吸乳得到大胸91| 欧美一区午夜精品| 日韩高清在线一区| 欧美视频在线一区二区三区| 亚洲男同性视频| 97精品久久久久中文字幕| 中文字幕欧美激情一区| 国产酒店精品激情| 久久夜色精品国产欧美乱极品| 蜜臀久久久久久久| 日韩精品一区二区三区蜜臀 | 亚洲精品第一国产综合野| 99久久综合国产精品| 国产欧美日韩综合精品一区二区|