special note: this is incomplete, also see opcodes.txt
and iobus.txt
in parent directory...
SBTCVM Assembly v3, also known as G2ASM or tasm, Is an advanced listing-style assembler for the SBTCVM Gen2-9 virtual machine.
a normal keyword is for the most part any keyword that translates to a CPU Opcode.
Normal keywords support the following argument types:
two notations are supported +0-
and p0n
notations. up to 9 trits
may be specified.
setreg1;+++---000
setreg2;pppnnn000
In order to use decimal values you must prefix them with 10x
similar to 0x
when working with hexadecimal numbers in many binary languages.
setreg1;10x12
setreg2;10x-12
you must prefix Septemvigesimal values with the 27!
prefix:
for refrence, MMM
is -9841
and DDD
is 9841
. remember gen 2
doesn't support values outside that range!
1 septemvigesimal digit = 1 triad = 3 trits.
Any combination of 3 septemvigesimal digits will work.
setreg1;27!MMM
setreg1;27!DDD
you must prefix Septemvigesimal values with the 9!
prefix:
for refrence, ZWWWW
is -9841
and 14444
is 9841
. remember gen 2
doesn't support values outside that range!
1 Nonary digit = 2 trits.
Any combination of 4 Nonary digits will work.
Due to integer range limits, the 5th digit may ONLY be 1
, 0
, or Z
!
setreg1;9!ZWWWW
setreg1;9!14444
use character values. any plain character supported by SBTCVM-BTT2 encoding
can be used when prefixed via a :
(colon).
setreg1;:C
the following characters require escape sequences:
ASCII | escape sequence in assembly |
---|---|
newline | \n |
null | \0 |
backspace | \x |
vertical bar | \v |
; |
\c |
\ |
\\ |
space | \s |
# |
\p |
, |
\m |
(see Next Section for what these are...)
setreg1;>my_namespace_var
goto;>my_label
A unified system for labels, and compile-time constants, that lies at the heart of the assembler's automatic address system.
any normal keyword can be given a label by appending one via
a second semicolon ;
setreg1;10x1;my_label
you can create your own namespace variables from raw values like this:
v>my_namespace_var;10x0
v>another_one;+0-
v>and_yet_another;:R
These keywords don't generate opcodes, but are still useful for specific things.
zerosize
is a special assembler keyword, that, like its name suggests,
is zero in size.
its mainly intended for compilers, when performing a goto to the next instruction, when its generated by separate code.
if;>skip
goto;>somewhere
zerosize;;skip
if the following code existed afterwards...
goto;>somewhere_else
then the jump to zerosize, would actually jump directly to the latter instead.
print out the address, source line number, and a plaintext name, at a given point in Assembly code
marker;example marker
this is also easily integrated into compilers that target SBTCVM Assembly.
SBTCVM Assembly's header variables control various properties on how the assembler treats your code.
(not valid in tas0 files)
head-mode=trom
head-mode=vars
(can be used multiple times for multiple nsp libraries) (supported in tas0 files)
head-nspin=stdnsp
(not valid in tas0 files)
to enable nsp file output:
head-nspout=1
(not valid in tas0 files)
head-nspname=name
(not valid in tas0 files)
head-rname=name