To Index
Your register definitions, command implementations, system properties, and even user program can be split up across several files as you wish.
You have the following options:
- The ASB command accepts more than one file, which it will be executed in order.
- Additionally, you can use the
--includecli flag to specify extra files which will be parsed first. Seeasb --help. - Use the
.includedirective within your ASB program to include another file.- This will execute the file as if it contents where present instead of the
.includedirective. .includeis followed by a string (enclosed in") which is a file reference either absolute or relative to the current file.- You may use
/as directory separator on both Windows and Linux. - Example:
- This will execute the file as if it contents where present instead of the
// From ../asb/example/virtual-register.asb:
.include "../lib/risc-v/risc-v.asb" // Loads the RISC-V implementation
- Alternatively you can use
.include_oncewhich behaves the same as.includeexcept that a file that has already been parsed will not be included again. This usually makes sense when loading a file that contains instruction set definitions (which cannot be executed more than once).