Searching \ for '[PIC]: PC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'PC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PC'
2001\07\23@093054 by Andy N1YEW

picon face
is PC the Program Counter?  And what can one do with it?

i know pc is used in lookup table but i never understood it...

andy

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\07\23@100401 by Wade Carpenter

picon face
Well, PC (program counter) is just a register in the PIC (or in most/all
microprocessor/microcontroller) that stores the location in memory of the
next instruction.  So when you run your program, some sort of ORG
instruction sets the PC to a known value, which is the memory address you
want your program to begin at.  Then it just increments by one each time an
instruction is executed, unless it is a branch or jump instruction, in which
case it changes to some other value.

I hope that's clear!

- Wade
{Original Message removed}

2001\07\23@150716 by Olin Lathrop

face picon face
> is PC the Program Counter?

Yes.

> And what can one do with it?

The PC tells the processor where to get the next instruction from.  You can
modify the PC explicitly by setting up PCLATH and writing to PCL.  There are
lots of issues here.  Read the docs carefully.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\07\23@150724 by Olin Lathrop

face picon face
> So when you run your program, some sort of ORG
> instruction sets the PC to a known value, which is the memory address you
> want your program to begin at.

No, no, no!  Beginners have enough confusion here.  We must be very precise
to avoid adding to it.

ORG is an assembler directive.  It tells the assembler where in memory to
put subsequent instructions.  It does NOT load the PC or cause anything else
to happen at run time.  On a power up or other reset, the processor
initializes the PC to 0 on most PICs.  After that it is completely up to the
code what happens to the PC, except for interrupts.  On an interrupt, the
processor sets the PC to 4, after saving the original PC value on the stack.
This applies to the 16xxx series, others have some other wrinkles.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam@spam@embedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\07\24@131620 by robertf

flavicon
face
Does this mean that, at mem
location 0, the first
instruction is a jump to the
value of the ORG?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\07\24@132821 by Andy N1YEW

picon face
no.... org specifies where the code below goes.

andy
----- Original Message -----
From: "robertf" <.....robertfKILLspamspam.....MICROBALANCE.COM>
To: <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Tuesday, July 24, 2001 1:11 PM
Subject: Re: [PIC]: PC


{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\07\24@180536 by Olin Lathrop

face picon face
> Does this mean that, at mem
> location 0, the first
> instruction is a jump to the
> value of the ORG?

I doubt that "this", whatever "this" is, means that.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, KILLspamolinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\07\24@191500 by Barry Gershenfeld

picon face
>Does this mean that, at mem
>location 0, the first
>instruction is a jump to the
>value of the ORG?

No, it means that *you* have to arrange for
a jump to be put there.  ORG does not
compile anything.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...