Showing posts with label assembly. Show all posts
Showing posts with label assembly. Show all posts

Thursday, September 13, 2018

Gen 2 update: stacks n keyboards.

SBTCVM's CPU makes some progress, as the cpu is now equipped with a whopping 2 stacks. 

Along with the cpu, SBTCVM Gen 2-9 is now capable of interactive programs, thanks to a new TTY Input device, that allows for a basic serial text interface.
Aside from the usual assembly enhancements, SSTNPL has gotten its share of changes too:

  •  you can now create variables based on character code values.
  •  you can read from the tty input buffer into a variable for easy parsing of keystrokes.
  • return is now stackable.
  • separate subroutine gotos are required to use return.
  • conditional returns are now available.

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

Friday, June 29, 2018

Gen 2 update: a look at the new assembler.

SBTCVM's assembler has been with it for a long time. Since the prototype era actually. Gen 2's ground-up rebuild of the VM also brings a similar treatment to good old SBTCVM tasm.

Syntax checks:

no less than 2 syntax check passes and 1 validation pass before writing to a trom file, along with a new trom format, ensure problems with corrupt roms are unheard of in Gen 2. saving coders time and energy.

simple numeric data tweaks:
first, decimal support has been added:

setreg1;10x32
setreg1;10x-12

second, ternary support has been overhauled:

two representations are supported:
+0-
p0n

Also, ternary values can be any arbitrary length from 1 to 9 trits.


Unified namespace:

the goto reference label, iobus address macro, and other namespaces accessed via '>' have been merged into a singular namespace, with custom variable support:

the v> prefix keyword supports all the numeric representations supported by most keywords:
v>myvar;10x1
They can even point to namespace entries to duplicate their value.
v>myvar2;>myvar

normal keywords can do this too:
setreg1;>myvar

dual data ahoy: 

Gen 2's new dual-packing concepts and the mirrored data/instruction size have been complimented by a new raw instruction:
raw;10x56,pn00pn'

They, of course, can be mixed numeric syntaxes.

Overall: 
This rock solid, modular, base of features will prove to be very useful in the coming months, as the Gen 2 instruction set and CPU development enter full swing.

Wednesday, February 14, 2018

Utilities - New Development aids: GUIasm & memory map views

GUIasm

For the longest time, the only way to run the assembler was by typing in a string of commands into a terminal.

Now when you open tasm files in fileview2 and fileman in run mode, GUIasm will open up and easily allow for repeat assembling with a mouse click, an automatically opening a log of assembler output upon errors. It can also be run from codeview as well.



Codeview enhancement: memory view.

When Opening troms and .dmp memory and iobus dumps in codeview, users will see a handy new memory view.

This view can be scrolled independently from the main view with w & s (or e & d for faster scrolling), or by scrolling over it with the mouse wheel. It even highlights faulty trits in red for easily knowing when somethings not quite right.


Monday, July 17, 2017

SBTCVM utilities - codeview

testthread.tasm in codeview
Codeview is a new variant of the text viewer written especially for viewing tasm source code.

It offers line numbers, and even has some basic syntax highlighting:

text blocks are in blue.
comments are in red.
lines with |> references are highlighted in green
lines with reference labels are highlighted in blue.

Sunday, July 9, 2017

SBTCVM Mark 2 - memory pointer support

The dev team has checked a to-do off the list today...

basic memory pointer support has been implemented. Now you may be wondering... "What does that mean?"


Well, to sum up, memory pointer support adds special memory read/write operations and a special memory pointer control operation to enable programs to iterate through large sections of memory, read and write data using a program-controlled pointer, and so on.

in addition, goto reference support has been added to setreg1 and setreg2. so now using the new ptset operation is far easier. allowing memory pointers to be set using the assembler's built-in address calculation features.


lets take a quick look at the new memory pointer assembly operations:

ptread: read to reg 1 using memory pointer 
ptwri: write to memory location using memory pointer and reg1
ptwridat: write to memory location using memory pointer and data portion of word.
ptget: copy memory pointer to CPU register 1
ptset:  set memory pointer using data from CPU register 1
ptadd: add value of CPU register 1 to memory pointer
ptinc: increase memory pointer by 1
ptdec: decrease memory pointer by 1