<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > Cortex-M3的第一個內嵌匯編函數(shù)(MDK環(huán)境)

          Cortex-M3的第一個內嵌匯編函數(shù)(MDK環(huán)境)

          作者: 時間:2016-11-20 來源:網絡 收藏
          #include "memmap.h"
          #include "gpio.h"
          #include "Defination.c"
          u8 i=a;
          __asm u8 plus(u8 a) //注意是兩個“_”
          {
          MOV R1,R0 //由于R0傳遞第一個參數(shù),故將a的值賦給R1寄存器
          ADD R1,#6 //將R1的值加6
          MOV R0,R1 //返回值寫入R0
          BX LR //返回主程序
          }
          int main(void)
          {
          *RCC_APB2ENR=0x00000018;//打開portb和portc的時鐘
          setPORT(&PORTC,0x00000000);
          setPORT(&PORTB,0x00000000);
          delay_Nms(1);
          setBIT(&PORTB,4);//RESET PB4
          LCD_Init();
          DispOneColor(BLACK);
          print("application one is running",cursor_x,cursor_y);
          newline();
          i=plus(i);
          print(&i,cursor_x,cursor_y);
          return(0);
          }



          評論


          相關推薦

          技術專區(qū)

          關閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();