[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: Re: [f-cpu] reg. rotation
hi !
>De: Cedric BAIL
>
>> nice but how do you manage the stack
>> (increment/decrement the pointer) ?...
>
>I forgot... So it look like this :
>..macro call name
> loadaddri name, t0
> storei -8, [sp], ra
> jmp [t0], ra
> loadi +8, [sp], ra
>..endm
\o/
but now ...
how do you manage the fact that ra will not
be the restored ? because you push ra, but you pop
[sp - 8] .... SP will be ok, but not the temporary
register.
i'd do something like
..macro call name
loadaddri name, t0
storei -8, [sp], ra
jmp [t0], ra
loadi [sp], ra
..endm
..macro return
loadi +8, [sp], r0
jmp [ra]
..endm
but it looses a lot of context.
any local optimisation can remove half
of the instructions.
YG
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu in the body. http://f-cpu.seul.org/