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

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

?? emb_f.asm

?? mcs51,2051,x86系列MCU
?? ASM
?? 第 1 頁 / 共 5 頁
字號:
        lcall   Ep3TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG12 == 1)
$$IF$ (EPADDR12 == 3)
$$IFN$ (EPATT12 == 1)
        jnb     FRXD3,  EXIT_FUNCTION_ISR
        mov     EPINDEX,#03
        lCall   Ep3RxLoopBack               ; 82930 has received a packet from HC
        lcall   Ep3TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG13 == 1)
$$IF$ (EPADDR13 == 3)
$$IFN$ (EPATT13 == 1)
        jnb     FRXD3,  EXIT_FUNCTION_ISR
        mov     EPINDEX,#03
        lCall   Ep3RxLoopBack               ; 82930 has received a packet from HC
        lcall   Ep3TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG14 == 1)
$$IF$ (EPADDR14 == 3)
$$IFN$ (EPATT14 == 1)
        jnb     FRXD3,  EXIT_FUNCTION_ISR
        mov     EPINDEX,#03
        lCall   Ep3RxLoopBack               ; 82930 has received a packet from HC
        lcall   Ep3TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG15 == 1)
$$IF$ (EPADDR15 == 3)
$$IFN$ (EPATT15 == 1)
        jnb     FRXD3,  EXIT_FUNCTION_ISR
        mov     EPINDEX,#03
        lCall   Ep3RxLoopBack               ; 82930 has received a packet from HC
        lcall   Ep3TxLoopBack
$$END$
$$END$
$$END$
$$IF$ (BENCFG16 == 1)
$$IF$ (EPADDR16 == 3)
$$IFN$ (EPATT16 == 1)
        jnb     FRXD3,  EXIT_FUNCTION_ISR
        mov     EPINDEX,#03
        lCall   Ep3RxLoopBack               ; 82930 has received a packet from HC
        lcall   Ep3TxLoopBack
$$END$
$$END$
$$END$

        mov     A, FIFLG                      ; Check to see if any other Interrupts are pending.
        jz      EXIT_FUNCTION_ISR
        ljmp    ProcessFunctionEndpoints    ; Look at all Interrupt flags again

;F_EP2_TX:
;        jnb     FTXD2,  F_EP3_TX
;        mov     EPINDEX,#02
;        lCall   EP2_TX_ISR                  ; 82930 has sent a packet to HC
;        jmp     ProcessFunctionEndpoints    ; Look at all Interrupt flags again

;F_EP3_TX:
;        jnb     FTXD3,  EXIT_FUNCTION_ISR
;        mov     EPINDEX,#03
;        lCall   EP3_TX_ISR                  ; 82930 has sent a packet to HC
;        jmp     ProcessFunctionEndpoints    ; Look at all Interrupt flags again

EXIT_FUNCTION_ISR:
        pop     EPINDEX
        pop     B
        pop     ACC
        pop   PSW1
        pop   PSW

        reti

;COMMENT *------------------------------------------------------------
;Function name     : ProcessOutToken
;Brief Description : Services all OUTs on EP0.
;                  : This routine checks to see if this is an OUT token oor
;                  : SETUP token.  If a SETUP token then the Control COmmand
;                  : State machine is initilized to SETUP STAGE
;Regs preserved    : No reg. is saved
;--------------------------------------------------------------------*
;SCOPE
ProcessOutToken:

        anl     FIFLG,   #EP0_RX_CLR                      ; Clear the interrupt bit.
        jmp     ProcCommand

ProcCommand:
        mov     A,     RXSTAT
        jnb     ACC.6, CheckOutStatusPhase              ; Is this a setup packet??



                                                        ; Now Check for Data still in FIFO.
                                                        ; If this is true then the function
                                                        ; did not see the ACK form the host.
        mov     A,      TXFLG
        anl     A,      #0C0h
        jZ      NoEP0Error

        setb    TXCLR                                    ; Flush the Transmit FIFOS in case
                                                         ; a null packet is still left.

NoEP0Error:
                                                         ; Check to see if the stall bit is set.
        mov     A, EPCON
        anl     A, #0C0h
        jz      NoEp0Stall
        anl     EPCON, #03Fh                             ; Clear the stalls
        orl     TXSTAT, #88h                             ; Set data toggle on TX ep0.
NoEp0Stall:
        lCall   SetupReceived
        setb    RXFFRC                                  ; Update receive FIFO state
        clr     RXSETUP

        jmp     ReturnProcessOutToken

CheckOutStatusPhase:
        mov     A,     gbSetupSeqRX
        cjne    A,     #STATUS_PHASE, CheckDataPhase     ; Is this the status phase of a "GET"
                                                         ; command?

        setb    RXFFRC                                   ; Update receive FIFO state


        mov     A,     #SETUP_PHASE                      ; Update the state machine-Expect
                                                         ; a setup packet
        mov     gbSetupSeqRX, A
        mov     gbSetupSeqTX, A
        jmp     ReturnProcessOutToken

            ;---------------------------------------------------------------
            ; -   Control Write Data Stage
            ;---------------------------------------------------------------

                ; If this is a control write command with a datastage then this
                ; routine will be called on all data stages of the control write.
                ; When all the data has been collected(Bytes received=wLength)
                ; the actual routine is called.  The size of data is limited to this
                ; buffer length.
                ; THE CALLING CODE MUST THEN CALL SetUpControlWriteStatusStage to allow
                ; the status stage to continue.  The user must NOT do this themselves.
                ; Later in the life of this code, other features will be added here.

CheckDataPhase:
        cjne    A,     #DATA_PHASE, BadOutToken
                                       ; Are we processing a Control Write,
                                       ; i.e. Set Descr...
                                       ; Added to handle control writes with data stages.
                                       ; When a control Write with a data stage is detected
                                       ; the data is placed in the buffer 'CntlWriteDataBuffer'
                                       ; When all the data
                                       ; has been collected(Bytes received=wLength) the actual routine is
                                       ; called.  The size of data is limited to this buffer length.
                                       ;---------------------------------------------------------
                                       ;------------------- NOTE --------------------------------
                                       ;---------------------------------------------------------
                                       ; For this routine to work all the data must be stored below
                                       ; 100h as I am using byte addressing.  Also, since 80-FF is used
                                       ; as SFRs and I don't want to for the user to use indirect
                                       ; addressing, the data must ne stored between 20h-7Fh.
                                       ; Also, these routines will only work for data sets of less than
                                       ; 256.  But the above limitations put this the max much ower than
                                       ; this. MaxBuffer = (7F-20h-Other varaibles in this region)


         push    R0
         mov     A,     #CntlWriteDataBuffer         ; Get location of buffer

         add     A,     CntlWriteDataPntr            ; Add the offset
         mov     R0,    A                            ; R0 now contains the location to start storing the
                                                     ; data.

                                                     ; Update the data stored in memory
         mov     A,     RXCNTL                       ; Get number of bytes to move
         add     A,     CntlWriteDataPntr            ; Add number received
         mov     CntlWriteDataPntr,  A               ; update memory variable

         mov     A,     RXCNTL
         JZ      RdDone                              ; If no data in the buffer, then exit.

ReadData:
         mov     @R0,   RXDAT                        ; Get the data and store it.
         inc     R0
         djnz    ACC,   ReadData
         pop     R0
RdDone:
         setb    RXFFRC                              ; Update receive FIFO state

                                                     ; Now check to see if this was the last
                                                     ; read by checking if (Bytes received=wLength)
         mov     A,    CntlWriteDataPntr
         cjne    A,    wLength+1, NeedMoreData       ; If this is not equal to the expected, then jmp around.

                                                     ; When all the data has been received, the
                                                     ; other routines in this program will
                                                     ; be called to process it.
ProcessControlWriteData:

        push     DPX                                 ; Processing the jump table will
                                                     ; corrupt DPX.  Save it here
        lcall    DoJumpTable                         ; At this point all data has been
                                                     ; stored and all we need to do now is to
                                                     ; process it.
        pop      DPX                                 ; Restore DPX
        jmp      ReturnProcessOutToken

NeedMoreData:

CheckCommand2:

BadOutToken:
        orl      EPCON, #0C0h                        ; Who knows what this was.  Stall the EP.
ReturnProcessOutToken:
        Ret


;COMMENT *------------------------------------------------------------
;Function name     : SetupReceived
;Brief Description : Service all Setup Tokens recd. on EP0
;Regs preserved    : No reg. is saved
;--------------------------------------------------------------------*
;SCOPE
SetupReceived:
         mov     A,     RXCNTL                   ; Get the no. of bytes
         clr     CY

         subb    A,     #8                       ; 8 is length of all setup packets.
         JNZ     ReturnSetup                      ; If less than 8 bytes recd.
                                                 ; Return

                                                 ; Since buffer will reside within the
                                                 ; the first 255 bytes, I can use
                                                 ; register indirect addressing
        ; Move FIFO to command buffer.
        ; Notice byte swapping of word fields
        ; For Word Fields make USB Little Endian words->'251 Big Endian words
        clr      EDOVW
        mov      COMMAND_BUFFER,   RXDAT          ; bmRequestType
        mov      COMMAND_BUFFER+1, RXDAT          ; bRequest
        mov      COMMAND_BUFFER+3, RXDAT          ; wValue LSB
        mov      COMMAND_BUFFER+2, RXDAT          ; wValue MSB
        mov      COMMAND_BUFFER+5, RXDAT          ; wIndex LSB
        mov      COMMAND_BUFFER+4, RXDAT          ; wIndex MSB
        mov      COMMAND_BUFFER+7, RXDAT          ; wLength LSB
        mov      COMMAND_BUFFER+6, RXDAT          ; wLength MSB

        push     DPX                              ; Processing the jump table will
                                                  ; corrupt DPX.  Save it here

        lCall    ProcessSetup
        pop      DPX                              ; Restore DPX
ReturnSetup:
        Ret

;COMMENT *------------------------------------------------------------
;Function name     : ProcessSetup
;Brief Description : Process a Setup token recd. on EP0. Thile some of the
;                  : code may look sifficult to understand the end result is not.
;                  : The following simply prepares a byte of data for use in a jump table.
;                  : The code compresses the 8 byte bmRequestValue into 4 1/2
;                  : bits by removing bits 2,3 & 4.  These bits are never used
;                  : and it allows the jump table to be signfigantly smaller.
;                  : By using this jump table, the code size reduces by several
;                  : hundred bytes over the entire code!
;                  : THIS FIRMWARE IS ASSUMES BITS 2,3 & 4 are zero!!!!
;                  : By compressing the byte down, we limit the size
;                  : of the jump table.
;Regs preserved    : No reg. is saved
;--------------------------------------------------------------------*
;SCOPE
ProcessSetup:

        ; The First step is setting up the Stage tracing variable by examing the
        ; bmRequest value.  This will tell us if this is a control Write
        ; or control read command.  For right now we will assume that this
        ; is a no data command and will therefore pre-initilize the data
        ; byte counters used to send data back, to zero.

        mov     gbFControlBufferBytesLeft,     #00h
        mov     gbFControlBufferBytesLeft + 1, #00h
        mov     A,            bmRequestType
        jb      ACC.7,        SetupGetCommand

SetupSetCommand:
        mov     gbSetupSeqRX, #DATA_PHASE        ; Advance State Machine to next state
        mov     gbSetupSeqTX, #STATUS_PHASE
                                                 ; Now check to see if this is a control write with a data stage.
        mov     A,            wLength
        orl     A,            wLength+1
        jz      DoJumpTable                      ; If this is a no data command then process it
        mov     CntlWriteDataPntr, #0            ; Initilize the data pointer for future control write
                                                 ; data stages.
        ret                                      ; If we are expecting data then don't
                                                 ; process the command yet.  Exit and wait
                                                 ; for the rest of the data to come in.



SetupGetCommand:
        mov     gbSetupSeqRX, #STATUS_PHASE      ; Advance State Machine to next state
        mov     gbSetupSeqTX, #DATA_PHASE

DoJumpTable:
        ; This table will jump to the correct subroutine
        ; to handle the type of command contained in bmRequestType
        ; The new jmp table will be compressed by shifting and rotating
        ; out bits, 2,3 & 4.
        ; Place bmRequestType in the following order and then do the jump table
        ; on it.
        ; xx65107x
        ; if bits 65 == 11, Reserved = Error
        ; Unless you have time, don't spend a lot of time tracing the algorythm
        ; It's fancy and it works.  If you don't understand it go ask someone for a quarter.


        mov     A,      bmRequestType            ; Get the value.

        anl     A,      #0E3h                    ; Clear out bits 2,3,4 since
                                                 ; we don't need these
                                                 ; Reg A now looks like 765xxx10
        RL      A                                ; Put bits 1,0,& 7 in new placement
        RL      A                                ; Leave LSB cleared so jump is the number of words.
                                                 ; xxxx1076
CheckBit6:                                       ; 6 is currently in bit 0 position,
        jnb     ACC.0,  CheckBit5                ; Convert it to bit 5 position

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利一区二区| 久久久精品免费网站| av一区二区久久| jlzzjlzz亚洲女人18| www.日本不卡| 97超碰欧美中文字幕| av中文字幕亚洲| 日本电影亚洲天堂一区| 在线观看日产精品| 宅男在线国产精品| 久久亚洲综合色| 国产精品剧情在线亚洲| 亚洲女性喷水在线观看一区| 午夜精品一区在线观看| 久久国产剧场电影| 成人av免费观看| 欧美日韩精品综合在线| 精品电影一区二区| 1024亚洲合集| 日韩经典中文字幕一区| 国产电影一区在线| 欧美午夜一区二区三区免费大片| 日韩一级二级三级| 中文字幕乱码久久午夜不卡| 亚洲一区二区美女| 国产一区在线观看视频| 99久久国产综合精品女不卡| 91精品国产91热久久久做人人| 国产欧美一区二区精品久导航| 亚洲另类春色国产| 国内成+人亚洲+欧美+综合在线| eeuss鲁片一区二区三区在线看| 欧美自拍偷拍午夜视频| 久久久噜噜噜久久中文字幕色伊伊| 中文字幕+乱码+中文字幕一区| 亚洲精品成人悠悠色影视| 九九久久精品视频| 欧美天堂一区二区三区| 欧美激情在线一区二区三区| 五月天一区二区三区| 成人av在线资源| 日韩亚洲欧美在线观看| 亚洲精品成a人| 成人在线一区二区三区| 欧美成人精品二区三区99精品| 亚洲精品自拍动漫在线| 韩国成人在线视频| 欧美日本一道本| 国产精品日日摸夜夜摸av| 婷婷中文字幕综合| 色婷婷av一区二区三区之一色屋| 久久九九久久九九| 久久国产日韩欧美精品| 欧美日韩在线直播| 亚洲人成网站影音先锋播放| 国产剧情一区在线| 精品区一区二区| 日韩电影免费在线| 欧美日韩国产中文| 亚洲一区二区三区四区在线免费观看 | 91色九色蝌蚪| 国产欧美日韩不卡免费| 狠狠色综合色综合网络| 日韩视频一区二区三区在线播放 | 国产精品不卡在线| 国产综合久久久久久鬼色| 欧美一三区三区四区免费在线看| 亚洲福利一二三区| 欧美无砖专区一中文字| 亚洲国产中文字幕| 欧美日韩激情一区二区| 亚洲成人免费视频| 欧美人xxxx| 蜜臀久久久久久久| 国产无遮挡一区二区三区毛片日本 | 久久久精品国产免大香伊| 另类小说图片综合网| 日韩一区二区影院| 精品一区二区久久| 久久婷婷久久一区二区三区| 国产69精品久久久久777| 国产精品三级av在线播放| 97久久超碰国产精品| 亚洲欧洲制服丝袜| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 亚洲色图一区二区三区| 欧美午夜片在线看| 奇米影视一区二区三区小说| 日韩美女视频在线| 国产成人免费在线| 亚洲精品一卡二卡| 日韩亚洲欧美综合| 成人黄色大片在线观看| 一二三四区精品视频| 欧美日韩精品三区| 韩国精品主播一区二区在线观看 | 日韩一二三区不卡| 国产成人啪午夜精品网站男同| 中文字幕亚洲精品在线观看| 欧美亚洲另类激情小说| 免费久久精品视频| 中文无字幕一区二区三区| 一本一本大道香蕉久在线精品| 天天色综合天天| 国产亚洲一二三区| 欧美日韩一区二区三区四区| 国产精品一区二区三区99| 欧美激情一区二区三区不卡| 欧美日韩电影在线播放| 高清国产一区二区| 亚洲成av人片观看| 久久婷婷久久一区二区三区| 欧美综合视频在线观看| 麻豆精品一区二区综合av| 中文字幕在线视频一区| 555www色欧美视频| 色噜噜狠狠成人网p站| 国内精品不卡在线| 日韩精品1区2区3区| 亚洲精品日产精品乱码不卡| 久久综合九色综合欧美98| 欧美日韩国产综合草草| 91片黄在线观看| 国产一区在线视频| 免费高清在线视频一区·| 亚洲欧美在线高清| 中文字幕欧美日本乱码一线二线| 日韩欧美一区中文| 欧美人xxxx| 欧美日韩免费一区二区三区视频| 国产成人福利片| 极品尤物av久久免费看| 视频一区二区国产| 亚洲影视资源网| 欧美激情一区二区三区不卡| 精品国产一区二区国模嫣然| 欧美日韩午夜精品| 在线精品视频一区二区三四| 成人18精品视频| 不卡一区中文字幕| 丁香一区二区三区| 成人一区二区在线观看| 国产精品自拍av| 国产精品中文字幕日韩精品| 美女mm1313爽爽久久久蜜臀| 久久精品国产久精国产| 天天爽夜夜爽夜夜爽精品视频| 亚洲国产成人av网| 午夜激情综合网| 亚洲综合视频网| 亚洲高清视频的网址| 日本一区二区三区久久久久久久久不 | 91福利视频网站| 在线观看91精品国产入口| 欧洲精品在线观看| 欧美专区日韩专区| 欧美日韩国产精品成人| 91精品国产综合久久久久久久久久| 91成人在线精品| 欧美片网站yy| 久久综合九色综合欧美就去吻 | 日本道精品一区二区三区| 91在线porny国产在线看| 色拍拍在线精品视频8848| 欧美日韩一区不卡| 日韩三级视频在线看| xf在线a精品一区二区视频网站| 久久久久久亚洲综合| 一区精品在线播放| 亚洲美女屁股眼交| 日本在线不卡视频一二三区| 狠狠色狠狠色合久久伊人| 国产91富婆露脸刺激对白| 在线视频你懂得一区二区三区| 欧美日韩卡一卡二| 久久久亚洲午夜电影| 亚洲色欲色欲www| 日本视频一区二区三区| 国产成人鲁色资源国产91色综| 色噜噜狠狠色综合欧洲selulu| 欧美一区二区三区四区高清| 国产欧美精品日韩区二区麻豆天美| 亚洲精品一卡二卡| 韩国毛片一区二区三区| 色婷婷综合久久久中文字幕| 欧美大片免费久久精品三p| 国产精品嫩草影院com| 日韩av一二三| 91在线观看地址| 精品国产一区二区亚洲人成毛片 | 欧美无砖砖区免费| 国产亚洲一区字幕| 亚洲高清三级视频| 99热这里都是精品| 日韩欧美不卡在线观看视频| 玉米视频成人免费看| 国产一区日韩二区欧美三区| 欧美日韩精品电影| 亚洲免费av观看| 成人不卡免费av|