Yep yep =D Glad to help ------------------------------------------------------------------------ Daniel Chia "Genius is one percent inspiration and ninety-nine percent perspiration." - Thomas Edison E-mail: danielcjh@yahoo.com.sg MSN: danstryder01@yahoo.com.sg ICQ: 37878331 ------------------------------------------------------------------------ > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of > Micah Carrick > Sent: 23 January 2005 10:50 > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] Equates or CBlock? > > Thank you for you help. So if I understand correctly... > > An equate is just a way of defining constants which the compiler will > know to replace the label with the defined constant value anywhere it > sees it in the souce code. > > A Cblock actually allocates a block of RAM to store a value and can > therefore be manipulated etc. > > Is this correct? > > Daniel Chia wrote: > > >EQU are equates, which basically assign a constant value to a symbol, > >for example > > > >debugPin1 EQU 1 > > > >means that whenever you use debugPin1 in your program, it will be > >replaced with 1. > > > >Cblock however is used to reserve a block of RAM and to give it a more > >meaningful name. Example, > > > >Org (ram address here) > > > >Cblock > >myCounter > >myCounter2 > >endc > > > >in the program code you could do inc myCounter or the like, where > >myCounter will actually have the address of a slot in RAM. The > >allocation is automatic based on where you org -ed the cblock. > > > >----------------------------------------------------------------------- - > >Daniel Chia > > > >"Genius is one percent inspiration and ninety-nine percent > >perspiration." > > > > - Thomas Edison > > > >E-mail: danielcjh@yahoo.com.sg > >MSN: danstryder01@yahoo.com.sg > >ICQ: 37878331 > >----------------------------------------------------------------------- - > > > > > > > > > >>-----Original Message----- > >>From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On > >> > >> > >Behalf Of > > > > > >>Micah Carrick > >>Sent: 23 January 2005 07:15 > >>To: piclist@mit.edu > >>Subject: [PIC] Equates or CBlock? > >> > >>Y'all are going to be seeing alot of questions from me in the next > >> > >> > >week > > > > > >>or two... > >> > >>I'm trying to figure out when I should use an EQU and when to use the > >>CBlock. What is the difference? > >>-- > >>http://www.piclist.com PIC/SX FAQ & list archive > >>View/change your memb feeip options at > >>http://mailman.mit.edu/mailman/listinfo/piclist > >> > >> > > > > > > > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist