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

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

?? mouse45.asm

?? USB大全電子版全部資料3~包含源碼、協議等
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
	mov A, [vertical]	

	mov [vert_position], A

	mov A, [buttons]	

	mov [button_position], A	

	iord USB_EP1_TX_Config

	and A, DataToggle		; keep the data 0/1 bit

	or A, 93h			; enable transmit 3 bytes

	iowr USB_EP1_TX_Config



      mov A,[new_idle_flag]  ;if it received a new idle

      cmp A,0                   ;period 4 ms before the previous one

      jz prev_idle              ;counted finishes, need to upgrade

      mov A,[new_idle_period]   ;with a new value

	mov [idle_period],A

      mov A,0

      mov [new_idle_flag],A 

	jmp reset_idle_period_counter 

prev_idle:                     ;

;      mov A,[prev_idle_period]

;      mov [idle_period],A



reset_idle_period_counter: 

      mov A,0

      mov [idle_period_counter],A

	mov [horizontal], A

	mov [vertical], A

	mov [button_flag], A

Nosend:

	jmp main



;========================================================================

; Read the mouse buttons.  If the buttons have changed from the last

; value read, then enable data transmission from endpoint one.

;

; Hardware has buttons in MRL order.  We need to translate them

; to data bits [2:0].

;

;       Port 0 bit[6]   Middle  => bit 2

;       Port 0 bit[5]   Right   => bit 1

;       Port 0 bit[4]   Left    => bit 0

;

ReadButtons:

	mov A, [button1_deb]

	cmp A, 0h

	jnz DoneButtons



	mov A, [port_temp]

	cpl A				; buttons are now 1 when pressed



	asr				; [6:4] => [5:3]

	asr				; [5:3] => [4:2]

	asr				; [4:2] => [3:1]

      asr                     ; [3:1] => [2:0]

      and A, 7h               ; mask out non-buttons

	

	cmp A,[buttons]		; have buttons changed?

	jz DoneButtons



	mov [buttons], A		; move buttons to dma buffer

	mov A, 01h

	mov [button_flag], A

	mov A, 01h

	mov [button1_deb], A



DoneButtons:

	ret				; return to main loop



;========================================================================

; This is a state transition table (16 bytes) that has four input bits:

; 	bit [3:2]	previous state

;	bit [1:0]	current state

;

; The state sequences are:

;	00 => 01 => 11 => 10	increment

;	00 => 10 => 11 => 01	decrement

;

;	00 00 =>  0	00 01 =>  1	00 10 => -1	00 11 =>  0

;	01 00 => -1	01 01 =>  0	01 10 =>  0	01 11 =>  1

;	10 00 =>  1	10 01 =>  0	10 10 =>  0	10 11 => -1

;	11 00 =>  0	11 01 => -1	11 10 =>  1	11 11 =>  0

; 

; The count stays the same if either the states are the same or the

; state changed by two transitions (jump).   

;

	XPAGEOFF		; do not insert XPAGE instructions in a table

StateTable:

	db  0,  1, -1,  0

	db -1,  0,  0,  1

	db  1,  0,  0, -1 

	db  0, -1,  1,  0

	XPAGEON		; insert XPAGE instructions automatically



; If the wheels are configured backwards the StateTable matrix

; 1's and -1's should be exchanged to flip the x and y directions.

; If only one direction has its wheels configured backwards then

; two seperate StateTables should be used and one of them will

; need the 1 to -1 and vice versa exchange.

; A wheel is configured backwards if the two phototransistors 

; associated with it are connected in opposite order to this

; reference design.



;========================================================================

; Check for horizontal movement of the mouse.

;

CheckHorizontal:

	mov A, [port_temp]	; load current state

	and A, 3h			; mask out the rest of the bits

	push A			; save the current state on stack

	or A, [horiz_state]	; include the previous state

	index StateTable		; read increment from PROM	



	add A, [horizontal]	; add increment

	mov [horizontal], A	



	pop A				; restore current state from stack

	asl				; bit[1:0] => bit[2:1]

	asl				; bit[2:1] => bit[3:2]

	mov [horiz_state],A	; update previous state in memory

	ret

;========================================================================

; Check for vertical movement of the mouse.  The first time I tried this,

; the horizontal movement worked and the vertical movement was backward.

; To correct the problem, the current and next states are switched in the

; check vertical routine when compared with the horizontal states.

;

CheckVertical:

	mov A, [port_temp]	; load current state

	and A, 0ch			; mask out the rest of the bits

	push A			; save the current state on stack

	or A, [vert_state]	; include the previous state

	index StateTable		; read increment from PROM	



	add A, [vertical]		; add increment

	mov [vertical], A	



	pop A				; restore current state from stack

      asr A                   ; bit[3:2] => bit[2:1]

      asr A                   ; bit[2:1] => bit[1:0]

      mov [vert_state],A	; update previous state in memory

	ret





;*******************************************************

;

;	Interrupt handler: endpoint_zero

;	Purpose: This interrupt routine handles the specially

;		 reserved control endpoint 0 and parses setup 

;		 packets.  If a IN or OUT is received, this 

;		 handler returns to the control_read

;		 or no_data_control routines to send more data.

;

;*******************************************************

;========================================================================

; The endpoint zero interrupt service routine supports the control

; endpoint.  This firmware enumerates and configures the hardware.

USB_EP0_ISR:

      push A                  		; save accumulator on stack

	iord USB_EP0_RX_Status			; load status register into accumulator

	and A, 01h					; check if SETUP packet received

	jz ep0_continue				; ignore unless SETUP packet 

	mov A,[interrupt_mask]			; disable endpoint zero interrupts

	and A, 0F7h

	mov [interrupt_mask], A

	iowr Global_Interrupt

      call StageOne           		; parse SETUP packet

	mov A, [interrupt_mask]			; enable endpoint zero interrupts

	or A, 08h

	mov [interrupt_mask], A	

ep0_continue:

	mov A, [interrupt_mask]			; enable the interrupts

	ipret Global_Interrupt



;========================================================================

;       stage one ... test bmRequestType

;========================================================================

StageOne:

;------------------------------------------------------------------------

; Parse standard device requests as per Table 9.2 in USB Spec.

;------------------------------------------------------------------------

	mov A, 00h					; clear the setup flag to write DMA

	iowr USB_EP0_RX_Status

	mov A, 8					; set BadOut bit

	iowr USB_Status_Control

      mov A, [bmRequestType]  		; load bmRequestType

; host to device

        cmp A, 00h

        jz RequestType00        		; bmRequestType = 00000000 device

;       cmp A, 01h              		*** not required ***  

;       jz RequestType01        		; bmRequestType = 00000001 interface

        cmp A, 02h              

        jz RequestType02        		; bmRequestType = 00000010 endpoint

        cmp A, 80h             

; device to host

        jz RequestType80        		; bmRequestType = 10000000 device

        cmp A, 81h

        jz RequestType81       		; bmRequestType = 10000001 interface

        cmp A, 82h

        jz RequestType82       		; bmRequestType = 10000010 endpoint

;-----------------------------------------------------------------------

; Parse HID class device requests as per HID version 1.0 Draft #4

;-----------------------------------------------------------------------

; host to device

        cmp A, 21h

        jz RequestType21        		; bmRequestType = 00100001 interface

        cmp A, 22h             		; *** not in HID spec ***

        jz RequestType22       		; bmRequestType = 00100010 endpoint

; device to host

        cmp A, A1h

        jz RequestTypeA1        		; bmRequestType = 10100001 interface

        cmp A, A2h				; *** not in HID spec ***

        jz RequestTypeA2        		; bmRequestType = 10100010 interface



;-----------------------------------------------------------------------

; Stall unsupported functions

;-----------------------------------------------------------------------

SendStall:						; stall unsupported functions

      mov A, A0h					; send a stall to indicate the requested

	iowr USB_EP0_TX_Config			; function is not supported

      ret                    			; return

;========================================================================

;       stage two ... test bRequest

;========================================================================

; host to device with device as recipient

RequestType00:

	mov A, [bRequest]	; load bRequest

;------------------------------------------------------------------------

; The only standard feature defined for a "device" recipient is

; device_remote_wakeup.  Remote wakeup is the ability to "wakeup" a

; system from power down mode by pressing a key or moving a button.

; The default condition at reset is remote wakeup disabled.

;------------------------------------------------------------------------

; Clear Feature                 	bRequest = 1

        cmp A, clear_feature

        jz ClearRemoteWakeup 

; Set Feature 				bRequest = 3

	cmp A, set_feature

        jz SetRemoteWakeup

;------------------------------------------------------------------------

; Set the device address to a non-zero value.

; Set Address 				bRequest = 5

	cmp A, set_address

	jz SetAddress

;------------------------------------------------------------------------

; This request is optional.  If a device supports this request, existing

; device descriptors may be updated or new descriptors may be added.

; Set Descriptor                bRequest = 7    *** not supported ***

;------------------------------------------------------------------------

; If wValue is zero, the device is unconfigured.  The only other legal

; configuration for this version of firmware is one.

; Set Configuration 		bRequest = 9

	cmp A, set_configuration

	jz SetConfiguration

    	jmp SendStall           ; stall unsupported function calls

                                                       

;========================================================================

; host to device with interface as recipient    *** not required ***

; RequestType01:

;        mov A, [bRequest]       ; load bRequest

;------------------------------------------------------------------------

; There are no interface features defined in the spec.

; Clear Feature                 bRequest = 1    *** not supported ***

; Set Feature                   bRequest = 3    *** not supported ***

;------------------------------------------------------------------------

; This request allows the host to select an alternate setting for the

; specified interface.  As the mouse only has one interface setting,

; this request is not supported.

; Set Interface                 bRequest = 11   *** not supported ***

;        jmp SendStall           ; stall unsupported functions



;========================================================================

; host to device with endpoint as recipient

RequestType02:

	mov A, [bRequest]	; load bRequest

;------------------------------------------------------------------------

; The only standard feature defined for an endpoint is endpoint_stalled.  



; Clear Feature			bRequest = 1

	cmp A, clear_feature

      jz ClearEndpointStall

; Set Feature			bRequest = 3

	cmp A, set_feature

      jz SetEndpointStall

	jmp SendStall		; stall unsupported functions



;=======================================================================

; device to host with device as recipient

RequestType80:

	mov A, [bRequest]		; load bRequest

; Get Status			bRequest = 0

	cmp A, get_status

      jz GetDeviceStatus

; Get Descriptor			bRequest = 6

	cmp A, get_descriptor

	jz GetDescriptor

; Get Configuration		bRequest = 8

	cmp A, get_configuration

	jz GetConfiguration

	jmp SendStall		; stall unsuported functions



;=======================================================================

; device to host with interface as recipient

RequestType81:

	mov A, [bRequest]	; load bRequest

; Get Status			bRequest = 0

      cmp A, get_status

      jz GetInterfaceStatus

;------------------------------------------------------------------------

; This request returns the selected alternate setting for the specified

; interface.  There are no alternate settings for the mouse.

; Get Interface                 bRequest = 10   *** not supported ***

;------------------------------------------------------------------------

; HID class defines one more request for bmRequestType=10000001

; Get Descriptor                bRequest = 6

      cmp A, get_descriptor

      jz GetDescriptor

	jmp SendStall		; stall unsupported functions



;=======================================================================

; device to host with endpoint as recipient

RequestType82:

	mov A, [bRequest]		; load bRequest

; Get Status			bRequest = 0

	cmp A, get_status

      jz GetEndpointStatus

;------------------------------------------------------------------------

; Not defined in the spec, but it must be decoded for the enumeration to

; complete under Memphis.

; Get Descriptor			bRequest = 6

	cmp A, get_descriptor

	jz GetDescriptor

; Sync Frame                  bRequest = 12   *** not supported ***

	jmp SendStall		; stall unsupported functions



;========================================================================

;	Now parse HID class Descriptor Types

;========================================================================

; host to device with endpoint as recipient

RequestType21:

      mov A, [bRequest] 	; load bRequest

; Set Report			bRequest = 9

	cmp A, set_report

	jz SetReport

; Set Idle				bRequest = 10

      cmp A, set_idle

      jz SetIdle

; Set Protocol			bRequest = 11

      cmp A, set_protocol

      jz SetProtocol

	jmp SendStall		; stall unsupported functions



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产综合色精品一区二区三区| 亚洲欧美另类小说| 久久国产精品第一页| 免费观看在线色综合| 91麻豆精品久久久久蜜臀| 日韩不卡免费视频| 日韩一区二区三区电影| 久久综合综合久久综合| 久久久精品人体av艺术| 成人国产电影网| 一区二区三区中文字幕| 69精品人人人人| 精品系列免费在线观看| 国产精品青草综合久久久久99| av毛片久久久久**hd| 亚洲一区二区在线免费观看视频| 欧美福利视频一区| 九九精品视频在线看| 国产精品国产三级国产a| 久久久99久久| 色偷偷88欧美精品久久久| 午夜欧美2019年伦理| 欧美岛国在线观看| 成人一区二区三区在线观看| 一区二区高清免费观看影视大全| 欧美精品在线视频| 国产精品一区二区无线| 尤物视频一区二区| 日韩一二三区不卡| 99国产一区二区三精品乱码| 视频一区视频二区中文| 国产日韩欧美高清在线| 欧美日韩一区成人| 国产乱子伦视频一区二区三区 | 亚洲三级在线免费| 欧美猛男gaygay网站| 国产成人亚洲综合a∨婷婷 | 欧美在线色视频| 久久电影国产免费久久电影 | 最新日韩av在线| 欧美顶级少妇做爰| 成人午夜视频免费看| 日日夜夜精品视频免费| 国产精品久久一级| 91精品蜜臀在线一区尤物| 成人avav影音| 六月丁香婷婷色狠狠久久| 一区二区三区精品视频在线| 久久久久久日产精品| 欧美日本韩国一区| 成人动漫中文字幕| 国产曰批免费观看久久久| 午夜电影一区二区| 国产一区二区三区四区五区入口| 亚洲人成网站影音先锋播放| 久久这里只有精品6| 这里只有精品视频在线观看| 色成人在线视频| 成人午夜又粗又硬又大| 国模一区二区三区白浆| 日韩制服丝袜av| 亚洲综合精品久久| 亚洲视频每日更新| 国产精品卡一卡二| 国产欧美日韩激情| 国产午夜精品福利| 久久亚洲一区二区三区四区| 欧美一区二区三区的| 在线视频一区二区三| 91一区二区三区在线观看| 不卡一区二区中文字幕| 国产乱人伦偷精品视频免下载| 麻豆精品久久久| 日本成人在线一区| 免费在线观看不卡| 日本麻豆一区二区三区视频| 欧美aaaaaa午夜精品| 免费成人在线播放| 蜜臀久久久99精品久久久久久| 日本伊人精品一区二区三区观看方式| 亚洲香肠在线观看| 偷拍日韩校园综合在线| 日本中文字幕一区二区视频 | 欧美一区午夜精品| 777色狠狠一区二区三区| 91精品国产日韩91久久久久久| 51午夜精品国产| 日韩午夜在线观看| 精品久久久久久无| 国产亚洲精品aa午夜观看| 日本一区二区三区视频视频| 欧美国产激情一区二区三区蜜月| 国产农村妇女毛片精品久久麻豆 | 中文字幕成人在线观看| 欧美国产在线观看| 国产精品伦理一区二区| 亚洲男女一区二区三区| 亚洲综合视频在线观看| 偷拍亚洲欧洲综合| 老司机午夜精品99久久| 国产成人日日夜夜| 北岛玲一区二区三区四区 | 欧洲激情一区二区| 欧美日韩国产中文| 精品国产亚洲在线| 国产精品美女久久久久久久久久久 | 99精品视频免费在线观看| 一本大道久久a久久综合婷婷| 欧美日韩在线观看一区二区| 欧美一区中文字幕| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲综合网站在线观看| 秋霞午夜av一区二区三区| 国产激情一区二区三区四区 | 亚洲二区视频在线| 精品一二三四区| 91视频在线看| 7777精品伊人久久久大香线蕉最新版| 欧美精品一区男女天堂| 亚洲精品国产精华液| 久久国产婷婷国产香蕉| 一本到三区不卡视频| 欧美电影免费观看高清完整版在线观看 | 久久久久久久久久电影| 一区二区三区免费网站| 国产综合久久久久影院| 欧美三区免费完整视频在线观看| 日韩精品一区二区三区三区免费| 1024成人网| 极品少妇xxxx精品少妇| 欧美在线一区二区三区| 国产片一区二区三区| 日产国产高清一区二区三区| 91小视频免费观看| 337p日本欧洲亚洲大胆色噜噜| 亚洲综合免费观看高清完整版在线 | 欧美成人bangbros| 亚洲精品国产无天堂网2021| 国产成人av电影| 欧美一区二区三区视频在线观看 | 欧美一区二区三区四区五区| 中文字幕亚洲视频| 国产在线观看免费一区| 91精品在线麻豆| 亚洲国产成人精品视频| 99国产精品久久久久| 26uuu欧美| 蜜桃视频一区二区三区 | 日日夜夜精品免费视频| 91亚洲精品一区二区乱码| 国产女主播在线一区二区| 久久99在线观看| 7777精品伊人久久久大香线蕉完整版| 亚洲欧美日韩在线不卡| 成人黄色在线网站| 国产亚洲人成网站| 国产一区二区三区四| 精品国产一区二区三区不卡| 久久精品理论片| 91.xcao| 日韩影视精彩在线| 欧美伦理视频网站| 亚洲成a人片在线观看中文| 色呦呦国产精品| 亚洲视频一区二区在线| 91欧美激情一区二区三区成人| 国产精品久久久久婷婷二区次| 成人免费高清视频在线观看| 国产午夜亚洲精品午夜鲁丝片 | 国产精品主播直播| 欧美电影免费观看完整版| 久久99九九99精品| 日韩欧美高清一区| 极品尤物av久久免费看| 久久久精品黄色| 国产成人精品免费看| 国产精品色呦呦| 99久久精品久久久久久清纯| 亚洲精选视频免费看| 欧美日免费三级在线| 日本不卡一区二区三区| 欧美成va人片在线观看| 国产精品一区二区久久精品爱涩| 久久精品亚洲麻豆av一区二区| 国产精品白丝av| 国产精品色一区二区三区| 色域天天综合网| 午夜激情久久久| 久久综合色8888| 不卡的av电影| 亚洲综合激情网| 精品久久久久一区| 成人国产精品免费观看动漫 | 日日夜夜精品视频免费| 26uuu国产日韩综合| 成人app在线观看| 亚洲图片有声小说| 日韩精品一区二区三区视频| 成人av网站在线| 五月天网站亚洲|