• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: 一些很新手的問題
#2
初級會員
初級會員


查看用戶資訊
EQU --> 指定一個位址或常數或更換名稱可適用
例如:
AAA EQU 0x20 ---> 位址0x20(ram)指定名稱叫AAA
--->或AAA的值是0x20 --->視您的程式要幹嘛 !!
BBB EQU PORTB ---> 名稱更換,但不可重複定義!!或使用保留字...
;----------------------------------------------------------
RES ---> 不指定位址,給COMPILER自己找位址(ram)然後定義一個名稱.
例如:
CCC RES 1 --->找一個8bits的空暫存器(ram),定一個名稱叫CCC.
DDD RES 2 --->找二個8bits的連續空暫存器(ram),定一個名稱叫DDD.
;----------------------------------------------------------
有關EQU,RES,MACRO等等用法,請至右方教材及講義區-->WORKSHOP教材--->下載 "MPASM 及 MPLINK講義"在虛指令用法內有更詳細解釋 !!

發表於: 2006/1/9 12:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


一些很新手的問題
#1
新會員
新會員


查看用戶資訊
我是PIC學習新手,想請教各位高手,有關於以下程試(我只是COPY其中的部份,為PIC16C54~7),裡面的EQU $及RES 1是什麼意思?
還有可以請各為高手分析一下這兩個MACRO是怎麼寫的?
有什麼文件可查嗎?


麻煩各位高手了啊~~~



;**********************************************************************
;* Usage Description
;* ----------------------- --------------------------------------
;* BIT label,bit,file ;Define a bit label
;* SEB label ;set bit using bit label
;* CLB label ;clear bit using bit label
;* SKBS label ;SKIP on bit set
;* SKBC label ;SKIP on bit clear
;* BBS label,address ;BRANCH on bit set
;* BBC label,address ;BRANCH on bit clear
;* CBS label,address ;CALL on bit set
;* CBC label,address ;CALL on bit clear
;*
;**********************************************************************

BIT MACRO label,bit,file ;Define a bit label
label EQU file<<8|bit ;(macro)
ENDM ;

SEB MACRO label ;Set bit
BSF label>>8,label&7 ;(macro)
ENDM ;


BIT B_C,0STATUS
RTCC RES 1
I2CR0 EQU $
RES 1

發表於: 2006/1/5 18:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------