rubyx/lib/register
2016-02-25 12:03:11 -08:00
..
builtin move main to space 2015-11-30 16:09:12 +02:00
instructions fix register shortcuts 2015-11-21 14:17:54 +02:00
parfait fix docs for rename 2016-02-25 12:03:11 -08:00
assembler.rb fix docs for rename 2016-02-25 12:03:11 -08:00
boot.rb fix docs for rename 2016-02-25 12:03:11 -08:00
collector.rb rename layout to type 2016-02-25 11:50:10 -08:00
eventable.rb move interpreter to register 2015-11-18 12:00:30 +02:00
instruction.rb making parfait (both) use the new byte functions 2015-11-19 10:09:24 +02:00
interpreter.rb translate and interpret new instructions 2015-11-19 10:09:55 +02:00
machine.rb better error reporting for parser 2015-11-19 10:10:13 +02:00
minimizer.rb fold last of the virtual into register 2015-10-22 18:16:29 +03:00
padding.rb rename layout to type 2016-02-25 11:50:10 -08:00
parfait.rb rename layout to type 2016-02-25 11:50:10 -08:00
positioned.rb derive binary code form word 2015-11-14 15:04:04 +02:00
README.md rename phisol to soml 2015-10-23 14:22:55 +03:00
register_value.rb rename layout to type 2016-02-25 11:50:10 -08:00

Register Machine

The RegisterMachine, is an abstract machine with registers. Think of it as an arm machine with normal instruction names. It is not however an abstraction of existing hardware, but only of that subset that we need.

Our primary objective is to compile Soml to this level, so the register machine has:

  • object access instructions
  • object load
  • object oriented call semantics
  • extended (and extensible) branching
  • normal integer operators (but no sub word instructions)

All data is in objects.

The register machine is aware of Parfait objects, and specifically uses Message and Frame to express call semantics.

Calls and syscalls

The RegisterMachine only uses 1 fixed register, the currently worked on Message.

There is no stack, rather messages form a linked list, and preparing to call, the data is pre-filled into the next message. Calling then means moving the new message to the current one and jumping to the address of the method. Returning is the somewhat reverse process.

Syscalls are implemented by one Syscall instruction. The Register machine does not specify/limit the meaning or number of syscalls. This is implemented by the level below, eg the arm/interpreter.

Interpreter

There is an interpreter that can interpret compiled register machine programs. This is very handy for debugging (an nothing else).

Even more handy is the graphical interface for the interpreter, which is in it's own repository: salama-debugger.

Arm / Elf

There is also a (very strightforward) transformation to arm instructions. Together with the also quite minimal elf module, arm binaries can be produced.

These binaries have no external dependencies and in fact can not even call c at the moment (only syscalls :-)).