Instruction Set

The Instruction Set is also called by it’s name, Astrisc, and also sometimes called Assembly

Indexed:

  1. NOP
  2. AIN
  3. BIN
  4. CIN
  5. LDIA
  6. LDIB
    RDEXP (Removed in v2.0.0-alpha)
    WREXP (Removed in v2.0.0-alpha)
  7. STA
    STC (Removed in v2.0.0-alpha)
  8. ADD
  9. SUB
  10. MULT
  11. DIV
  12. JMP
  13. JMPZ
  14. JMPC
  15. JREG
  16. LDAIN
  17. STAOUT
  18. LDLGE
  19. STLGE
  20. LDW
  21. SWP
  22. SWPC
  23. PCR
  24. BSL
  25. BSR
  26. AND
  27. OR
  28. NOT
  29. BNK
  30. VBUF
  31. BNKC
  32. LDWB


NOP

ID: 0

No operation: acts as a fetch without an instruction.

Syntax:

NOP


AIN

ID: 1

Load data from the given address into registerA

Syntax

AIN <Address>


BIN

ID: 2

Load data from the given address into registerB

Syntax

BIN <Address>


CIN

ID: 3

Load data from the given address into registerC

Syntax

CIN <Address>


LDIA

ID: 4

Load immediate value into registerA

Syntax

LDIA <Value>


LDIB

ID: 5

Load immediate value into registerB

Syntax

LDIB <Value>


RDEXP

(Removed in v2.0.0-alpha)

ID: 6, 0b00110

Read from the expansion port into register A.

Syntax

RDEXP


WREXP

(Removed in v2.0.0-alpha)

ID: 7, 0b00111

Write from register A onto the expansion port.

Syntax

WREXP


STA

ID: 6

Store register A into the given memory address.

Syntax

STA <Address>


STC

(Removed in v2.0.0-alpha)

ID: 9, 0b01001

Store register C into the given memory address.

Syntax

STC <Address>


Math

IDs: 7    8   9    10

Execute the mathematic operation on
register A & B and save the result in A.


Syntax

ADD

A  +  B  🠖  A

ADD

SUB

A    -    B  🠖  A

SUB

MULT

A  ×  B  🠖  A

MULT

DIV

A  ÷  B  🠖  A

DIV


Jump

IDs: 11    12    13    14

Jumps to the given instruction position,
done by setting the program counter.
The address is given by the value stored
directly after this instruction in memory

Syntax

JMP

JMP
HERE <Address>

JMPZ

Jump if register A is zero

JMPZ
HERE <Address>

JMPC

Jump if the carry bit is set

JMPC
HERE <Address>

JREG

Jump to the value stored in register A

JREG

All jump instructions reset the bank to 0.


LDAIN

ID: 15

Use register As value as memory address
to load a value from RAM into register A

Syntax

Memory  🠖  A

LDAIN


STAOUT

ID: 16

Use register As value as memory address to then
store the value inside of register B into RAM


Syntax

B  🠖  Memory

STAOUT


LDLGE

ID: 17

Use value directly after instruction as
address to read from memory into register A

Syntax

LDLGE
HERE <Address>


STLGE

ID: 18

Use value directly after counter as
address to write from register A into memory

Syntax

STLGE
HERE <Address>


LDW

ID: 19

Load value directly after this into
register A

Syntax

LDW
HERE <Value>

This instruction resets the bank to 0.


Swap

IDs: 20    21

Swaps two registers with each other
& as a side-effect overwrites the third.

Syntax

SWP

A  ⟷  B   Overwrites C

SWP

SWPC

A  ⟷  C   Overwrites B

SWPC


PCR

ID: 22

Get the current program counter value
and put it into register A

Syntax

PCR


BSL

ID: 23

Bit shift left register A, the number
of bits to shift determined by the value
in register B

Syntax

LDIA 10
LDIB 2
BSL     , Shift value of 10 to the left by 2


BSR

ID: 24

Bit shift right register A, the number
of bits to shift determined by the value
in register B

Syntax

LDIA 10
LDIB 2
BSR     , Shift value of 10 to the right by 2


AND

ID: 25

Bitwise And operation on register A
and register B

Syntax

LDIA 15
LDIB 1
AND     , Bitwise And operation on 0b1111 and 0b0001


OR

ID: 26

Bitwise Or operation on register A
and register B

Syntax

LDIA 15
LDIB 1
OR     , Bitwise Or operation on 0b1111 and 0b0001


NOT

ID: 27

Bitwise Not operation on register A

Syntax

LDIA 15
NOT     , Bitwise Not operation on 0b1111


BNK

ID: 28

Change the memory bank register to the value specified

Syntax

BNK 1


VBUF

ID: 29

Copy the video buffer to video card - displays the editable video memory

Syntax

VBUF


BNKC

ID: 30

Change the memory bank register to the value
in register C

Syntax

LDIA 15  , Load 15 into A then swap it into C
SWPC
BNKC     , Sets the memory bank register to C, which is 15


LDWB

ID: 31

Load value directly after counter into
register B and advance program counter by 2

This instruction resets the bank to 0.

Syntax

LDWB
HERE <Value>