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

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

?? simul101.asm

?? 《c語言高級實例解析》光盤所附源代碼
?? ASM
字號:
;
; This function simulates the scan codes of the 101 keyboard on older 83/84 key
; keyboard systems that lack bios support for some often used 101 keyboard
; control key combinations.  I miss being able to use the Control+Up, which is
; one of the key combinations that the old BIOS does not support on my old
; machine at home.  Not all of the 101 keys are simulated.
;
; To see if control+up is pressed, we have to look at the keyboard status flags
; in the bios data area.  The flags at byte 0040:0017 are as follows:
;
;   Bit
;    7   Insert state  1 = active,  0 = inactive
;    6   Caps Lock     1 = active,  0 = inactive
;    5   Num Lock      1 = active,  0 = inactive
;    4   Scroll Lock   1 = active,  0 = inactive
;    3   Alt Shift     1 = active,  0 = inactive
;    2   Ctrl Shift    1 = active,  0 = inactive
;    1   Left Shift    1 = active,  0 = inactive
;    0   Right Shift   1 = active,  0 = inactive
;
; We are only concerned with bits 0-3, the shift status bits.  At label "k1"
; in this routine, the status byte is tested with 0x0f.  With simple tests,
; the status of the shift keys can be determined.  Then, it easy to use the
; tables to translate (XLAT) the raw key codes to extended scan codes.
;
; This function was designed to be linked with C object code.  The prototype
; for this function is far so it may be easily used with any memory model.
;
; For those of you (like me) who use keyboard speed up or other keyboard TSRs
; on XT's, you will find that those TSRs do not work with simulated scan codes
; generated by this utility.  This function grabs the raw keys before the TSR
; gets them and they don't get passed to the TSR.  This is the reason I mapped
; the "Keypad -" and "Keypad +" to the scroll up and scroll down functions -
; they aren't filtered by this function and get through to the typefast (TSR)
; utilities, so you can scroll really fast thru files.
;
; See:
;
;   Technical Reference for the Personal Computer AT, IBM Corporation,
;      Boca Raton, Florida, USA., 1984, First Edition (March 1984),
;      IBM part no. 1502243 and 1502494, pp. 1-31 thru 1-43,
;      pp. 4-1 thru 4-24, pp. 5-27 thru 5-32, pp. 5-115 thru 5-121, and
;      pp. 5-169 thru 5-170.
;
;   Microsoft Macro Assembler, Version 6.0, Reference, Microsoft Corporation,
;      Redmond, Washington, 1991, Document No. LN06557-0291, pp 194-195.
;
;   User's Guide and Reference for the MS-DOS Operating System, Version 5.0,
;      Microsoft Corporation, Redmond, Washington, 1991,
;      Document No. SY07661/20885-0391, pp. 623-637.
;
;
; Assembler flags:
;
;      QuickAssembler:   qcl /c simul101.asm
;            MASM 6.0:   ml /c /Cp /Zm simul101.asm
;
; Editor name:   TDE, the Thomson-Davis Editor.
; Author:        Frank Davis
; Date:          June 5, 1991, version 1.0
; Date:          July 29, 1991, version 1.1
; Date:          October 5, 1991, version 1.2
; Date:          January 20, 1992, version 1.3
; Date:          February 17, 1992, version 1.4
; Date:          April 1, 1992, version 1.5
; Date:          June 5, 1992, version 2.0
; Date:          October 31, 1992, version 2.1
;
; This code is released into the public domain, Frank Davis.  You may
; distribute it freely.

kb_data_port    EQU     60h
kb_cntl_port    EQU     61h

bios_data       SEGMENT AT 40h
                ORG     17h
kb_status       DB      ?
                ORG     1ah
buffer_head     DW      ?
buffer_tail     DW      ?
                ORG     80h
buffer_start    DW      ?
buffer_end      DW      ?
bios_data       ENDS


_TEXT   SEGMENT WORD PUBLIC 'CODE'
        ASSUME  cs:_TEXT, ds:NOTHING, es:bios_data
        public  _simulate_enh_kbd


;
; Prototype this function as far in the C header file so it may be used easily
; with any memory model.  See the last section in tdefunc.h for more info.
;
_simulate_enh_kbd       PROC    FAR
        jmp     initialize


; Map the keys starting at scan code 47h, which is the Home key.  This routine
; DOES NOT return most of these values from systems with a 101 enhanced keyboard
; connected, but the codes are included here for reference.  One should use the
; extended BIOS keyboard services with the 101 keyboard and not this function.
; Indeed, tde uses the extended BIOS if a 101 keyboard is detected.
;
; These tables are patterned after the ones in the IBM AT Technical Reference
; Manual, page 5-170 (the system bios listing), labels k8 thru k15.
;
;       Home   = 47h    Left   = 4bh    End   = 4fh    Del    = 53h   F11 = 57h
;       Up     = 48h    Center = 4ch    Down  = 50h    SysReq = 54h   F12 = 58h
;       PgUp   = 49h    Right  = 4dh    PgDn  = 51h    ---    = 55h
;       Grey - = 4ah    Grey + = 4eh    Ins   = 52h    ---    = 56h
;
;               47,  48,  49,  4a,  4b,  4c,  4d,  4e,  4f,  50,  51,  52,
;               53   54,  55,  56,  57,  58
ttable:
        DB      -1,  -1,  -1,  -1,  -1,  76,  -1,  -1,  -1,  -1,  -1,  -1
        DB      -1,  -1,  -1,  -1, 133, 134
shift_table:
        DB      -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1
        DB      -1,  -1,  -1,  -1, 135, 136
ctrl_table:
        DB      -1, 141,  -1, 142,  -1, 143,  -1, 144,  -1, 145,  -1, 146
        DB     147,  -1,  -1,  -1, 137, 138
alt_table:
        DB      -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1
        DB      -1,  -1,  -1,  -1, 139, 140

old_int_9       DW      ?,?     ; space for old interrupt

start:
        sti
        push    ax      ; push the registers we use
        push    bx
        push    dx
        push    ds
        push    es

        in      al, kb_data_port        ; let's look at the waiting key

        cmp     al, 0fh         ; is it equal to tab?
        je      special         ; yes, let's check for alt

        cmp     al, 1ah         ; is it less than "[{"?
        jb      pop_out_9       ; yes, let regular int handle it
        cmp     al, 1bh         ; is it less than "]}"?
        jbe     special         ; yes, let's check for alt

        cmp     al, 27h         ; is it less than ";:"?
        jb      pop_out_9       ; yes, let regular int handle it
        cmp     al, 29h         ; is it less than "`~"?
        jbe     special         ; yes, let's check for alt

        cmp     al, 33h         ; is it less than '<'?
        jb      pop_out_9       ; yes, let regular int handle it
        cmp     al, 35h         ; is it less than '?'?
        jbe     special         ; yes, let's check for alt

        cmp     al, 47h         ; is it less than home?
        jb      pop_out_9       ; yes, let regular int handle it
        cmp     al, 80h         ; is it less than a break code?
        jb      k1              ; yes, let's look at this key - a keypad key
        ALIGN   2
pop_out_9:
        jmp     regular_int_9   ; default - let regular int 9 handle break codes
                                ; and other stuff

k1:
        mov     dx, 0040h       ; segment of bios data area
        mov     es, dx          ; put it in es
        mov     dl, BYTE PTR es:kb_status  ; get shift status of alt & ctrl keys
        test    dl, 0fh         ; & it with 0x0f to see if any shift keys down
        jnz     k2              ; one of the shift keys is pressed - find it
        mov     bx, OFFSET ttable       ; get offset of table
        jmp     SHORT k5        ; no shift keys were down, translate normal keys
k2:
        test    dl, 03h                 ; are the left or right shift keys down?
        jz      k3                      ; not pressed, must be a ctrl or an alt
        mov     bx, OFFSET shift_table  ; get offset of shift table
        jmp     SHORT k5
k3:
        test    dl, 04h                 ; is the control shift key down?
        jz      k4                      ; not pressed, must be an alt
        mov     bx, OFFSET ctrl_table   ; get offset of control table
        jmp     SHORT k5
k4:
                                        ; the only shift key left is alt
        mov     bx, OFFSET alt_table    ; get offset of alt table
        ALIGN   2
k5:
        sub     al, 47h         ; normalize key to zero

        mov     dx, cs          ; put code segment in dx
        mov     ds, dx          ; now transfer code segment to ds

        xlat                    ; table look up
        cmp     al, -1          ; is it -1?
        je      regular_int_9   ; yes, let regular interrupt 9 handle it

        mov     ah, al          ; put copy of character in ah
        xor     al, al          ; zero out scan code - simulate extended key
        jmp     SHORT k7
        ALIGN   2
special:
        mov     dx, 0040h       ; segment of bios data area
        mov     es, dx          ; put it in es
        mov     dl, BYTE PTR es:kb_status  ; get shift status of alt & ctrl keys
        test    dl, 08h         ; & it with 0x08 to see if the alt key is down
        jnz     k6              ; alt key is down, let's do the special case
        jmp     SHORT regular_int_9     ; otherwise goto regular interrupt 9
        ALIGN   2
k6:
        mov     ah, al          ; put the scan code in ah
        xor     al, al          ; zero out al
        cmp     ah, 0fh         ; was Alt-Tab pressed?
        jne     k7              ; no, nothing else needs to be done
        mov     ah, 0a5h        ; extended code for tab is 0xa500
;
; We now have a key we want to emulate.  Put it in the keyboard buffer and
; end our interrupt.
;
k7:
        mov     bx, WORD PTR es:buffer_tail     ; get the end pointer to buffer
        mov     dx, bx                          ; save in dx
        inc     dx                              ; move to next word in list
        inc     dx
        cmp     dx, WORD PTR es:buffer_end      ; at end of buffer?
        jnz     ck_full_kbd                     ; if no, continue
        mov     dx, WORD PTR es:buffer_start    ; yes, reset to buffer start
        ALIGN   2

ck_full_kbd:
        cmp     dx, WORD PTR es:buffer_head     ; has the buffer wrapped?
        jz      end_int_9       ; yes, kbd full - enable keyboard for next key
        mov     WORD PTR es:[bx], ax    ; store simulated key into kbd buffer
        mov     WORD PTR es:buffer_tail, dx     ; move the tail up for next key
        ALIGN   2

end_int_9:
        cli                     ; no interrupts now
        mov     al, 20h         ; end of interrupt command
        out     20h, al         ; send command to interrupt control port
        sti                     ; enable interrupts - see IBM tech. ref. man.
        in      al, kb_cntl_port        ; get char from control port
        mov     ah, al                  ; save it in ah
        or      al, 80h                 ; set bit 7
        out     kb_cntl_port, al        ; output reset value
        mov     al, ah                  ; send original value
        jmp     SHORT $+2               ; take your time
        out     kb_cntl_port, al        ; send it to enable keyboard
        pop     es              ; restore registers
        pop     ds
        pop     dx
        pop     bx
        pop     ax
        iret                    ; return from interrupt
regular_int_9:
        pop     es              ; restore registers
        pop     ds
        pop     dx
        pop     bx
        pop     ax
        jmp     DWORD PTR old_int_9     ; no interrupt return - old one does it

; ***********************************************************************
; prototype for _simulate_enh_kbd is
;
;               void far simulate_enh_kbd( int )
;
; The formal parameter is available on the stack.  Use the bp register to
; access it.
;
; Passing any non-zero value will make this function grab interrupt 9.
; Pass a zero to this function to restore the old interrupt 9.
;
; If this function were really clever, it would have a "unique" signature.
; Before "installing", it would check to see if it was already installed.
; Similarly, before "uninstalling", this function would check to make sure
; it was installed so it wouldn't uninstall the regular interrupt 9
; handler by accident.  What the hell, live dangerously.
;
; ***********************************************************************

initialize:
        push    bp
        mov     bp, sp

        mov     dx, [bp+6]      ; put the parameter in dx

        push    ds
        ASSUME  es:_TEXT,ds:_TEXT
        mov     ax, cs          ; put cs in ds
        mov     es, ax
        mov     ds, ax

        cmp     dx, 0           ; 'NULL' character unhooks interrupt 9
        je      restore_9       ; any non NULL character grabs interrupt 9
grab_9:
        mov     ax, 3509h       ; get old interrupt 9 location
        int     21h             ; call MSDOS to get it
        mov     WORD PTR old_int_9, bx          ; save old int 9 offset
        mov     WORD PTR old_int_9+2, es        ; save old int 9 segment

        mov     dx, OFFSET start        ; get new offset of int 9
        mov     ax, 2509h               ; use function 25 so int 9 points
        int     21h                     ;  to my routine
        jmp     SHORT get_out           ; continue with editor

restore_9:
        mov     dx, WORD PTR old_int_9          ; get offset of old int 9
        mov     ax, WORD PTR old_int_9+2        ; get segment of old int 9
        mov     ds, ax                          ;  put segment in ds
        mov     ax, 2509h                       ; restore old int 9
        int     21h

get_out:
        pop     ds              ; clean up
        pop     bp
        retf
_simulate_enh_kbd       endp
_TEXT   ends
        end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产中文一区二区三区| 国产一区二区精品久久| 精品成a人在线观看| 欧美中文字幕一二三区视频| 日本欧美一区二区三区乱码| 自拍偷拍亚洲欧美日韩| 国产女主播在线一区二区| 色菇凉天天综合网| 国产91高潮流白浆在线麻豆 | 亚洲另类中文字| 中文字幕一区二区5566日韩| 日本一区二区综合亚洲| 精品国产第一区二区三区观看体验| 欧美日韩在线播放三区| 99国产精品国产精品久久| 国产精品综合一区二区三区| 老司机免费视频一区二区| 国产精品久久久久久久久搜平片 | 国产亚洲制服色| 91精品国产综合久久香蕉麻豆| 91亚洲国产成人精品一区二三 | 国产精品私人自拍| 久久精子c满五个校花| 久久女同互慰一区二区三区| 精品久久一区二区三区| 日韩视频在线永久播放| 欧美成人vps| 国产人成一区二区三区影院| 久久久久久久电影| 国产精品久久久久久久午夜片| 中文字幕在线播放不卡一区| 亚洲私人黄色宅男| 亚洲高清久久久| 日韩激情一区二区| 婷婷综合五月天| 麻豆极品一区二区三区| 国产盗摄视频一区二区三区| 日本高清视频一区二区| 欧美欧美午夜aⅴ在线观看| 精品国产一区二区精华| 自拍视频在线观看一区二区| 久久99精品网久久| voyeur盗摄精品| 高清成人在线观看| 欧美制服丝袜第一页| 日韩免费高清视频| 亚洲欧洲成人av每日更新| 天天色天天操综合| 粉嫩绯色av一区二区在线观看| 91偷拍与自偷拍精品| 91精品国产综合久久精品| 国产日韩亚洲欧美综合| 亚洲精品视频在线看| 亚洲123区在线观看| 久久国产精品99久久人人澡| 成人免费毛片a| 91精品国产福利在线观看| 国产亚洲女人久久久久毛片| 五月综合激情网| 久久精品国产久精国产| 在线观看日韩电影| 日本一区二区视频在线观看| 亚洲免费在线看| 国产精品白丝av| 欧美午夜在线一二页| 国产精品色哟哟网站| 奇米777欧美一区二区| 欧美一区二区在线视频| 亚洲18女电影在线观看| 欧美三级日韩在线| 亚洲国产中文字幕在线视频综合| 99久久er热在这里只有精品15| 国产天堂亚洲国产碰碰| 国产美女娇喘av呻吟久久| 久久综合九色综合欧美就去吻| 麻豆成人91精品二区三区| 日韩欧美一卡二卡| 老司机精品视频导航| 日韩一区二区三区高清免费看看| 五月激情综合色| 日韩欧美中文一区| 久久 天天综合| 国产欧美一区二区精品性色超碰 | 狠狠色狠狠色合久久伊人| 日韩免费在线观看| 国产成人精品亚洲午夜麻豆| 国产精品日韩精品欧美在线| 91免费看`日韩一区二区| 成人欧美一区二区三区白人| 色综合天天天天做夜夜夜夜做| 一区二区高清在线| 欧美日韩欧美一区二区| 美女www一区二区| 久久色.com| zzijzzij亚洲日本少妇熟睡| 亚洲最大的成人av| 日韩欧美在线一区二区三区| 国产乱一区二区| 亚洲欧美视频在线观看| 欧美另类高清zo欧美| 经典三级一区二区| 亚洲青青青在线视频| 91精品国产福利在线观看| 国产精品一区二区无线| 玉米视频成人免费看| 日韩欧美国产综合一区 | 午夜电影网一区| 亚洲国产精品综合小说图片区| 欧美日韩免费在线视频| 看片的网站亚洲| 国产精品电影一区二区| 91精品婷婷国产综合久久竹菊| 国产美女久久久久| 首页国产丝袜综合| 国产精品女人毛片| 日韩欧美国产一区在线观看| 99久久综合99久久综合网站| 亚洲综合久久av| 国产视频一区二区在线观看| 欧美午夜免费电影| 国产成人鲁色资源国产91色综| 午夜国产不卡在线观看视频| 综合久久久久久| 久久精品夜色噜噜亚洲aⅴ| 欧美日韩一级片在线观看| 成人av午夜影院| 国产综合色产在线精品| 亚洲1区2区3区4区| 亚洲另类在线一区| 日本一区二区在线不卡| 久久婷婷色综合| 日韩你懂的在线观看| 欧美专区日韩专区| 色哟哟国产精品| 成人午夜激情视频| 国产iv一区二区三区| 韩国理伦片一区二区三区在线播放| 亚洲自拍偷拍av| 亚洲精品乱码久久久久| 中文字幕av不卡| 国产片一区二区三区| 久久精品欧美一区二区三区麻豆| 欧美电影一区二区| 欧美老年两性高潮| 欧美日韩电影在线播放| 日本韩国精品一区二区在线观看| 99久久伊人久久99| 99久精品国产| 一本大道久久a久久综合| gogo大胆日本视频一区| www.欧美日韩国产在线| av一本久道久久综合久久鬼色| 成人在线视频一区二区| 国产激情视频一区二区三区欧美 | 日韩精品一二区| 无吗不卡中文字幕| 婷婷开心激情综合| 视频一区二区三区入口| 午夜精品一区二区三区免费视频 | 欧美人成免费网站| 欧美一区二区三区视频免费播放| 正在播放一区二区| 日韩一区二区三区视频在线| 91精品国产91综合久久蜜臀| 日韩一区二区在线播放| 2021国产精品久久精品| 久久久国产午夜精品| 亚洲国产精品v| 亚洲老妇xxxxxx| 男男视频亚洲欧美| 国产精品99久久久久久似苏梦涵| 精品一区二区三区在线观看| 国产精品一卡二| 91色porny在线视频| 欧美日韩视频在线第一区 | 亚洲国产视频直播| 蜜桃传媒麻豆第一区在线观看| 国内精品久久久久影院色| 成人精品亚洲人成在线| 欧美中文字幕一区| 精品欧美一区二区在线观看| 日韩影视精彩在线| 国产乱妇无码大片在线观看| 99久久久免费精品国产一区二区| 在线观看日韩毛片| 日韩视频123| 亚洲日本在线天堂| 免费观看在线色综合| 不卡高清视频专区| 91精品国产综合久久精品图片 | 欧美日韩中文另类| 26uuu国产在线精品一区二区| 成人欧美一区二区三区视频网页| 日韩高清国产一区在线| 成人18精品视频| 日韩欧美一区二区不卡| 亚洲最大成人综合| 成年人国产精品| 欧美一区2区视频在线观看| 成人免费在线视频观看|