This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: call insn in z80
- To: mrs at windriver dot com (Mike Stump)
- Subject: Re: call insn in z80
- From: Toshi Morita <tm2 at best dot com>
- Date: Thu, 15 Mar 2001 13:23:49 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org
rahmaiah vallabhaneni <vbrahmaiah@yahoo.com> wrote:
> > To: gcc@gcc.gnu.org
>
> > I am working for z80 port. I have the following problem with the
> > call insn pattern.
>
...
> > I am calling the function through a function pointer
> > p . So, the code generator keeps, the address
> > of p in a register and then makes call to the
> > function.
>
> > the code looks like
> >
> > ld bc,_first_fun
> > ld (_p),bc
> > ld bc,(_p)
> > ld iy, bc
> > call (iy) // problem.
> > but actually z80 does not have an instruction
> > call throgh a indirect register address.
>
> > It supports only
>
> > call (symbolic_address);
>
Mike Stump wrote:
> Sure it does, just be inventive:
>
> ld hl,(p)
>
> ld (.+4),hl
> call 0
I think the RET approach is far cleaner.
It works on multi-CPU systems and it's ROMable.
(I had a dual Z80A Onyx multiuser system at one time.
Still have the main CPU board.)
Toshi