T.R | Title | User | Personal Name | Date | Lines |
---|
173.1 | Hints for getting started | RACHEL::BARABASH | Digital has you now! | Thu Mar 17 1988 17:11 | 19 |
| A good way to get started is to take some random source file, compile it
and do an $ ANALYZE/OBJECT on the resulting .OBJ just to see how the various
linker commands are used together. Also get the compiler to produce a
machine code listing.
In general, when your compiler is outputting a forward jump and it doesn't
yet know the destination, it should keep track of the location of the jump
operand, so that when it gets around to emitting the instruction that goes
at the destination, it can generate object code that essentially tells the
linker to go back and patch the jump with the correct PC-relative offset.
(This is usually called generating "fix-ups".)
A multi-pass code generator that does long/short optimization will know in
advance the relative offsets of all forward jumps and so has enough
information to generate smaller .OBJ files -- but even if it doesn't take
advantage of this information and generates fix-ups anyway, the resulting
executable images will be the same size.
-- Bill B.
|
173.2 | | TLE::BRETT | | Thu Mar 17 1988 22:25 | 14 |
| Use an existing backend.
Writing your own code generator is exactly akin to writing your
own version of all the RTL routines - its already been done, its
not easy, and anything one person can do is no longer technically
anything more than "boring".
It is simply not worth doing.
Producing the right IL for an existing backend is just as much of
a challenge, and the resulting code quality much better.
/Bevin
|
173.3 | | TALLIS::KOCH | Kevin Koch LTN1-2/B17 DTN226-6274 | Fri Mar 18 1988 08:18 | 6 |
| > Use an existing backend.
>
> Writing your own code generator is ... simply not worth doing.
I agree. But if you absolutely insist on doing this, the .OBJ format
is defined in the Linker manual. Good luck.
|
173.4 | perhaps use the VCG? | COOKIE::DOUCETTE | Chuck Doucette, Database A/D @CXO | Fri Mar 18 1988 12:18 | 6 |
| Perhaps it would be possible to use the VCG (Vax Code Generator)?
Is this possible for DEC internal non-product compilers? If it is a
possiblity, and somebody wanted to use it, how might they get a hold of it
(I already have some documentation on it)?
Chuck
|