Using ACME, how do I work with code in multiple files?
Posted: Tue Sep 14, 2021 6:09 pm
Hi!
I want to organize my code in multiple files, and have them depend on each other.
Acme has a pseudo opcode for including source: "!src" But when including, you must be careful to JMP past the included instructions/data or include them *after* the main function entry point. But when including files after the code, macros are not accessible to the code above.
Also, having files include other files doesn't work, because the same file can be included multiple times. There is a sort of include guard for this:
But that makes multi pass compilation break: viewtopic.php?f=2&t=5947
I just don't get it. How am I supposed to do it? What are the best practices?
I want to organize my code in multiple files, and have them depend on each other.
Acme has a pseudo opcode for including source: "!src" But when including, you must be careful to JMP past the included instructions/data or include them *after* the main function entry point. But when including files after the code, macros are not accessible to the code above.
Also, having files include other files doesn't work, because the same file can be included multiple times. There is a sort of include guard for this:
Code: Select all
!ifdef FILENAME !eof
FILENAME = 1
I just don't get it. How am I supposed to do it? What are the best practices?