Tancor wrote:
Hi Toshi,
first off - I want to say how impressed I am that you did this, you did a wonderful job and I know I'd have been completely lost if I were trying to do what you did (compiler and interpreter design/redesign was not something I have ever studied)
Ok, now onto the question...
With the output currently for Orca/M - I need to convert this to pump out appropriate code for Cross32.
I know its dag2gs2 that I need to modify, and I know some of what I need to modify is in the opt0.dag and opt1.dag files - and I *think* the rest of what I would need to modify is in the gen.c file, but I'm not sure.
ie:
For orca, obviously something like:
_variable equ 15
sets variable to 15, where in cross
_variable: equ 15
sets variable to 15, it's slight differences like this that I need to modify.
You may not need to modify dag2gs2 at all. The system was designed so all the functionality is the data files.
opt0.dag contains the base functionality required to compile all code. opt1.dag contains optimizations for some common dag combinations. This was done so it's easy to debug.
Tancor wrote:
This also affects labels and such. Another major difference is the way data is set.
I also don't know if things like:
BEQ *+12
will work in my compiler.
Are handlers of this nature in gen.c? Or are they elsewhere?
You need to read the opt0.dag and opt1.dag files.
Some are generated in opt0, some in opt1.
Tancor wrote:
Also, is there a way to get dag to put its variables mostly outside of the "zero" page area?
They're not in zero page. They're on the stack if I understand your question correctly.
Tancor wrote:
Does it handle inline assembly well? for example - for me to go and make a printf function, after I get the string and any other variables into one final string, I need to call a function I've already written and tested in assembly to display the string...
No, LCC does not handle inline assembly.
Tancor wrote:
I'm also not sure where the r15 came from, I'll have to locate my copy of the orca/m assembly manual I know I have floating around here so I can properly convert what I need to...
I appologize for all of the questions, I really appreciate it tho!
Sure, no problem.
You really need to read opt0.dag and opt1.dag.
dag2gs2 basically has no intelligence. It's basically a pattern matching utility that outputs a string when a pattern is matched. All the patterns are in the opt0.dag and opt1.dag files.
Toshi