Commit Graph

46 Commits

Author SHA1 Message Date
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
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
67100a3ef8 write adjusted address
and rename integer to address in label
1k hurray
2018-05-31 00:07:58 +03:00
Torsten Ruger
e39e96f646 create return address as own class to hold return addresses
to distinguish from integer, which does not need adjusting
2018-05-30 23:49:01 +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
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
183d4152d5 loading label must translate the labels too
(psst: like arm translator already did. duh)
2018-05-24 19:20:06 +03:00
Torsten Ruger
a350325b6b fix function call and simple call logic
Before creating DynamicJump, the FunctionCall got a register for a
possible jump address. Now that is handled by DynamicJump and
FunctionCall just needs the method, from which it determines the
binaryCode address
2018-05-19 12:21:20 +03:00
Torsten Ruger
e237bc625a remove unused methods
and a whole lot more index fixes
2018-05-14 20:50:52 +03:00
Torsten Ruger
3c00239f36 another million index fixes 2018-05-14 15:17:04 +03:00
Torsten Ruger
4a88f342d3 random checkin
still suffering -1 trauma
2018-05-14 12:38:44 +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
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
9e21719aeb generalise the operator handling
ie passing them through
implementing more
2018-04-19 22:13:52 +03:00
Torsten Ruger
f09086e524 unite the two resolve_to_index functions 2018-04-05 20:10:00 +03:00
Torsten Ruger
5bb3ad03cc some more safety tests 2018-04-05 12:22:40 +03:00
Torsten Ruger
65d57c8c7c removing unconditional
just Branch is fine
2018-04-02 19:30:34 +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
Torsten Ruger
4253d7a6b9 move assembly from assembler to machine
id now called position
2018-03-27 18:47:39 +03:00
Torsten Ruger
4cc1d8455e fix util namespace
and instruction move ripples
2018-03-26 20:05:30 +03:00
Torsten Ruger
e61ef93943 cleanup 2018-03-26 19:17:30 +03:00
Torsten Ruger
b24b65520d remove all that label stuff
left over after rewrite from blocks to linked list
2018-03-26 14:54:41 +03:00
Torsten Ruger
231025389a little cleanup
code climate inspired
2018-03-26 14:15:48 +03:00
Torsten Ruger
279fdcc1e2 really translate risc - cpu/arm
also labels.
Actual translation/assembly is much cleaner
2018-03-25 19:38:59 +03:00
Torsten Ruger
de7e02b0b8 remove IsSame branch from risc
mixing up levels, IsSame is Mom
at risc this is a minus and Zero check
fix all tests
2018-03-24 18:54:36 +02:00
Torsten Ruger
6a538624c5 remove NotSame from risc
instead use a - b and then  isZero
2018-03-24 17:54:15 +02:00
Torsten Ruger
793fa313a5 change operators to symbols 2018-03-24 17:53:27 +02:00
Torsten Ruger
9932d0bf33 add source to the to_s 2018-03-22 18:38:19 +02:00
Torsten Ruger
ca3bf6acfa fix constants being passed down 2018-03-22 02:38:06 +05:30
Torsten Ruger
b5ef929c9c add method to risc function call
just so we still know at compile time
2018-03-21 19:05:53 +05:30
Torsten Ruger
fcbdba4804 simplify method entry exit codes
Basically just a label now
No more implicit returns (needs compiler tests)
Many return points is the new idea
Also setup is done before the enter by MessageSetup
2018-03-21 16:02:46 +05:30
Torsten Ruger
61a801b00c Return to_risc
remove the index from FunctionReturn, just jump to the register address
2018-03-21 15:48:50 +05:30
Torsten Ruger
b4489b1093 rename RiscTransfer to Transfer 2018-03-21 15:48:04 +05:30
Torsten Ruger
fa797f722d to_risc for NotSameCheck
which is only used in call cache checking
some fixing, needed to add a abel for the cache check jump
2018-03-21 12:38:28 +05:30
Torsten Ruger
d98e55907e first go at translating DynamicCall to risc 2018-03-21 11:51:10 +05:30
Torsten Ruger
77084dc894 fix unconditional jump
and affected tests
2018-03-20 22:05:09 +05:30
Torsten Ruger
c8980595a3 start to test if
truth check is only half done
2018-03-19 21:20:11 +05:30
Torsten Ruger
cddc25a595 fixing tests for shifting constants into slots 2018-03-17 21:15:38 +05:30
Torsten Ruger
79b4b07ac4 style 2018-03-14 17:39:49 +05:30
Torsten Ruger
aa79e41d1c rename register to risc
seems to fit the layer much better as we really have a very reduced
instruction set
2017-01-19 09:02:29 +02:00