~jleightcap/urm_z80

compile unlimited register machine description to Z80 assembly

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~jleightcap/urm_z80
read/write
git@git.sr.ht:~jleightcap/urm_z80

You can also use your local clone with git send-email.

#Unlimited Register Machine Compiler

Compile description of URM to Z80 assembly.

Written in POSIX AWK.

#Syntax

a program consists of a set of initializations followed by a list of instructions

1=3
4=1
2=123
S(1)
T(4,2)
Z(3)
J(1,4,2)

#Grammar

<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

<nat> ::= <digit>
        | <nat> <digit>

<assign> ::= <nat>=<nat>

<init> ::= <assign>
         | <init> <assign>

<instruction> ::= Z(<nat>)
                | S(<nat>)
                | T(<nat>, <nat>)
                | J(<nat>, <nat>, <nat>)

<instructions> ::= <instruction>
                 | <instructions> <instruction>

<program> ::= <init> <instructions>

#Example Input Programs

See add.urm

1=3
2=5
J(3,2,5)
S(1)
S(3)
J(1,1,1)

#Testing

Assembled Z80 machine code is testable with jemu