You have basically only pass1 for any shenanigans. Pass2 should have already the same layout as pass3 (labels positions, machine code can differ).
As far as I can tell what you are trying to do (place routines into memory = different labels), at the beginning of pass2 you must already know precisely how you will generate the final code (in the same way, in both pass2 and pass3).
The N-pass will make this a bit more relaxed, that the requirement will be to have stable two passes (when lastpass == previouspass => finish assembling), but still it will have to happen in some reasonable amount of passes (probably configurable at command line).
I still believe the N-pass will be substantially less universal (= more limited) than Lua itself, which is full scripting language surpassing by far any limits of 3-pass or N-pass assembling. Although it's pain to write, and it's pain to read such code generators back, and try to guess how they work...
But maybe you have some nice idea for which the N-pass would be perfect fit, it's quite possible. The current 3-pass is sufficient only for simple straight assembler, any sort of more dynamic stuff is problematic.




Ответить с цитированием