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

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

?? chap4.asm

?? 摩托羅拉Mc6811利程
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
; Chapter 4 6811 assembly language programs; Jonathan W. Valvano; This software accompanies the book,; Real Time Embedded Systems published by Brooks Cole;; Program 4.1. This subroutine is nonreentrant because of the read-modify-write access to a global. Second  rmb  2    Temporary global variable* Input parameters: Reg X,Y contain 2 16 bit numbers* Output parameter: Reg X is returned with the averageAVE     sty  Second  Save the second number in memory         xgdx         Reg D contains first number        addd Second  Reg D=First+Second        lsrd         (First+Second)/2        adcb #0      round up?        adca #0        xgdx        rts; Program 4.2. This subroutine is also nonreentrant because of the read-modify-write access to a global. Money rmb  2      bank balance implemented as a global* add $100 to the accountmore  ldd  Money	where Money is a global variable	addd #100	std  Money	Money=Money+100      rts; Program 4.4. This assembly subroutine is nonreentrant because of the write-read access to a global. temp  rmb  2       temporary result implemented as a global* calculate RegX=RegX+2*RegDmac	stx  temp	Save X so that it can be added	lsld        RegD=2*RegD      addd temp	RegD=RegX+2*RegD			xgdx        RegX=RegX+2*RegD      rts ; Program 4.6. This assembly subroutine is nonreentrant because of the multi-step write access to a global. Info  rmb  4       32-bit data implemented as a global* set the variable using RegX and RegYset	stx  Info	 Info is a 32 bit global variable	sty  Info+2	      rts; Program 4.8. This assembly subroutine is reentrant because it does not write to any globals. * Input parameters: Reg X,Y contain 2 16 bit numbers* Output parameter: Reg X is returned with the averageAVE     pshy         Save the second number on the stack        tsy          Reg Y points the Second number        xgdx         Reg D contains first number        addd 0,Y     Reg D=First+Second        lsrd         (First+Second)/2        adcb #0      round up?        adca #0        xgdx        puly        rts; Program 4.9. This assembly subroutine is nonreentrant because of the read-modify-write access to a global. Status   rmb  1    0 means empty, -1 means it contains somethingMessage  rmb  1    data to be communicated* Input parameter: Reg B contains an 8 bit message* Output parameter: Reg CC (C bit) is 1 for OK, 0 for busy errorSEND    tst  Status  check if mailbox is empty        bmi  Busy    full, can't store, so return with C=0        stab Message store        dec  Status  signify it is now contains a message        sec          stored OK, so return with C=1Busy    rts; Program 4.10. This assembly subroutine is reentrant because it disables interrupts during the critical section. Status   rmb  1    0 means empty, -1 means it contains somethingMessage  rmb  1    data to be communicated* Input parameter: Reg B contains an 8 bit message* Output parameter: Reg CC (C bit) is 1 for OK, 0 for busy errorSEND    clc          Initialize carry=0        tpa          save current interrupt state        psha        sei          disable interrupts during vulnerable window        tst  Status  check if mailbox is empty        bmi  Busy    full, so return with C=0        staa Message store        dec  Status  signify it is now contains a message        pula        oraa #1      OK, so return with C=1        pshaBusy    pula         restore interrupt status        tap        rts; Program 4.12. This assembly subroutine can be used as part of a binary semaphore. * Global parameter: Semi4 is the memory location to test and set* If the location is zero, it will set it (make it -1)*      and return Reg CC (Z bit) is 1 for OK* If the location is nonzero, it will return Reg CC (Z bit) = 0Semi4 fcb  0         Semaphore is initially freeTAS   tst  Semi4     check if already set      bne  Out       busy, operation failed, so return with Z=0      dec  Semi4     signify it is now busy      bita #0        operation successful, so return with Z=1Out   rts; Program 4.13. Code fragments showing the basic idea of a FIFO. GetPt  rmb 2   Pointer to oldest data, next to be removed by GETPutPt  rmb 2   Pointer to free memory, place to PUT next data* Reg A contains byte to store into the FIFOPutFifo  ldx  PutPt   Reg X points to free place     staa ,X      Store data into FIFO     inx          Update pointer     stx  PutPt        rts* Reg A returned with byte from FIFOGetFifo  ldx  GetPt  Reg X points to oldest data     ldaa ,X     Read data from FIFO     inx         Update pointer     stx  GetPt       rts; Program 4.15. Initialization of a two pointer FIFO. * Two pointer implementation of the FIFO FifoSize  equ  10    Number of 8 bit data in the Fifo, less onePutPt     rmb  2     Pointer of where to put next */GetPt     rmb  2     Pointer of where to get next* FIFO is  empty if PutPt=GetPt * FIFO is full  if PutPt+1=GetPt (with wrap)Fifo      rmb  FifoSize    The statically allocated fifo data ***********Initialize FIFO******************* No parametersInitFifo  ldx #Fifo          tpa          sei        make atomic, entering critical section          stx PutPt          stx GetPt  Empty when PutPt=GetPt           tap        end critical section, restore CCR          rts; Program 4.16. Assembly routine to put into a two pointer FIFO. ***********Put a byte into the FIFO******************* Input  RegA contains 8 bit data to put* Output RegA is -1 if successful, 0 if data not storedPutFifo   psha          tpa          tab          pula          pshb            save old CCR          sei             make atomic, entering critical section          ldx  PutPt      RegX is Temporary put pointer          staa 0,x        Try to put data into fifo           inx          cpx  #Fifo+FifoSize          bne  PutNoWrap  skip if no wrapping needed          ldx  #Fifo      Wrap PutNoWrap clra            assume it will fail          cpx  GetPt      Full if now the same          beq  PutDone          coma            RegA=-1 means OK          stx  PutPtPutDone   tab        end critical section          pula          tpa        restore CCR to previous value          tba          rts; Program 4.17. Assembly routine to get from a two pointer FIFO. ***********Get a byte from the FIFO******************* Input  RegX points to place for 8 bit data from Get* Output RegA is -1 if successful, 0 if Fifo was empty when calledGetFifo   tpa          psha            save old CCR          sei             make atomic, entering critical section          clra            assume it will fail          ldy  GetPt            cpx  PutPt      Empty if initially the same          beq  GetDone          coma            RegA=-1 means OK          ldab 0,y        Data from FIFO          stab 0,x        Return by reference           iny          cpy  #Fifo+FifoSize          bne  GetNoWrap  skip if no wrapping needed          ldy  #Fifo      Wrap GetNoWrap sty  GetPtGetDone   tab        end critical section          pula          tpa        restore CCR to previous value          tba          rts; Program 4.19. Initialization of a two pointer with counter FIFO. * Pointer,counter implementation of the FIFO FifoSize   equ  10    Number of 8 bit data in the FifoPutPt      rmb  2     Pointer of where to put next GetPt      rmb  2     Pointer of where to get nextSize       rmb  1* FIFO is empty if Size=0 * FIFO is full  if Size=FifoSize Fifo       rmb  FifoSize    The statically allocated fifo data ***********Initialize FIFO******************* No parametersInitFifo   tpa           sei         make atomic, entering critical section           ldx  #Fifo           stx  PutPt           stx  GetPt  Empty when Size == 0           clr  Size            tap         end critical section           rts; Program 4.20. Assembly routine to put into a two pointer with counter FIFO. ***********Put a byte into the FIFO******************* Input  RegA contains 8 bit data to put* Output RegA is -1 if successful, 0 if data not storedPutFifo    psha           tpa           tab           pula           pshb            save old CCR           sei             make atomic, entering critical section           ldab Size           cmpb #FifoSize  Full if Size==FifoSize           bne  PutNotFull           clra           bra  PutDonePutNotFull incb           stab Size       Size++           ldx  PutPt            staa 0,x        Put data into fifo            inx           cpx  #Fifo+FifoSize           bne  PutNoWrap  skip if no wrapping needed           ldx  #Fifo      Wrap PutNoWrap  ldaa #-1        success means OK           stx  PutPtPutDone    tab        end critical section           pula           tpa        restore CCR to previous value           tba           rts; Program 4.21. Assembly routine to get from a two pointer with counter FIFO. ***********Get a byte from the FIFO******************* Input  RegX points to place for 8 bit data from Get* Output RegA is -1 if successful, 0 if Fifo was empty when calledGetFifo tpa        psha    save old CCR        sei     make atomic, entering critical section        clra       assume it will fail        tst  Size        beq  GetDone        dec  Size        ldy  GetPt          coma          RegA=-1 means OK        ldab 0,y      Data from FIFO        stab 0,x      Return by reference         iny        cpy  #Fifo+FifoSize        bne  GetNoWrap  skip if no wrapping needed        ldy  #Fifo      Wrap GetNoWrap sty GetPtGetDone tab        end critical section        pula        tpa        restore CCR to previous value        tba        rts; Program 4.23. Initialization of a two index with counter FIFO. * Index,counter implementation of the FIFO FifoSize equ  10    Number of 8 bit data in the Fifo PutI     rmb  1     Index of where to put nextGetI     rmb  1     Index of where to get nextSize     rmb  1* FIFO is empty if Size=0 * FIFO is full  if Size=FifoSize Fifo       rmb  FifoSize    The statically allocated fifo data ***********Initialize FIFO******************* No parametersInitFifo   tpa           sei        make atomic, entering critical section           clr  PutI           clr  GetI           clr  Size  Empty when Size == 0            tap        end critical section           rts; Program 4.24. Assembly routine to put into a two index with counter FIFO. ***********Put a byte into the FIFO******************* Input  RegA contains 8 bit data to put* Output RegA is -1 if successful, 0 if data not storedPutFifo    psha

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色八戒一区二区三区| 亚洲精品水蜜桃| 国产亚洲欧美中文| 国产欧美日韩在线| 亚洲欧美日韩国产中文在线| 亚洲欧美日韩精品久久久久| 丝袜亚洲另类欧美| 国产成人精品亚洲日本在线桃色| 成人高清av在线| 在线精品视频免费观看| 日韩一区二区精品葵司在线| 国产三级欧美三级日产三级99| 中文字幕一区二区三区四区不卡| 亚洲自拍偷拍九九九| 蜜桃视频一区二区三区在线观看 | 成人看片黄a免费看在线| 一本久久综合亚洲鲁鲁五月天| 在线播放中文字幕一区| 亚洲国产岛国毛片在线| 日韩激情视频在线观看| 激情综合网天天干| 在线免费不卡电影| 久久综合色播五月| 精品一区二区三区久久久| 欧美日韩在线直播| 亚洲一区在线观看网站| 国产激情一区二区三区四区| 51午夜精品国产| 亚洲国产cao| 欧美三级韩国三级日本一级| 成人欧美一区二区三区小说| 国产凹凸在线观看一区二区| 日韩一区二区三区电影在线观看| 亚洲一区二区偷拍精品| 色一情一乱一乱一91av| 亚洲精品国产视频| 91黄色免费网站| 亚洲国产日韩一级| 欧美日韩日日骚| 日韩精品1区2区3区| 日韩欧美123| 国产成人综合网| 亚洲精品免费在线| 欧美日韩成人在线一区| 蜜桃av噜噜一区| 国产精品女同互慰在线看| 亚洲国产精品精华液网站| 欧美日韩精品一区二区| 免费高清在线一区| 久久午夜电影网| 不卡一区二区中文字幕| 亚洲一区二区三区四区五区黄 | 中文一区一区三区高中清不卡| 国产成人在线看| 午夜伦理一区二区| 久久美女高清视频| 91国模大尺度私拍在线视频| 天堂影院一区二区| 国产精品成人免费在线| 欧美日韩高清影院| 久久精品国产免费| 亚洲人妖av一区二区| 91精品国产丝袜白色高跟鞋| 国产1区2区3区精品美女| 亚洲精品中文在线影院| 精品国产不卡一区二区三区| 91捆绑美女网站| 国产精品一级二级三级| 亚洲成人www| 一区二区三区中文字幕电影| 欧美不卡在线视频| 91精品国产色综合久久ai换脸| 99久久精品国产一区| 国产毛片精品一区| 日韩国产欧美在线播放| 午夜电影网一区| 亚洲欧洲制服丝袜| 亚洲免费观看高清在线观看| 中文无字幕一区二区三区| 精品久久人人做人人爱| 久久精品亚洲乱码伦伦中文| 欧美不卡视频一区| 久久久亚洲高清| 久久久久一区二区三区四区| 精品99一区二区| 国产亚洲精品7777| 亚洲欧洲av另类| 亚洲亚洲人成综合网络| 日韩精品91亚洲二区在线观看| 蜜臀精品久久久久久蜜臀| 男人的j进女人的j一区| 国产乱码精品一区二区三区忘忧草| 免费成人美女在线观看| 国产成人午夜视频| 色老汉一区二区三区| 在线不卡一区二区| 欧美激情一区二区三区四区| 亚洲精品亚洲人成人网| 日韩电影一区二区三区| 九九九精品视频| 99视频在线精品| 91精品国产品国语在线不卡| 久久久99免费| 丝袜美腿一区二区三区| 成人自拍视频在线| 精品不卡在线视频| 午夜欧美2019年伦理| 99热精品国产| 精品国产一区二区三区久久久蜜月| 国产欧美日本一区二区三区| 亚洲国产色一区| 99久久伊人久久99| 国产亚洲va综合人人澡精品| 亚洲一区二区高清| 成人av在线观| 国产日产精品一区| 国产在线不卡一区| 在线电影院国产精品| 樱桃视频在线观看一区| 成人h动漫精品一区二区| 欧美精品一区二区三区蜜桃视频| 亚洲国产你懂的| 欧美日韩国产经典色站一区二区三区| 国产精品午夜春色av| 成人国产精品视频| 亚洲国产岛国毛片在线| 丁香激情综合国产| 国产亚洲1区2区3区| 国产69精品久久777的优势| 久久免费电影网| 国产一区二区三区黄视频 | 欧美在线你懂得| 亚洲第一激情av| 精品对白一区国产伦| 卡一卡二国产精品| 国产日韩成人精品| jizzjizzjizz欧美| 自拍偷在线精品自拍偷无码专区| 国产一区二区福利视频| 国产日韩精品一区二区三区| 91蜜桃婷婷狠狠久久综合9色| 中文字幕亚洲综合久久菠萝蜜| 色香蕉成人二区免费| 日本人妖一区二区| 中文无字幕一区二区三区| 在线观看av一区二区| 极品少妇一区二区三区精品视频| 久久久久久9999| 欧美欧美欧美欧美| 色香蕉成人二区免费| 久久99精品国产麻豆婷婷| 欧美激情一区二区三区不卡 | 国产乱码字幕精品高清av| 亚洲欧美日韩中文播放 | 日本美女视频一区二区| 国产精品视频一二三| 7777精品久久久大香线蕉| 成人性生交大合| 日本少妇一区二区| 亚洲 欧美综合在线网络| 国产精品色噜噜| 亚洲国产精品av| 2017欧美狠狠色| 欧美mv日韩mv国产网站| 欧美另类高清zo欧美| 91同城在线观看| 成人av电影免费观看| 成人在线综合网站| 国产在线精品不卡| 国产成人在线看| 丁香网亚洲国际| aaa国产一区| 91黄色激情网站| 色视频欧美一区二区三区| a在线欧美一区| 日韩国产在线观看一区| 国产色一区二区| 精品少妇一区二区三区在线视频| 欧美日韩精品一区二区天天拍小说| 色婷婷久久一区二区三区麻豆| av一区二区三区四区| 国产不卡视频在线播放| 自拍偷拍国产亚洲| 捆绑调教美女网站视频一区| 在线精品视频一区二区三四| 国产视频一区二区三区在线观看| 日韩精品一区第一页| 91看片淫黄大片一级| 国产精品久久久久影院亚瑟| 开心九九激情九九欧美日韩精美视频电影| 91猫先生在线| 中文字幕在线视频一区| 国产麻豆精品一区二区| 精品理论电影在线观看| 美女在线视频一区| 欧洲精品在线观看| 日韩毛片精品高清免费| 国产精品亚洲成人| 久久免费美女视频| 国产成人av电影在线观看|