rubyx/lib/register
Torsten Ruger 6137833140 change args argument to create method to be hash
was array and didn’t carry types and names
2015-11-11 20:41:02 +02:00
..
builtin change args argument to create method to be hash 2015-11-11 20:41:02 +02:00
instructions add set_internal 2015-11-08 17:10:36 +02:00
assembler.rb test the log_level too 2015-11-05 14:05:12 +02:00
boot.rb change args argument to create method to be hash 2015-11-11 20:41:02 +02:00
collector.rb need to collect labels for return 2015-11-03 11:22:26 +02:00
instruction.rb function call now saves the return address before calling 2015-11-03 11:20:49 +02:00
machine.rb fixes yet another order dependant bug in the test (not the code) 2015-11-09 10:04:37 +02:00
minimizer.rb fold last of the virtual into register 2015-10-22 18:16:29 +03:00
padding.rb fix padding 2015-11-04 10:34:03 +02:00
parfait_adapter.rb string sometimes gets to_s in equal while half cooked 2015-11-10 19:16:38 +02:00
positioned.rb first stab at fixing the assembly 2015-11-03 16:24:12 +02:00
README.md rename phisol to soml 2015-10-23 14:22:55 +03:00
register_value.rb fix old warning 2015-11-10 11:48:53 +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 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 :-)).