GithubHelp home page GithubHelp logo

subleqxemu's Introduction

Emulator for Subleqx machine.

Subleqx is an extension of Subleq OISC machine, which allows arbitrary widths for pointers and data.

Instructions are encoded as sequence of bits and executed within linear block of memory.

In theory, binary format of Subleqx allows to address infinite amount of RAM, making this machine Turing-complete. However, for emulation on real hardware, amount of available RAM needs to be limited.

Subleqx project can be split into 4 parts:

  1. Binary format of instructions;
  2. Memory-mapped input and output;
  3. Assembly language (SubleqxAsm repository);
  4. Emulation (this repository).

Each Subleqx instruction consists of 6 parts:

  • Address width (aw);
  • Data width (dwm1w and dwm1);
  • Pointers A, B and C (pa, pb and pc).

For program to interact with user, three special addresses are defined:

  • Reading of address 1 halts execution (emulation stops);
  • Reading of address 2 reads UTF-32 character from console;
  • Writing to address 3 writes UTF-32 character to console.

Assembly language allows to define instructions and variables. Here is how "Hello, world!" program can be implemented with it:

loop:
  8, 3, 6, ptr: msg, 3, @n
  7, 3, 7, cm7, ptr, @n
  7, 3, 4, cm1, i, loop

  1, 1, 0, 1, 1, 0

i:   .d5 1 - 13
cm1: .d5 -1
cm7: .d8 -7
msg: .s7 "Hello, world!"

To run this program, these commands should be executed:

  • SubleqxAsm hello.sxa
  • SubleqxEmu hello.bin

Subleqx project is work in progress, I plan to improve it, however, binary format should remain most stable, with main changes focusing in assembly and emulation parts.

subleqxemu's People

Contributors

vort avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.