Re: Layout floating point numbers

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-10-04 17:34:54

Hi!

On Fri, Oct 04, 2002 at 04:02:10PM +0200, ruud.baltissen@abp.nl wrote:
> Yes, in fact this is one of the two sources I'm using as base for my
> compiler. Pascal-S has some disadvantages:
[...]
> PP4 has some bad habbits as well:
>
> - It reserves memory to store identifiers (new) but doesn't free it
> (dispose) when not needed anymore.

Here are some more:

  * Just the first 8 chars of any identifier are recognized. This one is
    easily fixed.

  * Both are using displays to access variables in the enclosing scope which I
    think is not very well suited for the 6502.

  * Output generation in one pass without an explicit syntax/expression tree
    leads to bad code.

  * Just standard pascal or below, so there are no facilities to use modules
    or units.

  * The code output by the backend is strictly stack based. Among other
    things, this means that even global variables are not really global, but
    part of a stack frame. It is quite difficult to convert this to effective
    machine code.

> > It generates some sort of pcode,
>
> This Pcode is nothing more then ML-alike instructions. Most probably derived
> from the ML-instructions of the computer where Pascal-S was meant for
> originally.

No, there has never been a machine language like this. The pcode was designed
to be generated as easy as possible by the compiler. It's strictly stack based
which matches the block structure of the language and the parser technique
used (recursive descent). It's not easy to generate good machine code when
using this sort of pcode as an intermediate language.

> I intend to generate 6502 ML-source. In that way my assembler
> can take care of generating the executable. And enables a ML-specialist to
> do some hacking :)

I would suggest to drop the existing pcode in favour of direct machine
language output instead of generating 6502 ML from the pcode. And, introducing
real global variables would help a lot to improve the speed of the generated
code.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail 2.1.4.