Low-level assembly language for Malbolge20

Syntax

low_program ::= PROGRAM_START_TO label (ENTER) flags
flags ::= flag (ENTER) flags | units
flag ::= FLAG [n/m] FLAG_name; (ENTER)
units ::= unit (ENTER) units | routines
unit ::= UNIT {(ENTER) low_statements}
routines ::= routine (ENTER) routines | ε
routine ::= ROUTINE label {(ENTER) low_statements}
low_statements ::= low_statement(ENTER) low_statements | ε
low_statement ::= label:num |  ROT label |  REV ROT |  OPR label |  REV OPR |  SKIP label |  JMP label | REV JMP |  OUTPUT |  REV OUTPUT |  INPUT |  REV INPUT |  DUP |  IF FLAG_name (ENTER) BRANCH label |  NEXT FLAG_name 

# for comment line, i.e., all characters after # are ignored.


Sample Programs

jump_putK.mc

O_BRANCH20.mc


Detail and Semantics

Overview

------------------------------
  Declaration of ENTRY

  Declarations of FLAGs

  Declarations of UNITs

  Declarations of ROUTINEs
------------------------------
  • Declaration of ENTRY
  • Declaration of FLAGs
  • Declaration of a UNIT
  • Declaration of a ROUTINE
  • Fixed UNIT
  • BACK