Skip to content

User4574/subleq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

subleq assembler and emulator

An assembler and emulator for the subleq OISC from Wikipedia.

Why?

I got bored.

What does it do?

There are two programs included.

as

as is the subleq compiler. It will take an assembly file and assemble it into emu machine code.

Run it as ./as <input file> <output file>.

You can use any of instructions on Wikipedia, along with:

  • NOP: Do nothing
  • SUBLEQ: This instruction will be inserted into the output verbatim. If c is not given, it is assumed to be the next instruction.
  • HALT: Stop the machine
  • DATA: This can take up to three arguments, which will be inserted verbatim. Arguments not given will be assumed zero.

emu

emu is the subleq computer emulator.

Run it as ./emu <machine code file>

The file will be mutated to represent the state of memory after the execution.

Building

Compile everything with make, or make as and make emu. Clean up with make clean.

Bugs

not is not yet implemented, as I haven’t gotten around to converting it from subleq2 to subleq. PR accepted.

Future work

More Instructions! PR accepted!

About

Subleq assembler and emulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published