| Related articles |
|---|
| [2 earlier articles] |
| Re: generic assembly language available? gopi@sankhya.com (2004-07-14) |
| Re: generic assembly language available? choksheak@yahoo.com (ChokSheak Lau) (2004-07-14) |
| Re: generic assembly language available? phil@ultimate.com (2004-07-15) |
| Re: generic assembly language available? arnold@skeeve.com (2004-07-15) |
| Re: generic assembly language available? gergoe@math.bme.hu (2004-07-17) |
| Re: generic assembly language available? bear@sonic.net (Ray Dillinger) (2004-08-09) |
| Re: generic assembly language available? jacob@jacob.remcomp.fr (jacob navia) (2004-08-23) |
| Re: generic assembly language available? brown@cs.bris.ac.uk (Julian Brown) (2004-08-25) |
| From: | jacob navia <jacob@jacob.remcomp.fr> |
| Newsgroups: | comp.compilers |
| Date: | 23 Aug 2004 12:14:42 -0400 |
| Organization: | Wanadoo, l'internet avec France Telecom |
| References: | 04-07-018 04-07-038 04-07-040 04-08-045 |
| Keywords: | C, assembler, design |
| Posted-Date: | 23 Aug 2004 12:14:41 EDT |
Ray Dillinger wrote:
> ChokSheak Lau wrote:
>
>>I think what you have is the closest to what I am looking for
>>(except it is not freeware), anyway, i am not sure whether the
>>idea of having a generic low-level language (much much lower
>>than C) is possible at all or not.
>
>
> For what it's worth, there is no problem with using C as a misspelled
> assembly language. Since C is semantically similar to a superset of
> assemby, you can have just about any feature you'd want in a "generic
> assembly language" just by deciding which features of C you will not
> use.
>
> I did this a couple of years ago for a LISP compiler that emitted C
> code; the code it emitted used goto's and handled its stack
> explicitly. It used no C procedure calls or other C-stack based
> control structures and it was effectively a generic assembly language.
>
> Bear
> [Lots of languages use C as a portable low-level back end. -John]
I would say that an assembler that doesn't know about overflow is
lacking some features... :-)
I added this missing feature to lcc-win32, a "portable assembler" for
many languages (Eiffel, objective C, Heron, C++ and maybe others)
All in all I think C should introduce this feture:
a*=b;
if (_overflow())
// overflow handling.
In x86 machines, intrinsic functions that get translated to
single machine instructions are handy, like _rdtsc() that will
return a 64 bit integer with the cycles of the processor, or others
Return to the
comp.compilers page.
Search the
comp.compilers archives again.