rubyx/lib/register
Torsten Ruger 5f7ea08a43 Splitting NameExpression into three, Known,Local,Argument
The decision which to use can be made higher up, in ruby, and so it
should.
2017-01-16 09:33:49 +02:00
..
builtin Splitting NameExpression into three, Known,Local,Argument 2017-01-16 09:33:49 +02:00
instructions rename to to array function to to_arr 2017-01-04 21:32:09 +02:00
assembler.rb fix all positioned uses as helper (not included anymore) 2017-01-01 21:52:55 +02:00
boot.rb minor fixes 2017-01-15 14:44:11 +02:00
collector.rb remove collecting from the machine 2016-12-31 19:54:18 +02:00
eventable.rb move interpreter to register 2015-11-18 12:00:30 +02:00
instruction.rb renames Typed to Vm 2017-01-14 19:28:44 +02:00
interpreter.rb same renames for bytes (set/get_byte) 2016-12-25 18:11:58 +02:00
machine.rb unlinking the objects collection from the machine 2016-12-31 18:46:17 +02:00
padding.rb stop including padding 2016-12-31 20:08:33 +02:00
positioned.rb make positioned a helper module 2017-01-01 21:52:00 +02:00
README.md remove references to soml 2016-12-11 12:55:03 +02:00
register_value.rb Move the space instance to the parfait module 2016-12-30 14:10:49 +02: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 typed code 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 :-)).