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

Re: [f-cpu] New suggestion about call convention

Christophe Avoinne wrote:
> Not very clear...
> I did program with Z80 (I have a very old SHARP MZ-80K) not least 18 years
> ago. Even if it has two exemplars of register set, it has only one stack at
> once. So what is the meaning to sort recursive or non-recursive functions ?
> it makes a sense to use a normal stack for recursive-stack but what about
> non-recursive function ? due to the limit of register (8bit : A, B, C, D, E,
> H, L; 16-bit : BC, DE, HL) it is very hard not to be forced to save those
> registers into stacks. A push/pop rr takes 3 cycles and one instruction. A
> ld rr,(nn)/ld (nn),rr takes 6 cycles and 4 instructions. And a ld r,(nn)/ld
> (nn),r takes 4 cycles and. So you'd better to do "push bc" instead of doing
> "ld bc,(nn)" or "ld b,(nn); ld c,(nn+1)" when possible. But because the
> instruction set is rather restrictive about the use of each register, it was
> very difficult for using them as callee-saver registers and not very
> efficient comparing with the static global memory. But using static global
> memory with F-CPU is nothing comprarable with a Z80 !?

I think so, the large register set of the F-CPU could be compared
to static global memory on the Z80/8080. If you consider the 8080
a 8 bit RISC machine things look cleaner. Direct addressing
( register F-CPU ) (memory 8080 ) (Page Zero 6502,6800) are both very 
fast but suffer problems with dynamic use.

Personaly I favor a machine with memory /acumulator achitecture
and haveing the cache handle usage.


To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/