Hello John.
18 Mar 98 10:18, John Stephenson wrote to Fernando Ariel Gont:
JS> I'm in the process of trying to write a high-level single-pass
JS> compiler. If anyone knows anything on compilers, I'd love to
JS> talk to them.
I should know something. Imho the easiest way for a single-pass compiler is
to store all the offset-addresses (and segment-addresses if necessary) of the
labels and the offsets of the jmp-instructions with the labels to jmp to. Of
course use all the jmp-instructions that require 2 bytes instead of 1. After
the complete source-code has been compiled fill in the jmp-offsets.
When using segments always use jmp-instructions that require 4 bytes. The
code won't be optimized. If you'd like to optimize, I recommend to use a
double-pass.
Jos
--- GoldED 2.50 UNREG
---------------
* Origin: (2:500/19)
|