Commit Graph

5853 Commits

Author SHA1 Message Date
Kartik Agaram cc227e67d7 5853 2020-01-01 17:05:15 -08:00
Kartik Agaram 2a4088119c 5852 2020-01-01 17:04:37 -08:00
Kartik Agaram 23fd294d85 5851
Rename a few scripts to be more consistent.

I'm also starting to feel the urge to bud off `subx run` into its own program,
say tools/emulate_x86. It doesn't really rely on the SubX notation at all.

And then I could rename `subx translate` to `translate_subx_bootstrap`.

Only problem: the commands in the Readme get verbose. But the Readme is
gonna need surgery soon anyway to put translate_mu front and center.
2020-01-01 16:45:30 -08:00
Kartik Agaram 7ca19e4e1d 5850 - driver script for translating Mu programs 2020-01-01 16:35:02 -08:00
Kartik Agaram dafef4e30f 5849 - more integration testing of function calls
I can now run this program:

  fn main -> result/ebx: int {
    result <- do-add 3 4
  }

  fn do-add a: int, b: int -> result/ebx: int {
    result <- copy a
    result <- add b
  }

We still can't define local variables, but can write any programs involving
ints by passing in enough arguments for temporaries.
2020-01-01 15:55:12 -08:00
Kartik Agaram 6126361821 5848 2020-01-01 14:51:07 -08:00
Kartik Agaram a9baaac00b 5847 - literal inputs 2019-12-31 21:58:52 -08:00
Kartik Agaram f1344589da 5846 2019-12-30 01:34:39 -08:00
Kartik Agaram dcb20a225f 5845 2019-12-30 01:33:34 -08:00
Kartik Agaram 46c947224f 5844
Let's start putting r32 first in compare instructions that need it. Ordering
there is quite subtle and of great import.
2019-12-30 01:21:00 -08:00
Kartik Agaram d6f886a51f 5843 2019-12-29 13:40:22 -08:00
Kartik Agaram cd11144f52 5842
Extremely crappy syntax highlighting for Emacs. I just can't wrap my head
around elisp, and I'm inclined to blame elisp. Checking this off my todo
list and moving on.
2019-12-29 01:32:46 -08:00
Kartik Agaram b6e3ce576f 5841 - rudimentary syntax highlighting for gedit 2019-12-28 20:02:45 -08:00
Kartik Agaram ecd1a406e6 5840 - syntax highlighting for nano (!!) 2019-12-28 19:16:24 -08:00
Kartik Agaram dc6bd625f2 5839 - colors for comments and string literals 2019-12-28 18:40:44 -08:00
Kartik Agaram bc81e77197 5838 - syntax highlighting for atom 2019-12-28 17:34:38 -08:00
Kartik Agaram 535755316b 5837 - better colors for trace browser 2019-12-28 14:06:25 -08:00
Kartik Agaram ad6ae009ad 5836 2019-12-28 01:07:12 -08:00
Kartik Agaram 03a1de4536 5835 2019-12-28 00:02:29 -08:00
Kartik Agaram 2b665cc552 5834
Bugfix.
2019-12-27 23:59:07 -08:00
Kartik Agaram 1d70540ab3 5833 2019-12-27 23:42:35 -08:00
Kartik Agaram 8961f4f0aa 5832 - support for function outputs
We haven't implemented it yet, but there's now a design for how we check
whether a function has written its output correctly. Functions must write
to each output at the top level at least once, and never overwrite an output
register in the top-level once it's been defined.

This is conservative (it can be perfectly reasonable for functions to write
the output, reuse the register for a temporary, and then write the output
again) but easy to check.
2019-12-27 22:38:06 -08:00
Kartik Agaram 80e0188214 5831 2019-12-27 20:00:30 -08:00
Kartik Agaram 8e8a38ea81 5830
Bugfix: statements defining a new register variable require an initializer
instruction.
2019-12-26 02:43:14 -08:00
Kartik Agaram 1d7d6e2ee7 5829 2019-12-26 02:43:05 -08:00
Kartik Agaram bf03b1d9fa 5828 - copy (mov) instructions 2019-12-26 02:21:55 -08:00
Kartik Agaram 1210b77362 5827 - give primitives one more bit of metadata
Copy (mov) instructions are unlike instructions we've encoded so far, in
that their destination is not read.
2019-12-26 02:07:48 -08:00
Kartik Agaram eeac6cfddb 5826 - done with basic binary ops 2019-12-26 01:51:29 -08:00
Kartik Agaram 5573979f20 5825 - code-generation for add opcodes 2019-12-26 01:28:47 -08:00
Kartik Agaram c74e5009e0 5824 - code-generation for all inc/dec opcodes 2019-12-26 00:16:36 -08:00
Kartik Agaram 4ca4e94dce 5823 2019-12-22 23:43:45 -08:00
Kartik Agaram 47a15082c6 5822 2019-12-22 23:39:00 -08:00
Kartik Agaram ce27f90f05 5821 - now translating function arguments
See test-convert-function-with-arg-and-body.
2019-12-22 23:20:44 -08:00
Kartik Agaram 40dbfe20d1 5820
One test failing. It took enough debugging just to get to the expected
failure that it seems worth saving this snapshot.

Saw some signs that I have to remember to zero-out allocated memory. We
need a scalable solution for this.

I think parse-var-with-type needs to be rewritten. Just added a test and
a hacky fix for now.
2019-12-22 08:20:20 -08:00
Kartik Agaram c69f33143c 5819
Minor tweaks to stop wasting horizontal space in the trace.
2019-12-22 07:48:53 -08:00
Kartik Agaram c357b103d1 5818 2019-12-22 07:41:52 -08:00
Kartik Agaram 075e89d9a0 5817 2019-12-22 07:30:49 -08:00
Kartik Agaram 80612d80d2 5816 - browse_trace bug fixed 2019-12-21 22:53:23 -08:00
Kartik Agaram f97e9d9be8 5815 2019-12-21 22:42:08 -08:00
Kartik Agaram 657bff9847 5814 2019-12-21 22:42:08 -08:00
Kartik Agaram 7d02b3a73c 5813 2019-12-21 22:42:08 -08:00
Kartik Agaram c9c6ab35a6 5812 - debugging an ancient niggle in browse_trace
The problem: when I hit 'G' to go to the bottom of the trace, if the bottom
is visible on screen, the screen scrolls so the bottom of the trace
is the bottom-most line on screen. But the cursor moves to where the trace
used to end rather than the new location of the bottom of the trace (the
bottom of the screen).
2019-12-21 22:40:24 -08:00
Kartik Agaram e1dd3f9578 5811 2019-12-21 13:17:51 -08:00
Kartik Agaram cea97b7b22 5810 2019-12-09 16:54:34 -08:00
Kartik Agaram ef21004a5c 5809 2019-12-09 16:53:57 -08:00
Kartik Agaram af14739222 5808 2019-12-09 16:45:40 -08:00
Kartik Agaram 91624dbaca 5807 2019-12-09 01:32:48 -08:00
Kartik Agaram 8aeb85f04e 5806 2019-12-09 01:26:58 -08:00
Kartik Agaram 2249e605c1 5805 2019-12-08 23:31:05 -08:00
Kartik Agaram 2a2a5b1e43 5804
Try to make the comments consistent with the type system we'll eventually
have.
2019-12-08 23:31:05 -08:00