Searching \ for 'GOTO vs CALL instruction' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=goto+call+instruction
Search entire site for: 'GOTO vs CALL instruction'.

Truncated match.
PICList Thread
'GOTO vs CALL instruction'
1998\12\11@212833 by Goovaerts

flavicon
face
When you use the GOTO instruction. Does it also uses 1 level of the STACK
like CALL instructions to save its RETURN ADDRESS, because with GOTO there
isn't a return address ! Right ??

1998\12\11@225929 by Sean Breheny

face picon face
Hi,

You are correct, GOTO doesn't affect the stack.

Sean

At 02:06 AM 12/12/98 +0100, you wrote:
>When you use the GOTO instruction. Does it also uses 1 level of the STACK
>like CALL instructions to save its RETURN ADDRESS, because with GOTO there
>isn't a return address ! Right ??
>
+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
spam_OUTshb7TakeThisOuTspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\12\12@071613 by Stig Brautaset

flavicon
face
> When you use the GOTO instruction. Does it also uses 1 level of the STACK
> like CALL instructions to save its RETURN ADDRESS,

No.


because with GOTO there
> isn't a return address ! Right ??

Right.

1998\12\12@075223 by Dmitry Kiryashov

flavicon
face
Goovaerts wrote:
>
> When you use the GOTO instruction. Does it also uses 1 level of the STACK
> like CALL instructions to save its RETURN ADDRESS, because with GOTO there
> isn't a return address ! Right ??

Hello. Probably you ask about the following construction...

WBR Dmitry.

       movlw   0                       ;for instance zero
       call    subroutine_switcher     ;function is called
       movlw   1
       call    subroutine_switcher
;...
;       continue here
;...

switcher_to_subroutines:
       movwf   pclath
       xorlw   high    ($+4)
       xorwf   pclath,f
       xorlw   high    ($+2)
       addwf   pcl,f

;function_0 is here

       movlw   high    function_0      ;probably isn't required
       movwf   pclath                  ;in 2K PICs
       movlw   low     function_0
       movwf   pcl

;function_1 is here

       movlw   high    function_1
       movwf   pclath
       movlw   low     function_1
       movwf   pcl

;etc...

function_0:
;...
;       function_0 program body
;...
       return

1998\12\14@062724 by Stefan Sczekalla-Waldschmidt

flavicon
face
Hi,

Looks like just another useful code snipped - not used more then 2 K
PIC4s till now.
but...

Dmitry Kiryashov wrote:

{Quote hidden}

Dmitry, can you please give me an hint what Idea is behind the following
shortcut-math ?
I recognize it will calculate the address for setting the appropriate PC
for the subroutine, but how does it work ?? ( I never used xor for doing
a something like an n * 4  before ).

{Quote hidden}

1998\12\14@064343 by Caisson

flavicon
face
> Van: Goovaerts <.....goofy1KILLspamspam@spam@GLO.BE>
> Aan: PICLISTspamKILLspamMITVMA.MIT.EDU
> Onderwerp: GOTO vs CALL instruction
> Datum: zaterdag 12 december 1998 2:06
>
> When you use the GOTO instruction. Does it also uses 1 level of the STACK
> like CALL instructions to save its RETURN ADDRESS, because with GOTO
there
> isn't a return address ! Right ??

I don't get it : You ask me if the GOTO pushes it's Return-adress onto
stack, and than _you_ tell me a GOTO does _not_ have a Return-adres.
Confusing ....

If the GOTO does not have a Return-adres it can't push it onto the stack !
.. :-)

In short : No, a GOTO does not use any stack-space.  It ONLY changes the
current Program-Counter.

Greetz,
 Rudy Wieser

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