about summary refs log tree commit diff stats
path: root/subx/apps
Commit message (Collapse)AuthorAgeFilesLines
* 4624Kartik Agaram2018-09-302-2/+2
| | | | | | | | Start requiring a '-o' flag to designate the output binary when translating. Things currently get funky if you pass in multiple inputs, but that's ok. This is the first step to supporting multiple input files for a single output binary.
* 4518Kartik Agaram2018-09-244-44/+117
|
* 4517Kartik Agaram2018-09-242-13/+13
|
* 4516Kartik K. Agaram2018-09-244-42/+64
| | | | | | | More calling convention tweaks. Use EBP to get consistently at parameters and locals. Always put the first function argument closest to EBP.
* 4514Kartik Agaram2018-09-242-3/+11
| | | | Get the calling convention right, per http://www.cs.virginia.edu/~evans/cs216/guides/x86.html
* 4513Kartik Agaram2018-09-242-8/+0
|
* 4511Kartik Agaram2018-09-231-0/+0
|
* 4510Kartik Agaram2018-09-232-4/+270
| | | | | Add the test harness to the crenshaw compiler. Though we aren't calling it yet. But that's because we aren't actually doing anything useful yet.
* 4509Kartik Agaram2018-09-231-19/+4
| | | | Back to the Crenshaw compiler. Start by using string literals.
* 4508Kartik Agaram2018-09-232-20/+184
| | | | Upgrade the test harness for the factorial "app" from ex11.
* 4506Kartik Agaram2018-09-232-0/+13
| | | | | | | | | | | | check_ints_equal now prints a newline after the failure message on failure. We still don't know how to print a final newline after all the tests have run, for the common case when all tests pass. Ideally I could just emit a few instructions to `run_tests`. But I'd also need to add a variable for the newline to the data segment. Or I need some literal syntax for newlines in strings. We don't have support for backslash-escapes yet.
* 4505Kartik Agaram2018-09-232-8/+27
| | | | | | | | | | | | Extract a helper from the factorial unit test: check_ints_equal. Start of a vocabulary for unit tests. I *could* also start thinking of supporting multi-file programs, but I'm going to resist the temptation for now. Copy helpers as necessary, and allow them to mutate and diverge for a while before we pummel them into a Procrustean "standard library". Extracting a body of shared code immediately starts to discourage innovation in the shared code.
* 4502 - support string literals directly in codeKartik Agaram2018-09-221-14/+2
| | | | | | | | | | Doesn't de-duplicate in the data segment, though. If you use the literal "foo" a hundred times in your code segment you're gonna spend a hundred times the space you need to. We can now simplify our test harness a bit in the factorial app, but we still have to put in commandline args to compare with manually. We only support length-prefixed strings, not null-terminated ones.
* 4591Kartik Agaram2018-09-221-19/+19
|
* 4587Kartik Agaram2018-09-221-21/+0
|
* 4586 - factorial checks commandline to run testsKartik Agaram2018-09-212-15/+85
| | | | | No automated tests for argv_equal because we need it to run automated tests. But maybe we should have them anyway.
* 4581Kartik Agaram2018-09-212-10/+10
| | | | | | | | | | | | Even more cuddling. We want to keep lines short where the opcode and operands are self-explanatory. If there are any implicit registers, etc., we'll continue to do the table layout. The first two columns look messy now; let's see how this goes. Maybe I'll give up on the tabular layout altogether, just string args with a single space.
* 4576Kartik Agaram2018-09-211-6/+6
|
* 4567 - support automated tests in SubXKartik Agaram2018-09-212-11/+75
| | | | | | | | | All it takes is to code-generate a simple function called 'run_tests' that calls all functions starting with 'test_' one by one. I've temporarily switched the factorial app to run as a test. But that's temporary, because all the code to print '.' vs 'F' needs to get extracted out into a helper.
* 4560Kartik Agaram2018-09-202-0/+3
|
* 4559Kartik Agaram2018-09-202-0/+16
|
* 4558Kartik Agaram2018-09-201-1/+1
|
* 4557Kartik Agaram2018-09-202-4/+17
|
* 4556Kartik Agaram2018-09-202-10/+58
|
* 4555Kartik Agaram2018-09-202-3/+2
|
* 4554Kartik Agaram2018-09-202-2/+2
|
* 4553Kartik Agaram2018-09-202-0/+55
| | | | Start of a new example program.
* 4548: start of a compiler for a new experimental low-level languageKartik Agaram2018-09-171-0/+21
|
* 4537Kartik Agaram2018-09-072-5/+3
| | | | | | | | | | | | | | | Streamline the factorial function; we don't need to save a stack variable into a register before operating on it. All instructions can take a stack variable directly. In the process we found two bugs: a) Opcode f7 was not implemented correctly. It was internally consistent but I'd never validated it against a natively running program. Turns out it encodes multiple instructions, not just 'not'. b) The way we look up imm32 operands was sometimes reading them before disp8/disp32 operands.
* 4533Kartik Agaram2018-09-011-0/+2
|
* 4531 - automatically compute segment addressesKartik Agaram2018-09-011-1/+1
|
* 4530 - create an apps/ directoryKartik Agaram2018-09-012-0/+64