Thursday, July 26, 2018

Gen 2 update: 3 new additions to the assembler.

The assembler has grown a bit. Specifically, it has a header variable system, the new nsp framework, as well as the new xas framework. So... Whats all that mean?

Header Variables.


source files traditionally had no say in how they were assembled in the past, thats where header variables come in. What they do does vary, however:
assembler mode

head-mode=trom, head-mode=vars

head-mode refers to the mode of the assembler. currently there are two possible values:
  • trom: normal assembly (this mode will be chosen if head-mode is omitted.)
  • vars: don't assemble a trom, but do handle nsp if enabled. (nsp is explained later in this post.)

Rom Name

head-rname=<rom name>
: override the trom output name. (excluding extension)


SBTCVM Assembly Namespace (.nsp) files:

.nsp files allow you to use the namespace variables from one assembler source file (.tasm file) in another. here are the needed header variables to use them.

head-nspout=1: enables .nsp output for that source file. (excludes variables from other nsp files, as well as any builtin variables.

head-nspname=<nsp name>: override the nsp output name. (excluding extension)

head-nspin=<nsp name>
: Import an nsp into an assembler file's namespace. you can use this namespace variable multiple times to import multiple .nsp files.

If all this .nsp nonsense sounds complicated, rest assured that one of its main purposes is to make some things easier.

SBTCVM Assembly Script (XAS)

XAS is an assembly automation script system, that makes multi-source-file projects easy to assemble.

Its main purpose isn't so very useful yet, but once Gen 2 gets a bit further along, its going to come in very handy.

Currently it has 4 commands:

  • asm: takes name of tasm source file as argument. same as g2asm.py [source file]
  • print: print argument to standard output.
  • xas: run a xas script from within another xas script. takes script name as argument.
  • exit: exit. takes no arguments
to run a XAS script, just pass it as an argument to the assembler just like you would a .tasm file.

SBTCVM Gen 2-9 repository:
https://github.com/SBTCVM/SBTCVM-Gen2-9

No comments:

Post a Comment