• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::

論壇索引


Board index » All Posts




Re: 有事想請教各位前輩,希望各位前輩能幫忙
新會員
新會員


小弟目前想學組合語言,所以還是很謝謝前輩的幫忙

發表於: 2005/10/25 17:35
頂部


結構型態&共用型態的問題?
初級會員
初級會員


看WAP002 Workshop看了很久還是看不懂@@
以下兩種宣告方式差別在那?怎麼覺的用起來是一樣的?
------------------------------------------------------------------

near union
{
unsigned char Count;
struct
{
unsigned B0:1;
unsigned B1:1;
unsigned B2:1;
unsigned B3:1;
unsigned B4:1;
unsigned B5:1;
};
}Bz=0;


_____________________________________________
extern volatile near unsigned char PORTB;
extern volatile near union{
struct {
unsigned RB0:1;
unsigned RB1:1;
unsigned RB2:1;
unsigned RB3:1;
unsigned RB4:1;
unsigned RB5:1;
unsigned RB6:1;
unsigned RB7:1;
} ;
struct {
unsigned INT0:1;
unsigned INT1:1;
unsigned INT2:1;
unsigned CCP2:1;
} ;
} PORTBbits ;

發表於: 2005/10/25 17:35
頂部


Re: 新手笨問題
資深會員
資深會員


其實應該要寫PORTC而不是寫RC
定義檔中預設的是PORTC
那個作者可能有自己去改定義檔
不然就是使用其他編譯程式
所以他寫RC就能編譯通過

發表於: 2005/10/25 16:17
頂部


Re: 新手笨問題
高級會員
高級會員


還是很感謝你的熱心回答...

不然一值卡住...有夠難受的

發表於: 2005/10/25 15:52
頂部


Re: 新手笨問題
高級會員
高級會員


參照:
至於rc的錯誤 我不知道在PIC16中RC是不是指PORTC 如果是的話 那也把他改大寫看看


RC 是PORTC 但是改成大寫RC 還是有錯誤

剛才直接把 RC 改成PORTC 就可以了...

真怪

list p=16f877
#include <p16f877.inc>
cnt       equ   0x20
delaycnt0 equ   0x21
delaycnt1 equ   0x22
          org   0x00
          nop 
          
goto  start
start
:
          
call  pic_init
main_loop
:
          
movlw b'11111110'
          
movwf PORTC
          movlw 0x08
          movwf cnt
inner_loop
:
          
call  delay
          bsf   STATUS
,C
          rlf   PORTC
,F
          
goto  inner_loop
          
goto  main_loop
pic_init
:
          
clrf  INTCON
          bsf   STATUS
,RP0
          movlw 
b'00000000' 
          
movwf TRISC
          bcf   STATUS
,RP0
          movlw 
b'11111110'
          
movwf PORTC
          
return
delay:
          
movlw 0xff
          movwf delaycnt0
          movwf delaycnt1
delay0
:
          
decfsz delaycnt0,f
          
goto delay0
          decfsz delaycnt1
,f
          
goto delay0
          
return
          
end



CleanDeleting intermediary and output files.
CleanDone.
Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Message[302D:PICEX1.ASM 26 Register in operand not in bank 0.  Ensure that bank bits are correct.
Loaded D:picex1.COD
BUILD SUCCEEDED
Tue Oct 25 15:23:28 2005

發表於: 2005/10/25 15:49
頂部


Re: 新手笨問題
高級會員
高級會員


你的RC需要定義...
EX:
rc equ 0x23

發表於: 2005/10/25 15:45
頂部


Re: 新手笨問題
高級會員
高級會員


參照:
變數名稱大小寫是不同的 而指令則大小寫都可以


多謝...改完之後都正常 不過RC還是沒解決

Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Error[113]   D:PICEX1.ASM 13 Symbol not previously defined (RC)
Error[113]   D:PICEX1.ASM 19 Symbol not previously defined (RC)
Message[302D:PICEX1.ASM 26 Register in operand not in bank 0.  Ensure that bank bits are correct.
Error[113]   D:PICEX1.ASM 29 Symbol not previously defined (RC)
Halting build on first failure as requested.
BUILD FAILEDTue Oct 25 15:07:52 2005

發表於: 2005/10/25 15:36
頂部


Re: 新手笨問題
高級會員
高級會員


參照:
變數名稱大小寫是不同的 而指令則大小寫都可以


多謝...改完之後都正常 不過RC還是沒解決

Executing"C:Program FilesMPLAB IDEMCHIP_Toolsmpasmwin.exe" //p16F877 "ex1.asm" /l"ex1.lst" /e"ex1.err"
Error[113]   D:PICEX1.ASM 13 Symbol not previously defined (RC)
Error[113]   D:PICEX1.ASM 19 Symbol not previously defined (RC)
Message[302D:PICEX1.ASM 26 Register in operand not in bank 0.  Ensure that bank bits are correct.
Error[113]   D:PICEX1.ASM 29 Symbol not previously defined (RC)
Halting build on first failure as requested.
BUILD FAILEDTue Oct 25 15:07:52 2005

發表於: 2005/10/25 15:27
頂部


Re: 灌了c18 v3.0 版後,有一點怪怪的?
新會員
新會員


我的是出現 Coff file format for 'xxx.o' is out of date.
又是為什麼?

發表於: 2005/10/25 14:25
頂部


Re: 有事想請教各位前輩,希望各位前輩能幫忙
初級會員
初級會員


是有16f877的不過是用C寫的不曉的你有需要嗎?有需要再告知啊... [quote]


發表於: 2005/10/25 14:00
頂部



« 1 ... 6888 6889 6890 (6891) 6892 6893 6894 ... 7522 »



:::

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... ]

教育訓練中心

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