Truncated match.
PICList
Thread
'error label'
1997\09\19@113247
by
engelec
Hi to all pic microcontroller Engineers.
I have two questions for you.
1. What is the reason when I label name error Mplab doesnât like it
displays symbol previously not defined. when I change it to something
else works ok. How can find
out what to lable.is there any specific names that shouldnât use?
2. the way I understood about cblock is it is automatic equation that
compiler
will find empty location and use it. let say I am using simple table
code when
I use cblock it doesnât work when I use manual way like xxxx equ xxx
works ok. Could you tell me when should I use Cblock instraction. the
way I use it
cblock 0x00
test
endc
Andre thank you for any help.
1997\09\19@145302
by
Andrew Warren
|
Andre Abelian <spam_OUTengelecTakeThisOuT
earthlink.net> wrote:
> 1. What is the reason when I label name error Mplab doesn't like it
> displays symbol previously not defined. when I change it to
> something else works ok. How can find out what to lable.is there any
> specific names that shouldn't use?
Andre:
MPASM doesn't let you use "ERROR" as a label name because there's
an assembler directive called "ERROR"... For the same reason, you
can't use "EQU", "ORG", "MACRO", or any of the other directives
as label names.
> 2. the way I understood about cblock is it is automatic equation
> that compiler will find empty location and use it. let say I am
> using simple table code when I use cblock it doesn't work when I use
> manual way like xxxx equ xxx works ok. Could you tell me when
> should I use Cblock instraction. the way I use it
>
> cblock 0x00
> test
> endc
CBLOCK doesn't automatically find empty locations; it just
assigns sequential values to a list of symbols. To use it
properly, you must specify a valid starting address... For
example:
CBLOCK 0x20
TEST1
TEST2
ENDC
The above fragment will assign TEST1 to 0x20 and TEST2 to 0x21;
it's equivalent to:
TEST1 EQU 0x20
TEST2 EQU 0x21
-Andy
=== Meet other PICLIST members at the Embedded Systems Conference:
=== 6:30 pm on Wednesday, 1 October, at Bytecraft Limited's booth.
===
=== For more information on the Embedded Systems Conference,
=== see: http://www.embedsyscon.com/
=== Andrew Warren - .....fastfwdKILLspam
@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499
1997\09\19@175408
by
lilel
> Could you tell me when
> should I use Cblock instraction. the way I use it
>
> cblock 0x00
> test
> endc
Cblock begins initializing variables at the memory location you
specify. CBLOCK 0x00 begins assigning labels to memory locations at
file address 00, which is the INDF register (in the '620)
You have to begin CBLOCK at an available file address. the '620's
first available address is 0x0d, on the '54 it is 0x07.
TRY:
cblock 0X20 ;(Or whatever the first
; available general purpose register
;is)
TEST
COUNTER1
ENDC
Best Regards,
Lawrence Lile
1997\09\19@215116
by
Shane Nelson
On Fri, 19 Sep 1997, Lawrence Lile wrote:
>
> You have to begin CBLOCK at an available file address. the '620's
> first available address is 0x0d, on the '54 it is 0x07.
>
> TRY:
>
> cblock 0X20 ;(Or whatever the first
> ; available general purpose register
> ;is)
> TEST
> COUNTER1
> ENDC
>
>
> Best Regards,
>
> Lawrence Lile
>
I've found a slightly different approach to be somewhat more
portable. I keep headers for each different pic that I use in
their own seperate dirs, ie:
c:\code\16f84\reg.h
c:\code\16c54\reg.h
In the reg.h I'll define a variable called "FirstRam", then I
just include the reg.h from the correct directory. My first
cblock statement becomes:
cblock FirstRam
...
bunch_of_variables
...
endc
Using this method you can easily use the same code on different
processors. Then just make sure you get the correct reg.h file,
and handle all tris/option/memory differences approriatly.
-Shane.
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...