Searching \ for '[OT]: Making of a C compiler' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/language/index.htm?key=c
Search entire site for: 'Making of a C compiler'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: Making of a C compiler'
2001\07\05@154404 by Simon-Thijs=20de=20Feber?=

flavicon
face
Hello all,

No this is not the next proposal for a C-compiler.
I was just wondering how the compiler is made.

teh company i work for has a processor of which they
cannot make a c compiler just because it has no
Orthogonal Instruction Set.

This does not mean anything to me !!

Please can some one elaborate ???


grtz,


Simon


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\07\05@155441 by Don Hyde

flavicon
face
Well, the compiler guys just don't want to mess with it.  The PIC's is about
as un-orthogonal (and compiler-unfriendly) as you can get, but there are
several compilers for them, and some of them are pretty good.

Orthogonality in an instruction set means that it has a bunch of registers
that are alike, with instructions that all work the same on all the
registers.  Very few actual processors are completely orthogonal, and some
of the most common (such as Intel's and PIC's and RISC machines) are very
far from that ideal of convenience for compiler writers.

> {Original Message removed}

2001\07\05@155851 by Spehro Pefhany

picon face
At 08:42 PM 7/5/01 +0100, you wrote:
>Hello all,
>
>No this is not the next proposal for a C-compiler.
>I was just wondering how the compiler is made.
>
>teh company i work for has a processor of which they
>cannot make a c compiler just because it has no
>Orthogonal Instruction Set.
>
>This does not mean anything to me !!

It's basically a steaming pile of B.S. (gee, hope nobody
reads this while they are eating), if that's the only reason.

>Please can some one elaborate ???

"Orthogonal" in this context refers to the instruction
set being "nice" in that, for example, all addressing
modes are supported for all kinds of operands. It
may be slightly more difficult to make a compiler for
a processor that has a non-orthogonal instruction set,
but it does not make it impossible. A compiler does
not have to use every instruction, only enough
instructions to do whatever it is that it has to do.

If you are interested in compiler design, you can
do worse than go to the library and pick up the
old classic, the "dragon book", Compilers, Principles
Techniques and Tools (Aho, Sethi, Ullman). As Walter
Banks said, the basics are quick and easy. The details-
the libraries, error detection and recovery are not
so easy. The PIC instruction set, taking all devices
into account, is a dog's breakfast, IMHO. The existing
vendors are doing quite well, I think.

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2001\07\05@160113 by James Paul

flavicon
face
Don,

I disagree with you about the Orthogonality of the PIC's.  That's
one of it's claims to fame.  Or at least so I was told, and from
what I've experienced.   Now, how that relates to writing a C
compiler for them, I haven't a clue.  But from a programmers point
of view, all instructions operate on all registers the same way as
far as I can tell.  Correct me if I'm wrong, but I just disagree
with this point.

                                           Regards,

                                             Jim




On Thu, 05 July 2001, Don Hyde wrote:

{Quote hidden}

> > {Original Message removed}

2001\07\05@160848 by Dipperstein, Michael

face picon face
The Intel 80X86 instruction set is not orthogonal, yet there seems to be no
shortage of compilers that target it.

-Mike

{Original Message removed}

2001\07\05@161940 by Spehro Pefhany

picon face
At 12:59 PM 7/5/01 -0700, you wrote:
> Don,
>
> I disagree with you about the Orthogonality of the PIC's.  That's
> one of it's claims to fame.  Or at least so I was told, and from
> what I've experienced.   Now, how that relates to writing a C
> compiler for them, I haven't a clue.  But from a programmers point
> of view, all instructions operate on all registers the same way as
> far as I can tell.  Correct me if I'm wrong, but I just disagree
> with this point.

RAM and code banking is one big deviation from orthogonality. The
12-bit processors are particularly unpleasant from this perspective.
If you can't easily generate relocatable code, a decent compiler gets
much more difficult. In some cases, the compiler vendors just gave
up. I think Hitech C, for example, does not support arrays larger
than 256 elements on the 12-bit processors.

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam.....interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2001\07\05@163129 by Don Hyde

flavicon
face
Well, I guess it's as much a matter of viewpoint and semantics as anything.
The PIC doesn't really fit the usual collection of processors, so I am not
sure that the usual definitions fit all that well.

The PIC's designers like to describe it as "RISC-like", but to me it seems a
lot more like a classic single-accumulator machine that just doesn't have a
very big ram, and not like a RISC machine with a bunch of registers (and
usually no accumulator).  If it's a RISC machine with a bunch of registers,
then someone lost the main memory!

As a single-accumulator machine, the fact that the rotates don't work on W
and that MOVLW exists only for W and not for any other register seem pretty
non-orthogonal to me.

I am used to thinking of an orthogonal instruction set being more like that
of the 68000, which comes about as close to orthogonality as any
mass-produced microprocessor, and it's got so many exceptions that it
doesn't do a compiler writer much good.

What the PIC CPU really is, in my opinion, is a very clever job of getting a
usable processor out of a very small number of flipflops and gates.  Look at
a photomicrograph of one of the chips.  The CPU of the 16F877 in the poster
I've got on my wall is barely larger than the USART, and is dwarfed by the
RAM and the ROM.

> {Original Message removed}

2001\07\07@061018 by Peter L. Peres

picon face
> making a compiler

A compiler is usually built by a LALR parser generator, and a code
generator. Sometimes it also contains an optimizer. The LALR p.g. is a
program that runs on a computer and translates a special file, that
describes the language the compiler is to parse, into C or C++ code that
can parse that language. The code generator is written by hand by experts
in the target CPU, as it is the part that generates assembly code proper.

The basic idea that underlies compiler design is: Any structured high
level language construct is translatable into a turing machine program or
a simple state machine program (i.e. a program with simple instructions
read sequenctially -- like assembly). Finding the optimal sequence of
assembly that does this however, is a major effort. Optimizers do this.

Peter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\07\11@145022 by uter van ooijen & floortje hanneman

picon face
> No this is not the next proposal for a C-compiler.
> I was just wondering how the compiler is made.

Get hold of the 'dragon book' (Aho-Ullman-...)

> teh company i work for has a processor of which they
> cannot make a c compiler just because it has no
> Orthogonal Instruction Set.

Most existing compilers are based on certain assumptions about the traget
architecture. Re-targeting such a compiler to a target that does not satisfy
those assumptions is impractical (too costly). This is the reason noone has
yet re-targeted GCC to the (14 and 12 bit) PICs.

Building a compiler from scratch is also a BIG project.

So they might be right, although 'cannot' should be read as 'it is too
expensive'.

Wouter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...