[A86] Re: TI-86 Menu Routine


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

[A86] Re: TI-86 Menu Routine




The SDCC compiler uses the stackframe thingy. While the Z88DK uses the same
way as used in this menu routine.

> Van: rabidcow@juno.com
> 
> Well, except here the choice is between passing parameters on the stack
> or passing them in memory with a pointer, and he's not even using a stack
> frame.  This code would not be callable from C, but it reminds me of that
> :)
> 
> If anyone's wondering, here's how a stack frame generally works on a z80:
> 
> ; enter stack frame
>   push ix
>   ld ix,0
>   add ix,sp
> ; here you can allocate space on the stack for local vars
> ; usually by pushing garbage, but if you need a lot you'd sbc it from sp
> 
> ; ix-5 = last byte of parameters
> ; ix+0 = first byte of local vars
> 
> ; exit stack frame
>   ld sp,ix
>   pop ix
>   ret
> 
> Not very efficient at all.