Re: A83: ret


[Prev][Next][Index][Thread]

Re: A83: ret




Yes, and to clarify, the "return adress" to TI-OS is pushed onto the stack
before your program is started, that is how the last ret "knows" to return
to TI-OS.
ret:s are simple creatures. just takes the adress from top of the stack and
jumpes there. no magic.
(and ofcourse ment to (but ofcourse not necessarily) be used with call:s
that pushes a returnadress on stack and jumps to another adress. no magic
here either.)

///Olle

----- Original Message -----
From: "D Weiss" <dwedit@hotmail.com>
To: <assembly-83@lists.ticalc.org>
Sent: Wednesday, November 29, 2000 10:33 PM
Subject: Re: A83: ret


>
> Whenever a program CALLs, the address after the call (PC registe) gets
> PUSHed onto the stack.  Whenever a RET is used, the highest 2 bytes of the
> stack get POPped off, and code proceeds there.  PUSH and POP opcodes also
> use the stack as well, so don't ret after pushing unless you popped it off
> first.
>
> >From: "Jan (belgacom)" <jandebeule@belgacom.net>
> >Reply-To: assembly-83@lists.ticalc.org
> >To: "TI-83 assembly-83" <assembly-83@lists.ticalc.org>
> >Subject: A83: ret
> >Date: Wed, 29 Nov 2000 22:01:25 +0100
> >
> >Can anybody tell me how a program knows when 'ret' is meant to exit to
> >program and when it's meant to go back from were the label is called? (i
> >hope my question is clear enough...)
> >Because i have a lot of problems using 'ret' in my program and my
emulator
> >always crashes when i want to quit.  if  it's necessary i will show a
piece
> >of my code (it's written for explorer (ion)), but i hope it's clear
enough
> >this way.
>
>
____________________________________________________________________________
_________
> Get more from the Web.  FREE MSN Explorer download :
http://explorer.msn.com
>
>
>




References: