Commit Graph

47 Commits

Author SHA1 Message Date
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
046617f8dc add branch listener functionaliy
have to store the branches and loop again as labels
dont neccessarily have positions yet
2018-06-17 22:25:38 +03:00
Torsten Ruger
7543236f4f objects didn't get positions
positions.empty? was wrong check
2018-06-16 10:58:54 +03:00
Torsten Ruger
698c845297 seperate position create and register
many test fixes
2018-06-15 22:00:49 +03:00
Torsten Ruger
3cc9175efa start BranchListener
but on hold, since it needs positions before we have them
Must create them during collection phase
2018-06-14 21:29:34 +03:00
Torsten Ruger
e1683938ed fix label positioning bug
where a label at the end of a binary code resulted in the
label actually taking up a position, instead of sharing it with it's next
2018-06-10 13:18:56 +03:00
Torsten Ruger
0513cd504f update return address in label
so return jumps go to the right address
2018-06-10 09:15:57 +03:00
Torsten Ruger
c7ad1d98ca introduce the LabeListener to move instructions along when first code position changes 2018-06-09 22:13:43 +03:00
Torsten Ruger
ec1d38f5a6 reimplement instruction listeners with indexes
easier to understand, as indexes map to Binarycode indexes, and can thus later be used to assemble directoy into the  code
Almost no change in tests (now only multiples of 4 addresses allowed)
2018-06-09 17:41:39 +03:00
Torsten Ruger
cf94227b2c fix code init bug
where initial pos wasnt propagated
2018-06-09 09:16:23 +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
5815d32bde make the instructions jump over the BinaryCode end 2018-06-07 19:27:44 +03:00
Torsten Ruger
2d218bbc48 work on jump insertion continues
Now registering CodeListener instead of PositionListener
Also instead of on the previous, in itself, which is simpler
and allows to react to insertion at end
2018-06-07 19:26:02 +03:00
Torsten Ruger
7fa8397b56 insertion pushes, split position tests 2018-06-06 10:19:18 +03:00
Torsten Ruger
c22aff4c4f start on insertion events and handling 2018-06-06 10:00:07 +03:00
Torsten Ruger
4789b63fcb fix the gapping of instructions
so last binary stays empty and new starts at 8
2018-06-06 01:16:00 +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
f35ee6425a renaming and test fixing 2018-06-02 23:48:12 +03:00
Torsten Ruger
1d1c7105b4 introduce some helper methods 2018-06-02 23:02:59 +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
3bc35c2275 rework binary code positioning setup
dependency chain set up explicitly.
Next have to react to events correctly
2018-06-02 17:29:38 +03:00
Torsten Ruger
91c7903848 start simple with code listner 2018-06-02 16:34:44 +03:00
Torsten Ruger
aa6707337a positioning wip 2018-06-02 16:12:01 +03:00
Torsten Ruger
46fbfb7101 adds the simple object dependency
where the next object is dependent on the previous one
and just behind it, the padded_length away
2018-05-31 20:41:04 +03:00
Torsten Ruger
21a9c56ba9 change position event code to use util
general purpose event fireing
can then be used for several event types
2018-05-31 19:05:53 +03:00
Torsten Ruger
2544bc5a85 move position module to folder 2018-05-31 19:01:10 +03:00
Torsten Ruger
49849939a1 little event mechanism for changed positions 2018-05-31 17:01:23 +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
296617cbaf set label integer to position 2018-05-29 20:30:02 +03:00
Torsten Ruger
4b34546c11 fixing the binary code indexes
AGAIN, that third of all bugs, the off by one
2018-05-28 18:20:09 +03:00
Torsten Ruger
f9a89db10c use fake memory
fix integer offset bug
(which only didn’t cause errors as fixnums are still an order too big
and the famous +1 error hit the empty space)
2018-05-28 15:09:59 +03:00
Torsten Ruger
be1bc63ff2 jump was written off the end of binary code, fixed 2018-05-28 11:45:04 +03:00
Torsten Ruger
c0cd1e0740 fix an issue where instruction was in wrong code
embarrassingly used instance variable where it should have been local
2018-05-25 19:16:13 +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
ddd408e245 trying to fix the darn jump over object header 2018-05-25 19:03:46 +03:00
Torsten Ruger
8d510c2e7e getting instruction repositioning right
big bug hunt, involving complicated maths (%)
2018-05-24 14:27:53 +03:00
Torsten Ruger
8ca70a6835 Steamline objectPosition init
check for resetting on the same position with different class, which
should not happen
Ie it’s ok for an object to push another object up,
but not for an instruction to land on code
2018-05-23 21:34:49 +03:00
Torsten Ruger
ef2dc932ad use positions in interpreter 2018-05-20 15:52:13 +03:00
Torsten Ruger
4a88f342d3 random checkin
still suffering -1 trauma
2018-05-14 12:38:44 +03:00
Torsten Ruger
39902401b9 positioning code by setting first method code
codes will initial (and on reset) propagate the whole chain
2018-05-13 15:28:10 +03:00
Torsten Ruger
2d901bf7b6 not wrapping the cpu initial jump anymore
also introduce padding after cpu_init (wip)
2018-05-12 18:36:59 +03:00
Torsten Ruger
776a97986d fix instruction positioning
use at as at and only compute difference when needed (to determine if
there is a jump in binary)
Easier to understand that way
2018-05-11 18:36:45 +03:00
Torsten Ruger
bc1e29e4f6 seperate different Position classes into own files
also tests
and have Position module keep all positions
(singletons should be at module, not class level)
2018-05-10 20:56:12 +03:00