Commit Graph

263 Commits

Author SHA1 Message Date
c16ed5ab3a fix interpreter
by currently not checking for old register pattern
feels like wip, but passes (all but one)
2020-03-22 14:31:43 +02:00
8832df3221 Add number of registers to platform 2020-02-26 19:01:01 +02:00
c43436f35a Change Mom to SlotMachine
rather large commit, but essentially a simple rename
Rationale in docs and blogs
2019-10-03 20:55:41 +03:00
7b9097a0b1 Fix word offset
which had weirdly been 1 off
(not weird that it was off, index bugs are common, but weird that the tests passed anyway)
2019-09-24 12:59:22 +03:00
0ae7c5d8aa hacking method not found
was using exit, since raise is not implemented. This was ambiguous as all programs exit.
Using :died as special kernel code and bending it, and reporting it in interpreter.
2019-09-09 11:47:37 +03:00
Torsten Ruger
8d3a1954fa close #21
Mostly replaced Fixnum with integer
also in the rx-file dependency
all travis and testing with 2.4+
2019-02-07 18:24:35 +02:00
Torsten Ruger
0a390cc5a9 shaves an instruction off resolve_method
by loading nil directly,  not space first
2018-09-01 11:20:59 +03:00
Torsten Ruger
c3b026a180 expand constant load
slightly hacky, but in good tradition
previous implementation only worked until 16 significant bits, which is getting to little
this one just keeps adding more instructions to arrive at the constant by force
There are surely cleverer ways of doing this, ie by using the barrel shifter
A start on #15, admittedly a hack
2018-08-31 23:28:31 +03:00
Torsten Ruger
a095515b0e new get_type_by_class_name helper for space
sorely needed, with 36 occurences replaced
2018-07-13 21:50:40 +03:00
Torsten Ruger
9005513368 rename typed_method to callable_method
seems to make the essence clearer
also extracted base class
2018-07-07 09:11:09 +03:00
Torsten Ruger
e099014d63 fix dunamic jump in interpreter and misc 2018-07-03 19:15:36 +03:00
Torsten Ruger
5f2a256608 fix platform derivation and some tests 2018-07-01 21:27:27 +03:00
Torsten Ruger
d50893bb0f rename risc_value to register_value
almost to register, but it still carries that value
2018-06-29 11:39:07 +03:00
Torsten Ruger
b804be5f70 fix dynamic call
which had the method in the regsiter, not the binary.
Single SlotToReg added (and some tests)
Which amazingly fixed all broken binary tests
2018-06-25 00:19:43 +03:00
Torsten Ruger
068bda492c implement DynamicJump for Arm
which is in fact the same as return (moving address into pc)
2018-06-24 19:13:55 +03:00
Torsten Ruger
ce79617875 fix the exit sequence
was returning wrong register (1, not 0)
also saving the message for test, which changes order as the return value destroys the message
2018-06-19 19:52:06 +03:00
Torsten Ruger
db459fcd3d fix label loading in arm
was still loading the integer address
instead of the return address's address
Hello World working
2018-06-19 17:35:00 +03:00
Torsten Ruger
956c2ebe54 make arm use branch_lsteners 2018-06-19 10:51:03 +03:00
Torsten Ruger
9fc7f9b528 fix arm write syscall 2018-06-19 10:49:53 +03:00
Torsten Ruger
3298651238 split create_binary into two phases
Which gives instructions a chance to check everything
and in Arms case check the constant loads/ instruction adding
So that during assembly no more change happens (and we don't have to reassemble)
2018-06-17 13:53:17 +03:00
Torsten Ruger
ad3040a846 add position_chaning to event interface
by reacting to the change _before it happens, we can move any BinaryCode out of the way

So when Instruction are inserted and code gets inserted, we don't need to set up the correct listener explicitly (which is tricky across mathods and changing chains), but instead just move anything that is in the way along
2018-06-09 08:10:41 +03:00
Torsten Ruger
c22aff4c4f start on insertion events and handling 2018-06-06 10:00:07 +03:00
Torsten Ruger
4ab6d62acf small arm fixes etc 2018-06-06 00:53:41 +03:00
Torsten Ruger
d7b3368b28 fix some pesty errors
need to fix instruction overlap beofre interpreter starts again
2018-06-05 19:05:12 +03:00
Torsten Ruger
8d953a619f propagate instruction positions
still overlapping onto binaries, but a start
2018-06-05 18:11:25 +03:00
Torsten Ruger
c2d450f779 fold position module and object position
simpler that way, aslo code is moving to listners
2018-06-02 21:59:41 +03:00
Torsten Ruger
24f6e30b54 start on redoing instruction positions
using insruction listeners (wip)
2018-06-02 21:20:15 +03:00
Torsten Ruger
0e155315aa movs is not allowed into pc
Illegal instruction it says
Otherwise the status update is nice (for branches) and we’ll keep
2018-05-31 14:03:25 +03:00
Torsten Ruger
67100a3ef8 write adjusted address
and rename integer to address in label
1k hurray
2018-05-31 00:07:58 +03:00
Torsten Ruger
0dc89c772a get the label int to work consistently
still need to use it in the return
2018-05-30 10:54:18 +03:00
Torsten Ruger
074ec34659 wip, fixed some label, need more fixing 2018-05-30 10:29:38 +03:00
Torsten Ruger
8322fca7b3 give labels an integer that will end up being the position at runtime
Since integers are first class objects, we need to use an integer object
as the return address. The actual address can not be stored in an
instance variable since it is not an object.
The address is unique to the label and never changes after positioning
(using the int is next up)
2018-05-29 20:26:00 +03:00
Torsten Ruger
b81d9565de fix binary code offset when calling
in other words, remember the arm pipeline being 8
2018-05-29 17:03:20 +03:00
Torsten Ruger
6f0fad0957 dragging the extra through resets
as the binary the instruction is in may change when repositioning
2018-05-25 19:04:48 +03:00
Torsten Ruger
3c00239f36 another million index fixes 2018-05-14 15:17:04 +03:00
Torsten Ruger
232fe67c09 introduce platform to abstract cpu and load address 2018-05-12 18:32:10 +03:00
Torsten Ruger
6a1528e75a Fix instruction resetting
which happens on insert of a new instruction
2018-05-08 20:53:48 +03:00
Torsten Ruger
7ca7e92dda remove link exception class 2018-05-08 20:22:04 +03:00
Torsten Ruger
ce3cc72f9e move all position setting into position
Position and subclasses handle the logic, external to
the classes, so it can be swapped out later
(at runtime positions can’t change)
2018-05-07 22:30:43 +03:00
Torsten Ruger
68fb9b1bdc rename Position get/set 2018-05-06 20:04:02 +03:00
Torsten Ruger
e89c4d1ce1 pass binary that arm instruction belongs to in
at least to first. repositioning and stuff next
2018-05-06 19:56:36 +03:00
Torsten Ruger
6b7e1e3932 remove link exception raise
need to fix move logic next
2018-05-05 23:55:50 +03:00
Torsten Ruger
d65a982454 start by moving positioned(module) to position(class) 2018-05-05 19:47:18 +03:00
Torsten Ruger
43d5521cfc debugging positions 2018-05-05 19:32:01 +03:00
Torsten Ruger
1acd231a33 debugging binaries, initial jump issues 2018-04-30 13:28:55 +03:00
Torsten Ruger
30ca70e042 remove extra instruction and use next instead
was messing with binary writing as the assumption of 1 word writes is
baked in
2018-04-03 14:46:07 +03:00
Torsten Ruger
beb487eb09 minor fixes 2018-04-02 19:31:08 +03:00
Torsten Ruger
a2173645b3 remove the :int shorthand 2018-03-31 19:17:55 +03:00
Torsten Ruger
6e941ebcb7 introduce load_data instruction
which just loads data to a register (used internally)
as opposed to integers, which are objects
2018-03-31 12:38:30 +03:00
Torsten Ruger
1956f18faa add an integer plus
not correctly handling integer objects yet
2018-03-30 17:09:02 +03:00