Searching \ for '[PIC]: CALL instruction?' 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: 'CALL instruction?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: CALL instruction?'
2001\04\22@225738 by Mike Laurin

picon face
Sorry if I'm doing this wrong but it's my first time.
I'm also new to PICs.
I've got a basic question.
I'm writing a program for a PIC16F84A in assembly.
Question: Can you nest CALLs?
ex:
call    x
..
..
x    -----
    -----
   call    z
   return
..
..
z    -----
   -----
   return

Thanks for any help!!!
Mike

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\04\22@231651 by Tony Nixon

flavicon
picon face
Mike Laurin wrote:
{Quote hidden}

Yes you can, up to 8 of them. That is because the 16F84 has a stack that
can hold 8 return addresses.

If you push more than 8 addresses onto the stack by nesting more than 8
CALL's, then the stack pointer will wrap around and start overwriting
the other addresses.

Interrupts also use the same stack for storing return addresses.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
spam_OUTsalesTakeThisOuTspampicnpoke.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\04\23@002433 by Mike Laurin

picon face
{Quote hidden}

Thanks Tony!!
Take care..
Mike

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\23@090534 by Olin Lathrop

face picon face
> Question: Can you nest CALLs?

Yes, to a limited depth.  PICs use a dedicated return address stack.  On all
but the 18 family, this is totally inaccessible from software.  The maximum
call depth depends on the size of this stack.  The really little PICs only
have a stack depth of two.  Most of the later 16 family have an 8 level
stack.  I don't remember what the stack depth of the 16F84 is, but you can
easily look that up.


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

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


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