Commit Graph

118 Commits

Author SHA1 Message Date
Torsten Ruger
db55ec3fd6 slightly changing built return logic
very tempted to add immediately, but bigger change
2018-04-07 00:35:54 +03:00
Torsten Ruger
dd0d162ebf fix the init also, was using first message twice
not advancing after first load
2018-04-07 00:14:02 +03:00
Torsten Ruger
1ddbde1191 return single message for "message" ie r0
other names, like next_message allocate  a new register
2018-04-06 22:54:54 +03:00
Torsten Ruger
22409c93ee remove >>, consistent use of <<
makes code easier to read, like assignments
does remind of Passengers
2018-04-06 22:40:58 +03:00
Torsten Ruger
c042dd9faa allow reverse syntax for >> (ie <<)
slot >> reg makes sense, being a slot_to_reg
but . . .
consistently use of << (as meaning assignment , =) also makes sense
allow both and let time tell which makes more sense
2018-04-06 21:05:26 +03:00
Torsten Ruger
c02576b239 reuse dished out names
so they become like variables
2018-04-06 20:55:21 +03:00
Torsten Ruger
cae5e323ec add reg to slot 2018-04-06 20:21:14 +03:00
Torsten Ruger
88dbc7c84f slot to reg for builder 2018-04-06 16:35:27 +03:00
Torsten Ruger
c233bd82d6 implement [] for RiscValue for the dsl 2018-04-06 16:08:35 +03:00
Torsten Ruger
44d661fe56 progress on the builder front
mainly tests for now
2018-04-06 14:54:24 +03:00
Torsten Ruger
e396807ee5 start work on dsl
so i can read my own code
2018-04-06 14:21:38 +03:00
Torsten Ruger
f09086e524 unite the two resolve_to_index functions 2018-04-05 20:10:00 +03:00
Torsten Ruger
ec31bde33a fix use of messagesetup
which does setup for the method being called
not the one we’re in. duh
2018-04-05 12:23:43 +03:00
Torsten Ruger
5bb3ad03cc some more safety tests 2018-04-05 12:22:40 +03:00
Torsten Ruger
ee0a1ca823 renaming methods args and frame
to arguments_type and frame_type, because that is what they are
In honour of setup bug, where the types of those types were loaded,
instead of just them types
2018-04-05 12:22:14 +03:00
Torsten Ruger
4a2a1da3ff little spring clean 2018-04-03 15:23:19 +03:00
Torsten Ruger
52d389cdbf auto extend binary code
final solution will need repositioning
2018-04-03 15:07:36 +03:00
Torsten Ruger
17b52d4e80 fix dynamic resolution
was loading self, when it needs to load receiver
some more test (up to the resolve) start working
2018-04-03 12:55:28 +03:00
Torsten Ruger
c304ad67c6 load space twice in init , messagesetup overwrites first
lots of interpreter test changes, brittle, must factor __initi out
2018-04-02 23:25:52 +03:00
Torsten Ruger
576ae9261d recode resolve method as assembler
definitely needs some refactoring
in fact i was hoping to code this in ruby (with compiler tweeks)
but there it is: goes through the linked list of methods of the type
and compares their name with self (method on word)
if not found ends in sys exit for now
2018-04-02 19:32:59 +03:00
Torsten Ruger
beb487eb09 minor fixes 2018-04-02 19:31:08 +03:00
Torsten Ruger
65d57c8c7c removing unconditional
just Branch is fine
2018-04-02 19:30:34 +03:00
Torsten Ruger
9fafbe4e96 remove Kernel class for clarification
since it was a class it was fake anyway
moved methods to object
2018-04-02 17:06:31 +03:00
Torsten Ruger
87eee0b66e add object method missing as sys exit
functions get added twice and thus removed once
remove restriction for now
2018-04-02 16:49:30 +03:00
Torsten Ruger
fb29fb6431 linked list of methods instead of list of methods
api changes slightly, especially for each, but mostly sama sama
2018-04-02 16:36:43 +03:00
Torsten Ruger
9efeb58061 fix ret_to_byte
by the now familiar unwrapping of args and wrapping of return
2018-04-01 22:16:17 +03:00
Torsten Ruger
1a19683e7d fix RegToByte
seems to work, but does not end in syscall
2018-04-01 21:59:06 +03:00
Torsten Ruger
3a9539a071 adds multiplication
without overflow testing, like the others
2018-04-01 21:18:08 +03:00
Torsten Ruger
1d57c59dab fix putstring
mainly returning an integer object rather than fixnum
2018-04-01 18:57:43 +03:00
Torsten Ruger
b1376e83bd add integer minus
rework plus to make that easy
2018-04-01 15:26:53 +03:00
Torsten Ruger
972cf47c8b adding returns to all builtins 2018-04-01 15:17:16 +03:00
Torsten Ruger
def67205f0 fix mod4
which is just shift right by 2 after all
2018-04-01 15:13:12 +03:00
Torsten Ruger
10fa61aa9f fix integer plus
mostly forgot the return sequence
2018-04-01 14:56:01 +03:00
Torsten Ruger
8acfda457f fix div10
by reducing the incoming integer to fixnum
and then pushing the fixnum result into a new integer
2018-04-01 14:50:13 +03:00
Torsten Ruger
5a861d4ed5 move some compiler helpers to the compiler itself 2018-04-01 14:09:30 +03:00
Torsten Ruger
168c2e862f move wip tests 2018-04-01 14:01:17 +03:00
Torsten Ruger
4725b81270 get those integers crated and used 2018-03-31 20:21:27 +03:00
Torsten Ruger
5b92b6b785 get plus (+) working
alas, new integer is not created yet
2018-03-31 19:37:24 +03:00
Torsten Ruger
a2173645b3 remove the :int shorthand 2018-03-31 19:17:55 +03:00
Torsten Ruger
696886cc94 remove Data2 in favour of Data4
as we write a Marker, type and marker make up 2
so data2 is just the type, not useful
2018-03-31 19:12:06 +03:00
Torsten Ruger
a5189570c6 fix remaining constant issues
all but integer creation
and integer builtins off course
2018-03-31 13:58:08 +03:00
Torsten Ruger
cb9f6973d9 fix true false and nil constant
going from mom to parfait
basics in place, more ripples to fix
2018-03-31 13:47:02 +03:00
Torsten Ruger
9e9b5c7f37 move to parfait integers in risc layer
loading constants means loading parfait objects
objects have to me collected in machine
integer ok, string/true/false/nil next
2018-03-31 13:25:59 +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
e68b28d66d fix helper
and start on arg test
2018-03-30 18:05:38 +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
3844a738cd rename assembler to text_writer
as “assembly” really happens in the machine now
2018-03-29 18:17:19 +03:00
Torsten Ruger
e012f16d7f fix positioning and the assembly works 2018-03-29 18:03:21 +03:00
Torsten Ruger
34b16a2332 use a binary code for the first jump 2018-03-29 17:39:31 +03:00
Torsten Ruger
7cf253ad9c change assembler to write binary code objects
also all debug in hex
2018-03-29 12:16:27 +03:00