|Three Address Code firstname.lastname@example.org (2000-09-11)|
|Re: Three Address Code Sid-Ahmed-Ali.TOUATI@inria.fr (Sid Ahmed Ali TOUATI) (2000-09-13)|
|Re: Three Address Code email@example.com (Travers Naran) (2000-09-13)|
|Re: Three Address Code firstname.lastname@example.org (Travers Naran) (2000-09-15)|
|Re: Three Address Code email@example.com (Dan Cohen) (2000-09-15)|
|Re: Three Address Code firstname.lastname@example.org (Rainer Leupers) (2000-09-17)|
|From:||Dan Cohen <email@example.com>|
|Date:||15 Sep 2000 01:37:03 -0400|
Travers Naran wrote:
> <firstname.lastname@example.org> wrote in message
> > I would like to know if Three Address Code can be implemented in some
> > way other then quadruple or triples.
> I don't get it: isn't three address code inherently a n-tuple of
> addresses? Finding another implementation is looking for something
> other than three address code, isn't it? I am curious about this
> because I've only ever used n-tuples (quadruple or triples) and I too
> would be interested if there was another way.
My first computer was a microprogrammed machine. The micro instructions
allowed me to create a new programming language. I was pretty new to
programming, so I chose a 3-address scheme, like this:
op source1 source2 destination
and the operands were all memory (RAM) addresses.
Here's an example program to convert to upper case: (the dashes are
place holders, my input was formatted)
in tty0 - buffer ! input a character from console
comp buffer 'a' - ! set flags by internal subtract
jump neg - dont ! buffer < 'a', not lower case
comp buffer 'z' - ! set flags by internal subtract
jump pos - dont ! buffer > 'z', not lower case
sub 'a' buffer buffer ! lower - 'a'
add 'A' buffer buffer ! + 'A' gives UPPER
It seemed like a good idea at the time. But you'll notice that every
instruction coded in this routine has an unused field, or else a
duplicate field. Actually, in use, I had a lot of instructions with 2
fields unused, too.
Well, my assembler program worked, and I am proud of it. But I'll never
do it that way again.
Today, I sometimes to 803876, but actually I prefer 65c02 or 68000.
-- Dan Cohen in Calgary
Return to the
Search the comp.compilers archives again.