High level assembly language

Syntax

<program> ::= <decl><body>
<decl> ::= VAR_SET (ENTER) ( (id) = (num) ) +
<body> ::= PROGRAM (ENTER) <labelled command>+
<labelled command> ::= (id): <command> | <command>
<command> ::= INC (id) | DEC (id) | MOV (id) (id) | BRANCH (id) (id) | INPUT (id) | OUTPUT (id) | ADD (id) (id) | ALLOC (id) (id) | STOREI (id) | LOADI (id) | STOP

* Strings after # symbols are regareded as comments
* An identifier (id) is a string starting from [a-zA-Z]
* (num) is a decimal number or a ternary number with 20 trits followed by t (Example: 00000000111111112222t).


Detail and Semantics

Overview

------------------------------
  Declaration of variables

  Declaration of program body
------------------------------
  • Declaration of variagles
  • Declaration of a body

  • Back