But why do you need to include the same file 18 times?
The included files contain different sections that are activated by the PhaseXX defines.
This is for an emulator (a bytecode interpreter). There are 256 opcodes, and each opcode can be 2..9 cycles. 1 cycle is 2 phases. Also, the CPU can be in 2 modes (indicated by n and e). So I have to differentiate between up to 18*2*256 = 9216 phase handlers; each of them is actually only a few lines of code (and many are empty).
I have most of that code already written, now I have to put it together somehow though and turn it into a working program.
A very strange programming style for Pascal.
Yeah, it's a bit closer to C etc. than to Pascal. Including compilation times.
I get the impression you are confusing Pascal with an interpreted script.
I'm deliberately using
$ifdefs here, this is supposed to be resolved at
compile time. (And no, inline doesn't always work - already tried that.)
Why don't you use variables to control program flow?
Because maintaining that state adds to the system requirements and we don't have 10GHz CPUs yet.
But this is actually not solely for running the program: this is for
storing the code that is easily accessible. I don't know yet if my approach at the main loop is going to be the fastest one, so I put the code into include files to be able to try several designs without huge rewrites.
Now it turns out that each added or removed
character slows down the editor to a crawl. Sigh.