Programmable Synth Controller Source Specification
NOMENCLATURE
Addresses
DST
SRC
RB
RE
TB
Addresses are 16 bit and written as 4 case insensitive hexadecimal characters with no spaces and no prefix or suffix. e.g.:
0000
00f8
1B6F
F0e4
Literals
$LIT
$TSTEP
$RSTEP
$COUNT
Literal values are 16 bit and written as 4 case insensitive hexadecimal characters with no spaces and no prefix or suffix. (Examples same as per Addresses).
Interrupts
I
Interrupts numbers are 8 bit and written as 2 case insensitive hexadecimal characters with no spaces and no prefix or suffix. e.g.:
00
01
F4
Interrupt functions are Interpreter specific and not defined here.
OPCODES
GENERAL
No operation:
NOP
MEMORY MANAGEMENT
Copy literal value $LIT
to address DST
:
MOVL DST, $LIT
Copy value at address SRC
to address DST
:
MOVR DST, SRC
Fill a range of memory in address range RB
to RE
inclusive with value $LIT
:
FILL RB, RE, $LIT
Copy a $COUNT
values of memory from address range starting RB
stepping $RSTEP
addresses at a time to range starting TB
stepping $TSTEP
addresses at a time:
COPY TB, RB, $TSTEP, $RSTEP, $COUNT
INTERRUPTS
Raise interrupt number I
:
INT I
Interrupt data: when interrupt I
is raised, attach memory address range RB
to RE
inclusive to the handler's data:
INTM I, RB, RE
Remove any attached data when interrupt I
is raised:
INTR I
ARITHMETIC
Note that no effort is spent in the base interpreter for handling overflow or underflow. It will just happen without warning or notification.
Note that in the base interpreter, division or modulus by zero will cause your program to halt without warning or notification.
Increment value at address DST
by 1:
INC DST
Decrement value at address DST
by 1:
DEC DST
Add literal value $LIT
to value at address DST
and store result in DST
:
ADDL DST, $LIT
Add value at address SRC
to value at address DST
and store result in DST
:
ADDR DST, SRC
Subtract literal value $LIT
from value at address DST
and store result in DST
:
SUBL DST, $LIT
Subtract value at address SRC
from value at address DST
and store result in DST
:
SUBR DST, SRC
Multiply value at address SRC
by $LIT and store result in DST
:
MULL DST, $LIT
Multiply value at address SRC
to value at address DST
and store result in DST
:
MULR DST, SRC
Divide value at address DST
by $LIT and store result in DST
:
DIVL DST, $LIT
Divide value at address DST
by value at address SRC
and store result in DST
:
DIVR DST, SRC
Modulus value at address DST
by $LIT and store result in DST
:
MODL DST, $LIT
Modulus value at address DST
by value at address SRC
and store result in DST
:
MODR DST, SRC
FLOW CONTROL
Jump Conditional:
JCN COND, SRC, LABEL
COND
:
This is a single hexadecimal digit:
- if F then Unconditional,
SRC
ignored, else - if 0 then Jump if value at address
SRC
== 0, else - if 1 then Jump if value at address
SRC
!= 0, else NOP
Halt execution:
HLT
MEMORY MAP
Mandatory
The base Interpreter provides general purpose ram in the range 0x0000 - 0x00FF inclusive (256 16 bit words). This is kept deliberately small since this is likely to be compiled into an embedded device by default.
Extended interpreters may map additional memory immediately after this range (up to 0xAFFF).
PSC recommended
0xB000 - 0xFFFF (20k words) is reserved for 160x128x16 graphics memory.