Re: A86: calling and returning


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

Re: A86: calling and returning




Oops...silly me forgot the code would be in RAM...


> 
> here is a good way of doing it
> 
> start:
>  ld (exit+1),sp
> ;code goes here..
> ;.....
> 
> 
> exit:
>  ld sp,0000
> 
> that first load will replace the 0000
> then when you exit the sp is restored
> 
> bacisly you can think of a call like this
> 
> call xx becomes 
> push pc \ jp xx
> 
> and a ret is just pop pc
> 




References: