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

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

?? serialb.asm

?? USB大全電子版全部資料3~包含源碼、協議等
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
	jz	sendtxBit		; Go send data bit

	cmp	A, txBit5		; tx bit 5 at frame count=14h

	jz	sendtxBit		; Go send data bit.

	cmp	A, txBit6		; tx bit 6 at frame count=17h.

	jz	sendtxBit		; Go send data bit.

	cmp	A, txBit7		; tx bit 7 at frame count=1Ah.

	jz	sendtxBit		; Go send data bit.

	cmp	A, txStop		; tx Stop at frame count=1Dh.

	jz	sendStop		; Go send stop bit.

	cmp	A, txComp		; tx Stop at frame count=20h.

	jz	txEnd			  ; Go send end transmit.

	jmp	check_tx_bit	; Wait for the next interrupt.

;

sendtxBit:

;  Transmit the current data bit and adjust for next pass.

	mov	A, [txData]		  ; Get the current data.

	or	A, txDataMask	  ; Mask out inputs.

	iowr	Port0_Data	  ; Output the current data bit.

	mov	A, [txData]		  ; Get the current data.

	asr	A			          ; Align next data bit.

	mov	[txData], A		  ; Save adjusted data.

	mov	A, FFh		      ; Fill the accumulator.

	mov	[txBitCount], A ; Write to bit counter.

	jmp	check_tx_bit	  ; Wait for next bit time.

;

sendStop:

;  The data has been sent, now send the stop bit.

	mov	A, FFh		      ; Load stop bit.

	iowr	Port0_Data		; Send stop bit.

	jmp	check_tx_bit	  ; Go to end of transmit.

;

txEnd:

;  The last data bit has been sent.

;  Clean up and return. 

	mov	A, 00h		          ; Clear the accumulator.

	mov	[interrupt_mask], A ; Load into the mask.

	iowr	Global_Interrupt	; Disable all interrupts.

	mov	A, 00h		          ; Load tx Start bit.

	mov	[txBitCount], A	    ; Clear tx bit count.

	mov	[txFrameCount], A	  ; Clear tx frame counter.

	mov	[txEnable], A	      ; Clear the tx enadle flag.

	mov	[rxFrameCount], A	  ; Clear rx frame counter.

	pop	A			              ; Restore the accumulator.

	ret				              ; Return to sender.

;

txWait:

;  Wait for the next 128us interrupt.

	mov	A, 02h		          ; Load 128us ISR Enable value.

	iowr	Global_Interrupt	; Enable 128us ISR.

	jmp	txWait		          ; Loop until 128us Interrupt.

;

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

; RX_Data processing:

; This routine will read in a byte of data from the 8051 UART.

; The receive subroutine is entered whenever the One_mSec_ISR occurs if

; rxEnable is set.

; The received data byte is stored in the receive buffer.

; If stop bit is invalid send a framing error to 8051 and discard data.

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

;

rxRoutine:

;

;  A new 128us interrupt has occurred.

;  Check the frame count and send a bit if required.

	push	A		 	          ; Save the accumulator.

	mov	A, [rxFrameCount] ; Get rx frame count.

	cmp	A, rxStart 	      ; Start bit at frame count=01h.

	jz	getrxStart 	      ; Go get Start bit.

	cmp	A, rxBit0 	      ; Data bit 0 at frame count=05h.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxBit1 	      ; Data bit 1 at frame count=09h.

	jz	getrxBit 	        ; Go get data bit under test.

	cmp	A, rxBit2 	      ; Data bit 2 at frame count=0Ch.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxBit3 	      ; Data bit 3 at frame count=0Fh.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxBit4 	      ; Data bit 4 at frame count=12h.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxBit5 	      ; Data bit 5 at frame count=16h.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxBit6 	      ; Data bit 6 at frame count=19h.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxBit7 	      ; Data bit 7 at frame count=1Ch.

	jz	getrxBit 	        ; Go get data bit.

	cmp	A, rxStop	        ; Stop bit at frame count=1Fh.

	jz	getrxStop	        ; Go get stop bit.

	pop	A		              ; Restore the accumulator.

	ret			              ; Return to caller.

;

;  Read the start bit.

getrxStart:

	iord	Port0_Data	    ; Get data.

	and	A, 80h	          ; Isolate rx data bit.

	jnz	rxAbort	          ; Bad start bit? Go abort.

	pop	A		              ; Restore the accumulator.

	ret			              ; Return to caller.

;

;  Start bit is invalid.

rxAbort:

	mov	A, 00h		        ; Clear the accumulator.

	mov	[rxBitCount], A	  ; Clear rx bit count.

	mov	[rxFrameCount], A	; Clear rx frame count.

	pop	A			            ; Restore the accumulator.

	ret				            ; Return to caller.

;

;  Get the current receive data bit and

;  process into the receive register.	

getrxBit:

	iord	Port0_Data		; Get data.

	and	A, 80h		      ; Isolate rx data bit.

	or	[rxData], A		  ; Add new data bit to register.

	mov	A, [rxBitCount]	; Get count.

	cmp	A, lastrxBit	  ; Check for last data bit.

	jz	rxSave		      ; Exit if last bit.

	inc	[rxBitCount]	  ; Bump the receive bit count.

	mov	A, [rxData]		  ; Get new data value.

	asr	A			          ; Shift data down register.

	and	A, 7Fh		      ; Clear data bit 7.

	mov	[rxData], A		  ; Store adjusted data.

	pop	A			          ; Restore the accumulator.

	ret				          ; Return to caller.

;

;  Time to get the stop bit and check for end of string.	

getrxStop:

;	iord	Port0_Data	    ; Get data.

;	and	A, 80h		        ; Isolate rx stop bit.

	mov	A, Ln_Fd		      ; Get Value of ASCII Line Feed.

	cmp	A, [rxData]		    ; Check for end of data.

	jnz	rxEnd			        ; Get next byte.

	mov	A, 00h		        ; Clear the accumulator.

	mov	[rxEnable], A	    ; Clear rx bit count.

	mov	[rxBitCount], A	  ; Clear rx bit count.

	mov	[rxFrameCount], A	; Clear rx frame count.

	pop	A			            ; Restore the accumulator.

	ret				            ; Return to caller.

;

;  Check that the stop bit is real.

;checkFrame:

;	iord	Port0_Data		  ; Get data.

;	and	A, 80h		        ; Isolate rx data bit.

;	jz	sendFrameError	  ; Framing error detected.

;

;  New character is in register, process it.

rxSave:

;

;  Strip out any ASCII Space characters.

	mov	A, Asc_Space	    ; Get Value of ASCII Space.

	cmp	A, [rxData]		    ; Check for end of data.

	jz	Skip_Char		      ; Get next byte.

;

;  Strip out any ASCII Line Feed characters.

	mov	A, Ln_Fd		      ; Get Value of ASCII Line Feed.

	cmp	A, [rxData]		    ; Check for end of data.

	jz	Skip_Char		      ; Get next byte.

;

;  Save the good ASCII characters in the receive buffer.

	mov	A, [rxData]		    ; Get the good byte of data.

	mov	X, [rxBufPtr]	    ; Point to the next buffer entry.

	mov	[X + rxBuf], A	  ; Save data byte in the receive buffer.

	inc	[rxBufPtr]		    ; Increment the receive buffer pointer.

;

;  Character is on cull list, so skip it.

Skip_Char:

;  Return for the next character;

	inc	[rxBitCount]	; Bump the bit count.

	pop	A			        ; Restore the accumulator.

	ret				        ; Return to caller.

;

;  Receive frame is done.

rxEnd:

	mov	A, 00h		        ; Clear the accumulator.

	mov	[rxBitCount], A	  ; Clear rx bit count.

	mov	[rxFrameCount], A	; Clear rx frame count.

	pop	A			            ; Restore the accumulator.

	ret				            ; Return to caller.

;



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

; This is the routine that is called to enable the receive routine.

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

;

;  Set up to receive the return character string.

getSerial:

	mov	A, 80h		        ; Enable the Port 0 Bit 7

	iowr	Port0_Interrupt	; GPIO interrupt.

;

Start_receive:

;  Enable GPIO interrupts.

  mov	A, GPIO_intMask	    ; Get the GPIO interrupt enable mask.

	iowr	Global_Interrupt	; Enable the Port 0 Bit 7 GPIO interrupt.

;

WaitForStart:

;  Wait for the receive GPIO interrupt.

	mov	A, [rxEnable]	; Get the receive enable flag.

	cmp	A, 00h		    ; Did we get an interrupt?

	jz 	WaitForStart	; Hang around if we didn't.

;

Data_receive:

;  Got the start bit. Enable the 128us interrupt and wait.

;	iowr	Watchdog		      ; Clear watchdog timer

	mov	A, 128us_intMask	  ; Set up the 128 us enable.

	iowr	Global_Interrupt	; Enable it.

	mov	A, [rxEnable]	      ; Get the enable flag.

	cmp	A, 00h		          ; Are we still enabled?

	jnz 	Data_receive	    ; Hang around for the interrupt.

;

Xfer_Done:

	ret				;

;

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

; This is the routine that is called to flush the receive buffer.

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

;

Clear_rxBuf:

;  Clear the receive buffer before sending the next command.

	push	A			      ; Save the accumulator.

	push	X			      ; Save the index register.

	mov	A, 00h		    ; Clear the accumulator.

	mov	[rxBufPtr],	A	; Clear the receive buffer pointer.

;

Clear_rxBuf_Next:

;  Loop and clear all 16 bytes of the receive buffer.

	mov	A, [rxBufPtr]	    ; Load the current receive buffer pointer.

	cmp	A, 10h		        ; Have we done 16?

	jz	Clear_rxBuf_Done	; Yes, we are done.

	mov	A, 00h		        ; Clear the accumulator.

	mov	X, [rxBufPtr]	    ; Load the index register.

	mov	[X + rxBuf], A	  ; Clear the current location.

	inc	[rxBufPtr]		    ; Point to the next byte.

	jmp	Clear_rxBuf_Next	; Do it again.

;

Clear_rxBuf_Done:

	pop	X			; Restore the index register.

	pop	A			; Restore the accumulator.

	ret				; Return to sender.

;

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

; This is the routine that is called to wait after receiving the latest

; character string.

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

;

delay1:

	push	A			                ; Save the accumulator.

	mov	A, FFh		              ; Set loop variable.

	mov	[outerDelayOneCount], A ; Store loop variable.

;

outer_delay1_loop:

	mov	A, 10h		              ; Set loop variable for good sync.

	mov	[innerDelayOneCount], A ; Load the loop count.

      mov	A, 00h		          ; Clear the accumulator.

;

inner_delay1_loop:

	iowr	Watchdog		          ; Clear watchdog timer

	dec	[innerDelayOneCount]	  ; Decrement the inner loop counter.

	cmp	A, [innerDelayOneCount]	; Is it empty?

	jnz	inner_delay1_loop	      ; Not, go do it again.

;

	dec	[outerDelayOneCount]    ; Decrement the outer loop counter.

	cmp	A, [outerDelayOneCount] ; Is it empty?

	jnz	outer_delay1_loop	      ; No, go do it again.

;

	pop	A			; Restore the accumulator.

	ret				; Return to caller.

;

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

; This is the routine that is called to wait between commands.

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

;

delay:

	push  A                   ; Save the accumulator.

	mov  A, FFh               ; Set loop variable

	mov  [outerDelayCount], A ; Store loop variable



outer_delay_loop:

	mov  A, FFh	; Set loop variable for good sync   

	mov  [innerDelayCount], A ;

  mov  A, 00h	              ;

;

inner_delay_loop:

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	nop	;

	iowr  Watchdog		          ; Clear watchdog timer

	dec   [innerDelayCount]	    ; Decrement the inner count.

	cmp   A, [innerDelayCount]  ; Time up?

	jnz   inner_delay_loop      ; Yes, go to the outer loop.

;

	dec  [outerDelayCount]      ; Decrement the outer count.

	cmp  A, [outerDelayCount]   ; Time up?

	jnz  outer_delay_loop       ; No, go through the loops again.

	pop  A                      ; Restore the accumulator.

	ret				                  ; Return to caller.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91蜜桃网址入口| 国产风韵犹存在线视精品| 成人欧美一区二区三区黑人麻豆| 日韩欧美国产综合一区 | 亚洲欧美偷拍三级| 中文字幕在线不卡| 亚洲三级在线免费观看| 亚洲欧美视频在线观看视频| 亚洲乱码一区二区三区在线观看| 亚洲欧洲www| 亚洲一级二级三级| 日韩中文字幕一区二区三区| 日韩电影免费在线观看网站| 免费在线观看一区二区三区| 经典一区二区三区| 成人性色生活片| 色94色欧美sute亚洲13| 欧美三级韩国三级日本一级| 91精品国产入口| 久久免费精品国产久精品久久久久| 久久亚洲综合色一区二区三区| 久久久久9999亚洲精品| 亚洲免费观看高清完整| 视频一区欧美精品| 国产综合色精品一区二区三区| 成人小视频在线观看| 在线观看欧美日本| 日韩欧美一级精品久久| 欧美国产亚洲另类动漫| 亚洲午夜影视影院在线观看| 久久精品国产亚洲一区二区三区| 成人美女在线视频| 欧美精品高清视频| 中文字幕免费不卡在线| 天天综合色天天综合色h| 激情av综合网| 欧美视频精品在线| 国产日韩高清在线| 天天色综合天天| 成人av电影在线| 日韩一区二区三区电影在线观看 | 国产日韩精品久久久| 一区二区三区四区在线| 久草中文综合在线| 欧美系列在线观看| 欧美激情一区二区三区蜜桃视频| 亚洲一区成人在线| 成人国产亚洲欧美成人综合网| 欧美三级视频在线观看| 日本一区二区三区高清不卡 | 欧美r级在线观看| 亚洲精品中文在线| 不卡视频免费播放| 国产欧美日韩久久| 日韩二区三区四区| 欧美亚洲另类激情小说| 国产精品视频你懂的| 人人狠狠综合久久亚洲| 欧美探花视频资源| 亚洲欧美精品午睡沙发| 粉嫩在线一区二区三区视频| 欧美va亚洲va香蕉在线| 日韩av中文在线观看| 欧美群妇大交群中文字幕| 中文字幕亚洲一区二区av在线| 久久www免费人成看片高清| 欧美三级韩国三级日本一级| 亚洲欧美电影一区二区| av中文字幕不卡| 国产午夜精品一区二区三区四区 | 欧美国产精品专区| 国产精品伊人色| 久久久精品黄色| 激情国产一区二区| 久久久九九九九| 国产精品99久久久| 国产精品视频第一区| 成人午夜伦理影院| 中文字幕在线一区免费| 波多野结衣在线一区| 国产精品毛片久久久久久| 不卡的av电影| 亚洲精品高清在线| 欧美亚洲一区三区| 日日夜夜精品视频天天综合网| 欧美美女一区二区三区| 婷婷国产在线综合| 精品国产乱码91久久久久久网站| 免费成人深夜小野草| 久久综合视频网| 成人性色生活片| 一二三四社区欧美黄| 67194成人在线观看| 免费日本视频一区| 久久久精品免费观看| 成人一道本在线| 亚洲精品中文在线影院| 欧美一区二区播放| 国产69精品久久777的优势| 中文字幕一区在线观看| 欧美日韩激情在线| 精品综合久久久久久8888| 欧美极品另类videosde| 在线观看av一区| 久久99在线观看| 亚洲色图欧美激情| 日韩欧美在线观看一区二区三区| 国产麻豆日韩欧美久久| 亚洲精品乱码久久久久久久久| 欧美一级午夜免费电影| 成人黄色网址在线观看| 人妖欧美一区二区| 亚洲天堂a在线| 日韩欧美久久久| 色乱码一区二区三区88| 黄页视频在线91| 午夜精品免费在线| 国产三级欧美三级日产三级99 | 欧美日韩一级二级| 国产乱淫av一区二区三区| 日韩久久一区二区| 2021久久国产精品不只是精品| 在线观看91精品国产入口| 国产成人免费视| 日韩在线卡一卡二| 亚洲精品欧美二区三区中文字幕| 亚洲精品一区二区三区四区高清| 欧美综合一区二区| 成人美女视频在线观看18| 美女在线一区二区| 亚洲网友自拍偷拍| 亚洲视频一区在线观看| 欧美韩日一区二区三区四区| 91精品国产综合久久久久久久久久| 99久久久国产精品| 国产精品456露脸| 久久不见久久见免费视频1| 午夜精品爽啪视频| 亚洲精品菠萝久久久久久久| 中文一区在线播放| 久久免费的精品国产v∧| 日韩欧美一二三区| 91精品国产手机| 欧美精品视频www在线观看| 欧美视频自拍偷拍| 色先锋aa成人| 色婷婷综合中文久久一本| 99久久久久久| 99国产欧美久久久精品| 成人精品小蝌蚪| 粗大黑人巨茎大战欧美成人| 国产一区二区三区四| 国产一区二区三区综合| 激情文学综合插| 国产一区二区三区久久悠悠色av| 麻豆久久久久久| 精品一区二区精品| 国产成人综合在线| 国产91在线看| 不卡视频在线看| 色综合激情五月| 欧美视频在线一区二区三区| 在线观看不卡一区| 91精品国产综合久久久久久久 | 日本黄色一区二区| 欧美日韩国产大片| 日韩一级在线观看| 久久综合久久99| 欧美国产精品一区| 亚洲黄色片在线观看| 五月天亚洲婷婷| 精品亚洲成a人| 成人成人成人在线视频| 一本久久a久久免费精品不卡| 欧美亚洲丝袜传媒另类| 日韩精品专区在线影院重磅| 久久精品欧美一区二区三区不卡| 国产精品乱人伦一区二区| 亚洲综合在线免费观看| 日韩av一级片| 丰满少妇久久久久久久| 在线免费av一区| www激情久久| 亚洲图片你懂的| 麻豆中文一区二区| 99久久精品费精品国产一区二区| 91国内精品野花午夜精品| 欧美成人在线直播| 日韩一区有码在线| 麻豆精品在线视频| 一本大道综合伊人精品热热| 91精品国产91久久久久久一区二区| 久久精品视频免费| 亚洲成av人片| 99视频在线精品| 亚洲精品一区二区三区在线观看| 亚洲精品日日夜夜| 国产高清在线观看免费不卡| 欧美色手机在线观看| 国产精品美女久久久久av爽李琼 |