Running Assembly Code directly within Godot

Hi Everyone,

In this update I touch on the new signals emitted from the engine which you can use in your Godot program to interact with the assembly language. I’ve added a lot more signals to give you granular control and notification of certain events. Some of these signals can also be enabled or disabled using (DOT) compiler directives. I won’t go into much detail about each as their names are pretty self explanatory.

Signals

signal assemblyscript_value(value: float) # Used to output any value to the Godot
signal assemblyscript_sysvalue(value: float) # Used to control user defined action in Godot program
signal assemblyscript_message(message: String) # Used to output compiler or debug messages
signal assemblyscript_programstarted
signal assemblyscript_programstopped
signal assemblyscript_yield # Used to inform Godot program when a yield phase starts
signal assemblyscript_programpaused
signal assemblyscript_programresumed
signal assemblyscript_processormodechanged

Signal Directives
By default all the below directives default to False if not set.

.proc true # Enables processor performance mode switching when assembly program is paused or resumed
.yield true # Controls if the enter yield phase signal is sent
.debug true # Controls outputting of debug information on program completion

Instructions
I’ve completed the implementation of the follow instructions including some comparison operators and conditional branching:

nop
brk
lda,constant
lda,register
lda,variable
lda,variable,constant
lda,variable,register
lda,variable,variable
sta,register
sta,variable
sta,variable,constant
sta,variable,register
sta,variable,variable
inc
dec
push,register
pop,register
cmp,constant
cmp,register
cmp,variable
stc
out
in
lp,label
jp,label
jz,label
je,label
jnz,label
jne,label
sys
yld
hlt

Compiler
As usual I’ve spent some more time tidying up the compiler whilst also adding the new directives as well as a constants library for things like true / false / pi etc.

Extras
There is now a memory block datatype .mb and also the byte datatype .db can now accept a list of predefined bytes values rather than just a quoted string.

Kindly

Ryn

Screen Shots


You can also look at my virtual retro machine as well, if you’re interested:

Viro 1.1 Released

1 Like