[A86] Re: ROM / RAM equates database


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

[A86] Re: ROM / RAM equates database




> And then I haven't even explained the header and libs... (hmmm, Venus libs
> aren't 'relocatable', you need to use JR's and the such, lib-internaly...)

Thanks for the explanation on Venus.  Sounds interesting.

> When you look at the newest SDCC versions then you see that it has still
> some internal compiler problems, and some problems with generating Z80
code
> (Z80 isn't the primary target of the SDCC compiler). It lacks libraries
and
> startupfiles, currently it can be used for creating Z80 and 8051 ROM's,
and
> that's about it...

In other words, it sucks, just like all the other compilers.  I took a look
at ZINC (for the 85) and a small C port last night.  Both were very lacking
in features, and produced terrible code.  Granted, I'm not saying it's easy
to make an optimizing compiler, especially for the z80.  But you won't get
anything efficient when you're outputting code during the parsing stage!
The compilers I look at were really pathetic.  Is there anything better?

> >  For example, there's no good way
> > of doing relocatable code, libraries, separate modules, etc.
>
> ??? Not if you use TASM off coarse...

What do you mean?  TASM can't magically create relocatable code for you.  No
matter how you do it, it's going to be innefficient.

> >  Perhaps a
> > simpler C like language that was geared towards generating optimized
code
> > would be better.  If you ever saw Turbo Pascal demos written in the late
> > 80's and early 90's, then you know what I'm talking about.  The programs
> > would be mostly inline assembly, with Pascal just as the glue holding it
> > together.
>
> On the z88dk almost all libs are in Z80 assembly, not in C, I guess that's
> what you mean?

No, not at all.  Again, if you don't remember what I'm talking about, then
you might have trouble picturing it :)

void foo()
{
  asm
  {
    ... ; cool stuff here
  }
}

Something like that.  Where things like sprite routines, graphics code,
etc., it's all done in assembly.  Anything time critical, or that needs to
be small, you write it in assembly.  But it's much faster than writing the
entire program in assembly.  And the generated code should be as close as
possible to hand written assembly in terms of quality.

> Same header format would be nice. You could then think of actually using
> the library functions of shell. Now every shell uses a differen't format.
> Some want you to add special datapointers to the libs, add
> relocationtables, etc.
> When you have just one system you can implement that (instead of needing
to
> add dozens of differen't supports for the different shells).

Sure.

Not sure how you'd want to handle rom calls and such.  Probably have a macro
for it, or a function wrapper that would get inlined.

> I know what a peephole-optimizer is...
>
> Superoptimizers can be used to generate a RULES file for the
> peephole-optimizer... You get it?

Show me some papers or books that describe this process :)

The problem is determining what is equivalent.  If a flag is set
differently, are they equivalent?  No, but does it matter?  It's very hard
to tell without knowing the context of the code.

Anyone who has programmed in z80 for a while could much more easily make a
list than a program.  Unless you know how to do pruning for it, for any
sequence over a few bytes, it would take literally forever to run.

> I already have some idea of making a basic 'synthesiser' as you called it
> (I called it a 'Superoptimizer', as used by the GNU-community and some
> universities). There are only some commands it will handle as
'breakpoints'
> (code after that doesn't matter, and code before it must generate the same
> register values).
> These are JR/JP/CALL/RET, since I can't be shure of what it jump/calls/etc
> to. And IN/OUT, since these affect the 'outside world' of the processor.

What about flags?  How do you know if they necessary?

> The main problem is that you can't optimize really good if you don't know
> that registers may be 'lost' and which not. For example, calling a ROM
> routine most of the times doesn't need all the registers as input. How do
> you describe that in the code?

Look at the Watcom C/C++ compiler's assembly #pragma's for a good example of
this.

> Keyword is 'Dune', and people who get it might think I'm a geek. But
"geeks
> rule the world" :-)

Heh.  I missed that movie when they showed the remake on the Sci-Fi
channel...

> I mean 'time', in the way of 'What time I can spend on these projects'...

That's exactly what I meant.  Since such a project isn't directly related to
current or future employment opportunities, it is difficult to allocate a
large amount of time to it.






References: