Commit Graph

2212 Commits

Author SHA1 Message Date
Michael Munday
e19544ae9a Implement unary minus. 2016-12-21 14:03:58 -05:00
Michael Munday
9da6ff7ea3 Implement more equality checks. 2016-12-21 13:21:12 -05:00
Michael Munday
8518df8e56 Implement some boolean operations. 2016-12-21 12:49:53 -05:00
Michael Munday
ae38a6913e Add support for numeric equality checks. 2016-12-21 11:02:53 -05:00
ketank-new
4853da820a Added test example for RXE mode 2016-12-21 18:43:25 +05:30
Michael Munday
b5aa0d077c Fix bug in division. 2016-12-20 17:26:33 -05:00
Michael Munday
eda56c9a44 Add support for if statements. 2016-12-20 17:10:38 -05:00
Michael Munday
90334d3be9 Add support for function definitions. 2016-12-20 15:49:21 -05:00
Michael Munday
e0e98f94d3 Add support for modulo (%) operations.
Only the slow path for now.
2016-12-20 14:54:26 -05:00
Michael Munday
419869b20e Fixes for DynASM.
* s/hle/nle/
 * Fix RRF-b encoding (didbr instruction)
2016-12-20 14:53:31 -05:00
Michael Munday
d006b07127 Add support for division. 2016-12-20 13:37:42 -05:00
Michael Munday
d94f4ac079 Add support for multiplication.
Multiplication instructions don't set the overflow flag so we need
to manually check, which is why this is more complicated than
addition.
2016-12-20 13:14:53 -05:00
Michael Munday
d256d99659 Add support for floating point add/sub. 2016-12-20 12:09:32 -05:00
Michael Munday
5df5e1f144 Add support for integer add/subtract.
Still need to support floating point operations. Multiplication is a
little more complicated because it doesn't set the overflow flag.
2016-12-20 09:41:19 -05:00
Michael Munday
5076a3ee2e Fix some DynASM instructions. 2016-12-20 09:27:40 -05:00
niravthakkar
28b6fe8759 Updated encoding for instructions
Have replaced the characters used for encoding with their respective addressing modes
2016-12-20 17:50:29 +05:30
Michael Munday
e467d784a9 Fix floating point fallback code for for loops.
Adds a dependency on clfi. Not sure how to work around (don't
really want to always introduce a temporary).
2016-12-19 16:03:21 -05:00
Michael Munday
299dc34db2 Add basic integer for loop support.
> for i=1,3 do print(i) end
1
2
3
2016-12-19 14:21:48 -05:00
Michael Munday
0d442ec688 Add some more instructions to DynASM. 2016-12-19 14:21:24 -05:00
Michael Munday
3330f6adc2 Fix KSHORT destination slot address. 2016-12-19 10:49:21 -05:00
Michael Munday
6a9855d988 Add support for print function call.
Hello world now works.

> print("hello world!")
hello world!
2016-12-17 19:56:56 -05:00
Michael Munday
bee112d431 Add support for global short assignments.
In other words 'a = 1' now works.
2016-12-16 17:23:46 -05:00
Michael Munday
24bdb7576d Add debug options to Makefile.
We're going to need these for a while, so better to put in the
repository. Once we're happy things are working we can disable
the debug info and enable optimizations again.
2016-12-15 11:03:13 -05:00
Michael Munday
2dcbf5be3e Implement more functions in the VM.
Also adds segmentation faults to stubbed out functions to make it
easier to work out what the control flow is.
2016-12-15 11:01:59 -05:00
ketank-new
b7c4e4b3d6 Added rre instruction format example
example includes instruction fidr
2016-12-15 13:51:46 +05:30
Michael Munday
ee4b942c94 Add vm_call handling code.
Now prints the prompt (!).
2016-12-14 22:22:49 -05:00
Michael Munday
f79a6f3f0b Add support for clm instruction. 2016-12-14 21:16:30 -05:00
Michael Munday
24f2ab48f5 Various fixes for vm_s390x.dasc. 2016-12-14 18:43:21 -05:00
Michael Munday
00d00e995f Fix extern handling in host vm builder. 2016-12-14 16:31:52 -05:00
Michael Munday
ef3ff100f2 Fix decoding of REL_EXT.
REL_EXT has an argument which wasn't being properly jumped,
resulting in an early STOP (because the argument is 0).
2016-12-14 16:27:38 -05:00
niravthakkar
49182c4d2e Added test for RRD and RRF-e
Also have modified the function which can handle 3 arguments now
2016-12-14 19:14:10 +05:30
niravthakkar
d63ff89c54 Added support for RRD addressing mode
We may not require RRD mode but, Added to check working of RRF-e.
2016-12-14 19:07:05 +05:30
niravthakkar
df7c3245e0 Minor Fix, correct the parameter used
Instead of params[2] , params[1] was used, corrected it.
2016-12-14 17:45:32 +05:30
niravthakkar
52368ac005 Minor cleanup 2016-12-14 14:47:15 +05:30
niravthakkar
ccd2614902 Added support for RIE-e, RSI, RXF, SI instructions 2016-12-14 14:18:07 +05:30
niravthakkar
f01f459573 Added support for RIL-c and RX-b instructions 2016-12-14 13:51:58 +05:30
niravthakkar
a8244c02ec Added support for RI-b and RI-c mode instructions 2016-12-14 13:41:55 +05:30
niravthakkar
4641b9a42d Added C support for I mode instructions 2016-12-14 13:30:49 +05:30
niravthakkar
cdb31062b7 Added the action part for I mode 2016-12-14 13:24:44 +05:30
niravthakkar
52ab0596da Added support for I mode instructions 2016-12-14 13:16:44 +05:30
niravthakkar
bc490013a3 Adding S mode instructions support 2016-12-14 13:08:32 +05:30
niravthakkar
45669fecef Added RRF-b mode support 2016-12-14 12:34:11 +05:30
niravthakkar
2f96ca3d91 Adding support for RXE mode instructions 2016-12-14 12:29:46 +05:30
niravthakkar
fc5874c951 Added RRF-e support 2016-12-14 12:22:08 +05:30
Michael Munday
7644f40b1a Add more interpreter code.
Compilation is currently broken, a label is missing.
2016-12-13 18:31:43 -05:00
Michael Munday
c83f4af9cc Add more RI-a (register-immediate) instructions. 2016-12-13 17:01:44 -05:00
Michael Munday
3ef1f21531 Add support for SIL instructions in DynASM. 2016-12-13 11:26:53 -05:00
Michael Munday
0b120ac64b Add partial implementation of vm_cpcall.
Currently works if the call returns 0. Haven't yet written the code
needed to handle the non-zero case.
2016-12-12 17:17:34 -05:00
Michael Munday
361a298371 Add lhi instruction and fix immediate parsing.
We were reading immediate values as hexadecimal values, really we
want the default to be decimal unless the immediate has a '0x' prefix.
2016-12-12 14:38:55 -05:00
niravthakkar
1c7a727f4a Correct the range of parameter, and merge the two case 2016-12-12 11:21:42 +05:30