8ial

From Esolang
Jump to navigation Jump to search

8ial (or 8 instruction assembly language) is basically self explanatory. It's an 8 instruction assembly language created by User:Ractangle.

Commands

Command Action
EVR Edit the Value of the currently pointing Registry
PSH PuSH a registry
;A creates label A
OUT OUTput the top of the stack
PTR Point To Registry
PUT inPUT into registry
JIR Jump to a label If Registry is equal to a number
!A comments A

To halt a program. you need to reach the EOF.

Syntax

An Extended Backus-Naur Form (ENBF) formulation of the syntax shall be adduced:

program         := { innerLine } , [ finalLine ] ;
innerLine       := [ command ] , [ comment ] , newlines ;
finalLine       := [ command ] , [ comment ] ;
comment         := "!" , { character - newline } ;
command         := evrCommand | jirCommand | labelDefinition | outCommand | ptrCommand | pshCommand | putCommand ;
evrCommand      := "EVR" , numericOperand ;
jirCommand      := "JIR" , labelName , registry , numericOperand ;
labelDefinition := ";" , labelName ;
outCommand      := "OUT" ;
ptrCommand      := "PTR" , registryName ;
pshCommand      := "PSH" , registryName ;
putCommand      := "PUT" , registryName ;
labelName       := labelCharacter , { labelCharacter } ;
labelCharacter  := digit | letter | "-" | "_" ;
numericOperand  := signedInteger | registryName ;
registryName    := "$" , unsignedInteger ;
signedInteger   := [ "+" | "-" ] , unsignedInteger ;
unsignedInteger := digit , { digit } ;
digit           := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
letter          := "a" | ... | "z" | "A" | ... | "Z" ;
newlines        := newline , { newline } ;
newline         := "\n" ;
space           := " " | "\t" ;

Examples

Truth-machine

PUT $1
JIR o $1 1
PSH $1
OUT
JIR e $1 0
;o
PSH $1
OUT
JIR o $1 1
;e

Try it in the online Common Lisp interpriter

Cat program

A perpetual numeric cat program shall be produced below:

;repeat
PUT $1
PSH $1
OUT
JIR repeat $1 0

Try it in the online Common Lisp interpreter

Interpreter

  • Common Lisp implementation of the 8ial programming language.