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

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

?? serialbuf.bas

?? 82 sample programs written in BASCOM-8051 for 8051 developement
?? BAS
字號:
'------------------------------------------------------
'                 SERIALBUF.BAS
'             (c) 2001 MCS Electronics
' This program shows how to implement a serial input
' buffer
'------------------------------------------------------


'we use conditional compilation for the optional spi int
Const Spi = 1

'first we tell the compiler about our routines
$serialoutput = Sendchar
$serialinput = Recchar

'now we need some variables to store the input and some pointers
'buf() is an array that holds the data
'wpos is a pointer that points to the last position written
'rpos is a pointer that points to the last read position
'rcount is a byte that stores the number of bytes waiting in the buffer
Dim Buf(10) As Iram Byte , Wpos As Iram Byte , Rpos As Iram Byte , Rcount As Iram Byte

'now we specify the ISR
On Serial Isr_ser Nosave
'we must enable it
Enable Serial
'and enable the global interrupt bit
Enable Interrupts

'since by default the compiler will generate mov scon,#82 to enable TI,
'we override it so TI is not enabled
mov scon,#80


'This is our actual program
'we need a byte to store a value
Dim A As Byte
'we print some text to show that we can print
Print "Hello"
Print "world"
'here we ask for the number
Do
  Input "Number " , A
  'here we print the entered number
  Print A
Loop Until A = 0
End


'we use some asm
$asm
Sendchar:

' we could disable the serial interrupts here but it would mean
' that no receive interrupt could occur too

 Mov sbuf, a                                                                     ; write the data
 Jnb scon.1, *+0                                                                       ; wait until it is ready
 Clr scon.1
                                                             ; Disable Ti
Ret

' That Was Easy


Recchar:
  mov a,{rcount}                                              ; get the number of bytes waiting in the buffer
  jz recchar                                                  ; when zero try again
  push h'00                                                   ; now we must save the used registers
  push psw

  mov r0,#{buf}                                               ; load the address of the buffer
  mov a,{rpos}                                                              ; load the last read position
  add a,r0                                                    ; add it
  mov r0,a                                                    ; put back in r0
  mov a,@r0                                                   ; get it out of the buffer
  inc {rpos}                                                  ; increase the read pointer
  dec {rcount}                                                ; 1 char less waiting
  push acc                                                    ; save the byte we retrieved from the buffer
  mov a,{rpos}                                                                     ; get the read pos
  cjne a,#10, recchar_exit                                    ; is it past the size of the buffer
  mov {rpos},#0                                               ; reset it to the begin
Recchar_exit:
  pop acc                                                     ; restore byte
  pop psw                                                     ; restore registers
  pop h'00
ret                                                           ; return

$end Asm


'this is the ISR that gets fired when TI or RI gets set
Isr_ser:
 push acc
 push h'00                                                    ; save used registers
 push psw
 jnb scon.0, .isr_tx                                          ; was RI causing the interrupt?
 mov a,{wpos}                                                               ; get write position
 mov r0,#{buf}                                                ; load address of buffer
 add a,r0                                                     ; add it
 mov r0,a                                                     ; back to r0
 mov @r0,sbuf                                                 ; store the char in the buffer
 inc {wpos}                                                   ; increase write pointer
 inc {rcount}                                                 ; and we have one char more waiting
 clr scon.0                                                   ; clear RI
 mov a ,{wpos}                                                ;get the write pointer
 cjne a,#10,.isr_exit                                         ;is it past the size?
 Mov {wpos},#0                                                ; reset it
 sjmp .isr_exit                                               ;exit
Isr_tx:
' TI Caused The Int But It Gets Reset In The Sendchar Routine

'optional for the 8252 that has a shared SPI interrupt you can add the following code
#if Spi
  mov a,spsr                                                  ; get status register
  jnb acc.7, .isr_exit                                        ; it was not the SPI that caused the int
  mov spsr,#255                                               ; to clear the int flag spif and wcol must be set
  mov a,spdr                                                  ; by reading the data register the int gets cleared
  'now we can store the data this is not implemented
  'note that acc gets popped so acc will be destroyed

#endif


Isr_exit:
 pop psw                                                      ; restore regs
 pop h'00
 pop acc
Return

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品免费| 婷婷成人激情在线网| 午夜精品福利视频网站| 国产黄色91视频| 欧美日韩久久不卡| 国产精品久久久久永久免费观看| 日韩精彩视频在线观看| 波多野结衣视频一区| 欧美www视频| 三级欧美在线一区| 91捆绑美女网站| 欧美激情一区二区三区不卡| 久久9热精品视频| 欧美午夜片在线看| 亚洲精品视频免费看| 成人福利视频在线| 国产亚洲一本大道中文在线| 免费人成在线不卡| 91精品一区二区三区久久久久久 | 国产欧美一区在线| 美国十次综合导航| 欧美一区二区黄| 视频一区视频二区中文字幕| 91成人免费电影| 亚洲免费在线看| 99精品视频一区二区三区| 久久精品欧美一区二区三区麻豆 | 亚洲小说欧美激情另类| 99久久伊人久久99| 中文字幕永久在线不卡| 99久久精品免费看| 综合分类小说区另类春色亚洲小说欧美| 国产精品一级二级三级| 欧美激情一区二区三区四区 | 久久精品视频网| 国产乱人伦偷精品视频免下载| 欧美成人综合网站| 国产一区二区三区av电影| 久久免费看少妇高潮| 处破女av一区二区| 国产精品久久99| 91黄色小视频| 亚洲一区二区三区视频在线 | 欧美三区在线观看| 亚洲r级在线视频| 91麻豆精品国产91久久久更新时间 | 精品午夜一区二区三区在线观看| 日韩一区二区三区av| 狠狠色狠狠色综合系列| 久久久电影一区二区三区| 国产成人av一区| 一区二区三区四区乱视频| 一本久道久久综合中文字幕 | 91精品免费在线观看| 美女任你摸久久| 久久久久久久久97黄色工厂| 波多野结衣中文字幕一区二区三区| 亚洲欧美一区二区视频| 欧美三级一区二区| 国产在线看一区| 综合激情成人伊人| 日韩欧美一区在线| 成人免费高清视频在线观看| 国产精品久久久久久久久免费樱桃| 色婷婷久久久亚洲一区二区三区| 日韩高清不卡一区二区| 国产视频视频一区| 在线观看欧美精品| 韩国精品在线观看| 亚洲精品国久久99热| 精品国产电影一区二区| 91丨porny丨国产入口| 秋霞av亚洲一区二区三| 中文字幕av一区二区三区免费看| 欧美日韩1234| 成人午夜私人影院| 热久久一区二区| 亚洲免费观看高清| 久久久国产精华| 日韩午夜av电影| 色婷婷久久综合| 处破女av一区二区| 精品一区二区三区久久| 亚洲综合无码一区二区| 国产农村妇女精品| 欧美一区二区在线视频| 91免费看`日韩一区二区| 极品少妇一区二区| 婷婷中文字幕综合| 欧美激情综合五月色丁香小说| 欧美日韩成人在线| 在线免费亚洲电影| 成人黄色电影在线| 国产很黄免费观看久久| 国内一区二区在线| 日韩精品福利网| 一区二区三区欧美日韩| 国产精品久久久久久久久快鸭 | 欧美一区二区三区免费观看视频| 色国产综合视频| 99久久精品久久久久久清纯| 国产美女一区二区三区| 久久精品国产亚洲aⅴ| 天天亚洲美女在线视频| 亚洲最大成人综合| 一区二区在线观看免费| 亚洲视频一区在线| 亚洲素人一区二区| 亚洲视频一二三区| 亚洲人123区| 一区二区三区国产豹纹内裤在线| 亚洲色图.com| 亚洲免费大片在线观看| 亚洲视频电影在线| 一区二区在线看| 亚洲第一综合色| 午夜精品aaa| 蜜桃一区二区三区四区| 久久99在线观看| 精品中文字幕一区二区小辣椒 | 日韩欧美激情一区| 欧美tk—视频vk| 久久精品一区二区三区av| 精品国产乱码久久久久久老虎| 欧美tk—视频vk| 久久精品一区二区三区av| 中文字幕一区二区三区乱码在线| 亚洲青青青在线视频| 亚洲高清久久久| 蜜桃在线一区二区三区| 国产精品资源在线观看| 成人精品高清在线| 91女厕偷拍女厕偷拍高清| 91成人看片片| 日韩精品专区在线影院重磅| 久久精品亚洲国产奇米99| 国产精品乱码久久久久久| 亚洲精品国产视频| 麻豆久久一区二区| 不卡的av电影在线观看| 欧美午夜寂寞影院| 精品国产免费一区二区三区香蕉| 国产亚洲1区2区3区| 亚洲另类春色校园小说| 免费成人小视频| av亚洲产国偷v产偷v自拍| 在线观看日韩高清av| 欧美一级淫片007| 国产精品视频一二三区| 亚洲激情六月丁香| 久久99精品久久只有精品| 不卡一区中文字幕| 欧美一级xxx| 亚洲国产岛国毛片在线| 性做久久久久久| 丁香六月久久综合狠狠色| 5月丁香婷婷综合| 亚洲桃色在线一区| 黄色资源网久久资源365| 91福利精品视频| 久久久久国产一区二区三区四区| 亚洲一区二区三区三| 国产成人久久精品77777最新版本| 色婷婷亚洲婷婷| 国产亚洲欧美日韩俺去了| 亚洲国产精品人人做人人爽| 成人av在线网站| 欧美tk—视频vk| 视频在线观看一区二区三区| 成人美女在线视频| 日韩精品在线一区二区| 亚洲午夜免费视频| 99re6这里只有精品视频在线观看| 欧美一区二区视频观看视频| 亚洲欧美偷拍另类a∨色屁股| 国产一区二区免费看| 7777精品伊人久久久大香线蕉| 最新日韩在线视频| 国内不卡的二区三区中文字幕| 91国产精品成人| 亚洲日本在线天堂| 成人天堂资源www在线| 日韩欧美国产系列| 亚洲成a天堂v人片| 欧美综合视频在线观看| 中文字幕在线观看一区| 国产一本一道久久香蕉| 欧美精品一区二区久久婷婷| 日本欧美韩国一区三区| 欧美亚洲禁片免费| 一区二区三区中文字幕在线观看| 国产白丝网站精品污在线入口| 日韩视频免费观看高清完整版在线观看 | 欧美亚洲禁片免费| 亚洲精品成人精品456| 91在线视频网址| 成人免费小视频| 顶级嫩模精品视频在线看| 国产亚洲欧美在线| 成人福利视频在线|