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

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

?? ps2key.asm

?? Cypress 的(鼠標+鍵盤)復合設備匯編源程序
?? ASM
?? 第 1 頁 / 共 3 頁
字號:
;========================================================================
;   FILE: ps2key.asm
;
;   This file contains the code that implements the ps2-specific
;   routines to handle key scans.
;
;   REVISION HISTORY:
;
;   3/26/99 fixed putch so that it leaves room for 1 byte in the buffer
;
;
;========================================================================


LAST_SCAN3_CODE:                equ 08fh

BUFFER_LEN:                     equ 17


PS2_DEFAULT_TYPEMATIC_DELAY:    equ       125           ;default delay = 500mS
PS2_DFFAULT_TYPEMATIC_INTERVAL: equ       22            ;default period = 92mS (= 10.9cps)



;define a useful macro for determining if the recent key press was up or down
;
;

    MACRO TSTMAKE
    mov     A,[ksc_down_up]
    cmp     A,0h
    ENDM

;define local flags to this module


PS2KEY_OVERFLOW_FLAG:   equ       1
PS2KEY_EXTENDED_FLAG:   equ       2
PS2KEY_MAKE_FLAG:       equ       4
PS2KEY_GHOST_FLAG:		equ		  8

GHOST_750MS_TIMEOUT:	equ       750/4
GHOST_500MS_TIMEOUT:	equ		  500/4

; keyboard duplicate input report buffer (8 bytes)

ps2key_key_count:           equ (ps2key_ram_base + 0)   ;count of keys in buffer
ps2key_inptr:               equ (ps2key_ram_base + 1)   ;in pointer to buffer
ps2key_outptr:              equ (ps2key_ram_base + 2)   ;out pointer to buffer
ps2key_old_count:           equ (ps2key_ram_base + 3)   ;storage  for copy of count
ps2key_old_inptr:           equ (ps2key_ram_base + 4)   ;and in pointer
ps2key_scan_set:            equ (ps2key_ram_base + 5)   ;current scan set
ps2key_numlock:             equ (ps2key_ram_base + 6)   ;=0 if numlock off
ps2key_flags:               equ (ps2key_ram_base + 7)   ;flag byte
ps2key_type_delay:          equ (ps2key_ram_base + 8)   ;typematic delay
ps2key_type_period:         equ (ps2key_ram_base + 9)   ;typematic interval
ps2key_delay_ctr:           equ (ps2key_ram_base + 10)  ;typematic delay counter
ps2key_last_key_made:       equ (ps2key_ram_base + 11)  ;typematic key
ps2key_last_flags:          equ (ps2key_ram_base + 12)   ;typematic flags
ps2key_ghost_counter:       equ (ps2key_ram_base + 13)  ;ghost counter
ps2key_key_buffer:          equ (ps2key_ram_base + 14)  ; key buffer
ps2key_type_array:          equ (ps2key_ram_base + 14 + BUFFER_LEN)       ;Scan set 3 typematic settings table
PS2_TYPE_ARRAY_SIZE:        equ  36
PS2KEY_RAM_SIZE:            equ 14 + BUFFER_LEN + PS2_TYPE_ARRAY_SIZE + 1
key_buffer_end:             equ ps2key_key_buffer + BUFFER_LEN        ; key buffer end

;========================================================================
; FUNCTION:ps2_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
;   ps2key_putkey from the internal scanning loop of the key scanner.
;
;
;
;========================================================================

ps2_scan_keys:
    mov     A,0
    mov     [ps2key_flags],A                        ;clear all flags
    call    ksc_scan_keys                           ; check for new keys
                                                    ; phantom situation exists?
    jc      .ghost                                  ; yep, go there
    call    ps2key_check_typematic                  ; check state of typematic keys
	CLRBIT PS2KEY_GHOST_FLAG,ps2key_flags           ;clear  ghost flag
	mov		A,GHOST_750MS_TIMEOUT	                ;maximize ghost counter
	mov		[ps2key_ghost_counter],A                ;and get out
	jmp		.exit
.ghost:                                             ;yes, a ghost condition exists
    call    ps2key_disable_typematic_action         ;disable any typematic action
	dec		[ps2key_ghost_counter]
	mov     A,[ps2key_ghost_counter]				;get ghost counter
	jnz		.exit                                   ;if counter expired
	mov		A,GHOST_500MS_TIMEOUT                   ;reset it
	mov		[ps2key_ghost_counter],A

	call	put_error								;put an error code
.exit:
    ret                                             ; return from task

;========================================================================
; FUNCTION:ps2_putkey
;
;handles key presses in ps2 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).
;========================================================================

ps2key_putkey:
    push    X
    mov     X,A                                 ;keep copy of key code in X
    TSTBIT PS2KEY_OVERFLOW_FLAG,ps2key_flags    ;if overflow flag is currently set,
    jz    .continue                             ;don't go any further.
    pop X
    ret

.continue:


    CLRBIT PS2KEY_EXTENDED_FLAG,ps2key_flags     ;otherwise, start by clearing extension flag
                                                 ;for this character

    ;save the current in buffer pointer and key count. If this scan code
    ;turns out not to fit in the key buffer, we'll restore the buffer pointer
    ;and count to their positions prior to the overflow.

    mov    A,[ps2key_key_count]                  ;save current buffer size
    mov    [ps2key_old_count],A                  ;
    mov    A,[ps2key_inptr]                      ;and in pointer
    mov    [ps2key_old_inptr],A

    mov    A,[ps2key_scan_set]                   ;if we are using scan set 3
    cmp    A,SCAN_SET_3
    mov    A,X
    jnz     .scan1or2
    call   scan3                                 ;handle scan set 3, it is easiest
    jmp    .exit
.scan1or2:
    call    scan1or2                            ;otherwise handle 1 or 2
.exit:

    TSTBIT  PS2KEY_OVERFLOW_FLAG,ps2key_flags   ;check if code resulted in buffer overflow
    jz     .no_errors
    mov    A,[ps2key_old_count]                 ;yes it did. restore buffer ptr and count
    mov    [ps2key_key_count],A                 ;to values prior to overflow
    mov    A,[ps2key_old_inptr]
    mov    [ps2key_inptr],A
    call   put_error                            ;and insert an error code
    call    ps2key_disable_typematic_action     ;clear out any typematic stuff
 .no_errors:
    pop     X
    ret

;========================================================================
; FUNCTION:scan1or2
;
; handles scan set 1 and 2 scan code generation. With the exception
; of the actual codes used for make/break, the rules regarding scan
; code generation are the same; such as shift/unshift appending and prepending,
; numlock on/off, etc.
;
; entered with key code in A and X
;
; Returns: nothing
;
;
;========================================================================


scan1or2:

    call    ksc_modifier                        ;first, trap modifier keys.
    call    test_126                            ;check for key 126 Pause/Break
    jc      .exit
    call    test_124                            ;check for key 124 Print Screen
    jc      .exit
    call    test_95                             ;check for key 95 Keypad Slash
    jc      .exit
    call    test_75_89                    ;check for keys 75 through 89 Navigation/Edit Keys
    jc      .exit
    call    test_extended_codes                 ;check for any extended codes
    jc      .exit
    call    base_case                           ;otherwise, handle key
.exit:

    ;now handle possible typematic functions
    TSTMAKE                                     ;check if make/break
    mov     A,X
    jz      .break
.make:                                          ;if a make,
    call ps2key_disable_typematic_action        ;reset typematic action
    cmp     A,AT101KB_PAUSE                     ;if not the pause key,
    jz      .l1
    call ps2key_enable_typematic_action         ;start up typematic action
    jmp     .l1                                 ;for this new make

.break:
    call    check_typematic_break               ;else it was a break,
                                                ;check it
.l1:
    ret
;========================================================================
; FUNCTION:scan3
;
; handles scan set 3 scan code generation. This set is the simplest to
; implement.
;
;   entered with key code in A and X
;
; Returns:
;
;
;========================================================================


scan3:
    push    A                               ;save  A and X
    push    X


    push    A                               ;save at101 code
    index   scan_set_3_table                ;get its scan code
    call    ps2key_get_key_type             ;get type of key in X register
    TSTMAKE
    pop     A                               ;restore at101 code
    jz      .break

.make:
                                            ;it's a make
    call ps2key_disable_typematic_action    ;reset typematic action
    swap     A,X                            ;get type into A,code in X
    cmp      A,MAKE_BREAK                    ;if the key is not typematic
    jz      .out                            ;just generate the make code
    cmp      A,MAKE
    jz      .out
    swap     A,X                            ;get code back in A
    call    ps2key_enable_typematic_action  ;else start up typematic action
    swap    A,X                             ;get code back into X
    jmp     .out                            ;now generate scan code

.break:
                                            ;it's a break
    call    check_typematic_break           ;see if it stops the typematic action
    swap    A,X                             ;type now in A, code in X
    cmp     A,MAKE_BREAK                    ;if we need to report breaks
    jz     .out                             ; generate the code
    cmp     A,TYPEMATIC_MAKE_BREAK
    jz     .out
    jmp     .exit                           ;else skip break code generation

.out:                                       ;char in X where base case expects it
    call    base_case                       ;this'll generate scan code
 .exit:
    pop     X
    pop     A
    ret


;========================================================================
; FUNCTION:
;
;
; Returns:test_126
;
; Handles scan codes for key 126 in scan sets 1 and 2.
;
; Returns:
;   C = 1 if key was handled
;   C = 0 if not
;
;
;========================================================================



test_126:
    cmp    A,126
    jnz    .no                                      ;if key126
    push    X
    TSTMAKE
    jz      .yes                                    ;and a make of this key
    mov     A,[ksc_mod0]
    and     A,(LEFT_CTRL_BIT + RIGHT_CTRL_BIT)      ;check for control key pressed
    jz     .make
    SETBIT  PS2KEY_EXTENDED_FLAG,ps2key_flags       ;yes, generate an extended
    SETBIT  PS2KEY_MAKE_FLAG,ps2key_flags           ;make and an extended break for this code
    mov     A,X
    call    put_code
    CLRBIT  PS2KEY_MAKE_FLAG,ps2key_flags
    mov     A,X
    call    put_code                                ;
    jmp    .yes
.make:
    mov          X,0                                ;otherwise, we'll be putting out
                                                    ;a string
.loop:
    mov    A,[ps2key_scan_set]                      ;if scan set 1
    cmp    A,SCAN_SET_1
    mov          A,X
    jnz    .scan2                                   ;  use scan set 1 string
    index ss1_key126_make_scan_code
    jmp    .l1
.scan2:
    index ss2_key126_make_scan_code                 ;else use scan set 2 string
.l1:
    cmp           A,0                               ;exit if  end of string
    jz      .yes
    call    putch                                   ;else put character and continue
    inc     X
    jmp     .loop

.yes:
    pop     X
    SETC
    ret
.no:
    CLEARC
    ret






;========================================================================
; Function: test_extended_codes
;
; check for all special keys in scan sets 1 and 2 that require an extension
; byte (0xe0) prepended to their scan code, but with NO OTHER special rules
; applied to them
;
; Returns:
;   C = 1 if key was handled
;   C = 0 if not
;========================================================================

test_extended_codes:
    cmp     A,62        ; right now, keys 62,64, and 128
    jz      .yes        ; R_Alt, R_Ctrl, R_GUI
    cmp     A,64        ; all meet this requirement
    jz      .yes
    cmp     A,108
    jz     .yes
;    cmp     A,133      ; check for keys 127 thru 133 inclusive
    cmp     A,151       ; check for keys 127 thru 149 inclusive
    jnc     .no         ;
    cmp     A,127
    jc     .no
.yes:
    call    extended_base_case     ; generate an extension code
    SETC                           ; set carry to indicate we handled this char
    ret
.no:
    CLEARC                                  ;clear carry to indicate we did not handle
    ret                                     ;the char


;========================================================================
; test_75_89
;
; keys 75 through 89 all have the same set of rules governing their code
; generation.
;
; Returns:
;   C = 1 if key was handled
;   C = 0 if not
;========================================================================

test_75_89:
    cmp     A,90              ;check for keys 75 through 89 inclusive
    jnc     .no
    cmp     A,75
    jc     .no

    mov     A,[ps2key_numlock]          ;test for numlock on/off
    cmp     A,0
    jnz     .numlock_on

                                         ;numlock is off
    mov     A,[ksc_mod0]                 ;check for shift states
    and     A,(LEFT_SHIFT_BIT+RIGHT_SHIFT_BIT)
    jz      .base                          ;numlock off, some sort of shift
                                           ;
    call    shift_case                     ;so handle as shift case
    jmp     .yes
.base:
    call    extended_base_case  ;numlock off, no shift, use extended base case
    jmp     .yes

.numlock_on:                          ;numlock on, check for shift states
    mov           A,[ksc_mod0]
    and     A,(LEFT_SHIFT_BIT + RIGHT_SHIFT_BIT)
    jz      .numlock_only
    call    extended_base_case    ;numlock on, some shift, use extended base case
    jmp     .yes
.numlock_only:
    call    numlock_case         ;numlock on only, use numlock case
.yes:
    SETC                      ;set carry to indicate we handled this char
    ret
.no:
    CLEARC
    ret






;========================================================================
; Function: test_95
;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合综合久久综合| 播五月开心婷婷综合| 中文字幕高清不卡| 精品电影一区二区| 欧美精品欧美精品系列| 欧美日韩中文字幕精品| av欧美精品.com| 北条麻妃一区二区三区| 国产.精品.日韩.另类.中文.在线.播放| 日韩免费高清av| 中文字幕一区二区在线观看| 91网站最新网址| 日韩黄色在线观看| 国产做a爰片久久毛片| 亚洲第一福利一区| 天天影视色香欲综合网老头| 亚洲激情中文1区| 国产女同性恋一区二区| 91精品国产福利在线观看| 在线成人高清不卡| 国产精品美女久久久久aⅴ| 综合欧美一区二区三区| 亚洲3atv精品一区二区三区| 亚洲成人av福利| 成人激情午夜影院| 欧美一区日韩一区| 五月婷婷激情综合| 美女精品自拍一二三四| av毛片久久久久**hd| 日韩视频一区在线观看| 国产精品久久久久久久浪潮网站 | 精品视频资源站| 一区二区三区四区高清精品免费观看 | 国产最新精品免费| 日韩欧美一级精品久久| 蜜臀91精品一区二区三区| 色激情天天射综合网| 亚洲精品成人精品456| av一区二区三区| 91精品麻豆日日躁夜夜躁| 中文一区一区三区高中清不卡| 日韩成人精品在线观看| 日韩欧美一区二区免费| 国产麻豆精品视频| 亚洲视频在线观看三级| 在线观看精品一区| 久久精品99国产精品| 国产欧美一区视频| 色综合久久中文字幕综合网| 亚洲午夜久久久久久久久电影院 | 欧美一区二区三区啪啪| 日本中文字幕一区二区视频| 日韩免费高清av| 91蜜桃视频在线| 性欧美大战久久久久久久久| 精品免费国产二区三区 | 成人理论电影网| 亚洲第一二三四区| 日本一区二区三区dvd视频在线 | 午夜精品一区二区三区电影天堂| 日韩欧美一二区| 一本色道久久综合精品竹菊| 国产一区二区三区免费观看| 日日夜夜免费精品视频| 亚洲免费色视频| 国产精品私人自拍| 久久综合五月天婷婷伊人| 91麻豆精品91久久久久久清纯| 国产91在线|亚洲| 国产精品香蕉一区二区三区| 亚洲成人午夜影院| 亚洲一区免费在线观看| 日韩欧美二区三区| 色综合天天狠狠| 色狠狠一区二区三区香蕉| 成人av第一页| 日本高清免费不卡视频| 91碰在线视频| 欧美日本一区二区| 日韩女同互慰一区二区| 亚洲精品在线免费播放| 久久亚洲影视婷婷| 国产精品麻豆久久久| 亚洲色图一区二区三区| 亚洲高清在线精品| 久久精品国产色蜜蜜麻豆| 国产精选一区二区三区| 91丨porny丨首页| 日韩欧美国产三级| 国产日韩亚洲欧美综合| 一个色在线综合| 激情综合色播激情啊| 99久久er热在这里只有精品15| 欧美性xxxxx极品少妇| 日韩免费一区二区| 亚洲视频综合在线| 国产成人精品网址| 91精品一区二区三区在线观看| 国产欧美日本一区视频| 青青草国产成人99久久| 91免费版在线看| 国产精品美女视频| 国产精品白丝av| 久久久久国产精品免费免费搜索| 亚洲一区二区不卡免费| 91一区二区三区在线观看| 国产区在线观看成人精品| 免费人成精品欧美精品| 欧美天堂亚洲电影院在线播放| 欧美日韩另类一区| 亚洲毛片av在线| 色网综合在线观看| 亚洲成人自拍网| 欧美精品一区二区三区高清aⅴ| 日韩视频免费观看高清完整版| 久久中文字幕电影| 狠狠色丁香婷婷综合| 久久亚洲免费视频| 国产福利91精品| 亚洲天天做日日做天天谢日日欢 | 欧美成人午夜电影| 激情综合色丁香一区二区| 国产三级三级三级精品8ⅰ区| 久久国产精品一区二区| 久久综合久色欧美综合狠狠| 国产传媒一区在线| 伊人性伊人情综合网| 欧美日韩国产一级片| 精品亚洲国内自在自线福利| 国产欧美一区二区三区鸳鸯浴| 99re热这里只有精品视频| 午夜精品久久久久久久久久 | 亚洲愉拍自拍另类高清精品| 7777精品伊人久久久大香线蕉超级流畅| 午夜伊人狠狠久久| 综合电影一区二区三区| 欧美一级一级性生活免费录像| 成人综合在线网站| 久久精品99久久久| 亚洲综合丝袜美腿| 中文字幕在线观看一区| 色综合亚洲欧洲| 日韩一卡二卡三卡| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 91精品国产综合久久久久久久 | 日韩限制级电影在线观看| 99精品国产99久久久久久白柏| 蜜臀久久99精品久久久久久9| 中文字幕中文字幕在线一区 | 在线免费av一区| 国产乱理伦片在线观看夜一区| 日本亚洲三级在线| 久久国产剧场电影| 成人深夜在线观看| 91视频观看视频| 欧美剧在线免费观看网站| 在线精品视频小说1| 欧美午夜一区二区三区| 91精品国产综合久久精品图片| 精品视频在线看| 精品国产一区a| 自拍偷拍亚洲激情| 亚洲成人免费看| 国产精品1区2区3区| 91蝌蚪porny九色| 91精品国产色综合久久久蜜香臀| 日韩欧美中文字幕制服| 欧美激情在线免费观看| 亚洲一区在线电影| 国产一区二区电影| 欧美在线免费观看亚洲| 日韩免费在线观看| 亚洲1区2区3区视频| 成人免费高清在线观看| 7777精品伊人久久久大香线蕉的 | 国产一区二区精品久久99| 99久久伊人久久99| 国产欧美日韩三级| 麻豆视频一区二区| 精品视频资源站| 亚洲va欧美va人人爽午夜| 成人在线视频首页| 久久综合一区二区| 美国毛片一区二区三区| 欧美一区二区在线视频| 一区二区在线观看视频| 国产成人av一区二区三区在线| 国产精品一区二区久久不卡| 91亚洲男人天堂| 亚洲蜜桃精久久久久久久| 国产超碰在线一区| 亚洲国产精品精华液2区45| 精品无人码麻豆乱码1区2区| 欧美日韩一级片网站| 亚洲成人黄色影院| 欧美一区午夜视频在线观看| 日日欢夜夜爽一区| 欧美成人欧美edvon| 成人午夜激情在线| 亚洲高清中文字幕|