At 01:24 PM 10/19/2001 -0400, Gregor N. Purdy wrote: >James -- > > > Hey all. I just looked through the changes to jakoc, and I think the > > calling convention is mostly good... except for the return address. > > > > Originaly, I thought that perhaps it'd be good to put the return address > > after the args on the stack, so that once you've eaten the args, it's > in the > > right position to ret without doing any swaps. > >I just put in the 'rotate' op Dan requested instead of 'swap', and it begs >the question: > > Should we have bsr(i|ic, i|ic), that jumps to $1, with the return > address below the $2 arguments? Similarly, should we have ret(i|ic), > that rotates the return address out from under $1 arguments and then > returns to it?
Nope. For a number of reasons, the biggest being that we're not returning our return values on the stack. :) > > OTOH, we could keep our current ABI, and pop the return address into an I > > register, and then push it and ret, or jmp to it. > >The return address is a pointer, which doesn't necessarily fit in an IV, >I believe. I played with doing this first, but didn't like having to use >a register for it. If we wanted registers to be part of the calling >convention, we should just say so, but again we run into the question of >which type of register to use. I'm currently leaning either towards returning values in registers [PSIN][0-4] with the total number of each type in register I0 somehow, or as arg stack that's separate from the call stack. The latter is probably the better way to go, but it's got more overhead in some ways. It'd make interfacing with RPN languages easier, though. Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk