• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: 不知如何做位元判斷... 16f877
#4
版主
版主


查看用戶資訊
建議你看一下 W100 的組合語言入門教材,了解他會對你有很大的幫助的。

http://www.microchip.com.tw/modules/w ... nglefile.php?cid=4&lid=24

奇怪總覺得一直叫人家看書!

發表於: 2009/12/21 14:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 不知如何做位元判斷... 16f877
#3
資深會員
資深會員


查看用戶資訊
參照:
ddoen 寫道:
date  EQU  0
no      EQU  0x21


       MOVLW  
B'11111111'
       
MOVWF  no

test
       btfsc no
,date    ; [color=ff0000]  此時 date 為常數(k) [/color]
     .
     .
     .
        
incf   date         ; [color=ff0000]   此時 date 為變數(暫存器) [/color]
        goto 
test

很顯然btfsc no
,date是錯的

請問有甚麼方法可以讓btfsc的date 判斷單一位元呢

我下次很大的迴圈回來後需要做0
~7的判斷


;======================================

同樣的名稱宣告,碰到不同的指令時,會有不同的解釋 如同 C 的變數前 有加 "*"  和沒加 "*" 一樣

    test_point   equ       0x20
.
.
.
      
clrf        test_point         ;  暫存器   (0x20 )
      
incf        test_point f     ;  暫存器   (0x20 1)
      
movlw       test_point         =  ( )  = 0x20
      movwf       test_point         
暫存器 = (k) = 0x20
      incf        test_point 
f     ;  暫存器   (0x20 0x20 0x21)

   
(K或是 暫存器 則是在 組譯時 由組譯程式跟據指令的不同而判定


    
[color=ff0000]    這應該是放在  8 bit 論壇 .... [/color]

發表於: 2009/12/21 5:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 不知如何做位元判斷... 16f877
#2
資深會員
資深會員


查看用戶資訊
簡易範例如下,請參考:

LIST P=16F877A,R=DEC
#include <p16f877a.inc>

var1 equ 0x20


org 0x00
goto main
org 0x04
retfie

main:
banksel var1
movlw 0x01
movwf var1
bit_test:
btfss var1,0
goto bit0is0
goto bit0is1
bit0is0:
goto $
bit0is1:
movlw 0x00
movwf var1
goto bit_test

end

發表於: 2009/12/20 8:50
不怕苦...苦半輩子;怕苦...苦一輩子
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


不知如何做位元判斷... 16f877
#1
新會員
新會員


查看用戶資訊
date EQU 0
no EQU 0x21


MOVLW B'11111111'
MOVWF no

test
btfsc no,date
.
.
.
incf date
goto test

很顯然btfsc no,date是錯的

請問有甚麼方法可以讓btfsc的date 判斷單一位元呢

我下次很大的迴圈回來後需要做0~7的判斷

發表於: 2009/12/20 1:14
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... ]

教育訓練中心

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