summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Add licenceHEADmasterDavid Phillips2019-09-29
|
* Add new testsDavid Phillips2019-08-11
|
* Remove warning about non-ISO C featureDavid Phillips2019-08-11
|
* Don't ignore ret variables, remove memory leak on add_token failureDavid Phillips2019-08-11
|
* Fix and add tests for NULL deref cases found by scan-buildDavid Phillips2019-08-11
|
* Add test recipe which skips valgrindDavid Phillips2019-08-04
|
* Wrap tests in valgrind, clean up memory leaksDavid Phillips2019-08-04
|
* Remove `POST-` from emul test namesDavid Phillips2019-08-04
| | | | This is unnecessary, leaving it out leaves plenty enough information.
* lex: empty file is equivalent to EOLDavid Phillips2019-08-04
| | | | | | | | | lex() returning NULL is used to convey an error case but having not allocated any tokens in the case of an empty input file isn't an error case. This patch causes lex to treat an empty token stream after successfully examining a file as just a single EOL token. This is a fair approximation of an empty file for this assembler's purposes, and results in the correct behaviour of an empty output file.
* Add initial emulator implementationDavid Phillips2019-08-04
| | | | | | | This emulator provides a rough way for binaries designed for this CPU to be executed in a virtual/emulated CPU for testing purposes. This patch also adds a small test setup for automated assembly, execution and checking of register postconditions for programs.
* input_bin: Refactor disassembly to allow input from buffersDavid Phillips2019-08-03
| | | | | | | | | This somewhat complicates the previous file dissassembly logic, but paves the way for disassembling instructions from buffered memory. This will be required for emulation. Also adds some test cases which nabbed bugs during the development and testing of this change.
* File input and output routines awayDavid Phillips2019-08-03
|
* Add asmcat, bincatDavid Phillips2019-08-03
| | | | | | | | | These tools are currently fairly useless for real-world programming. Each of them takes in either asm or binary, translates this to the internal intermediate representation of a list of instruction structs, and then translates and outputs in the same format that they took it in. These are mostly oly useful for testing purposes, but may one day be useful if e.g. an optimiser stage is put in between the input and output stages.
* Enable -WpedanticDavid Phillips2019-08-03
| | | | I'm going to regret this
* Enable -Wall and -Wextra, fix warningsDavid Phillips2019-08-03
|
* Refactor disassembler to move data through instruction listDavid Phillips2019-08-03
| | | | | | | | This refactors the disassembler into two stages with the list of struct instruction (currently also output by the parse stage) as an "intermediate language" between disassembly and assembler output. This should make these units, especially the "machine code => IL" section, more reusable for future soft emulation work.
* Add simple loop disasm testDavid Phillips2019-08-03
|
* Make full test use unique-per-test file namesDavid Phillips2019-08-03
| | | | | This allows for inspection of test failures when the script is run with noclean and the failing test is not the last test in the run.
* Fix disasm treatment of branch offsetsDavid Phillips2019-08-03
| | | | | This patch makes the disassembler treat branch offsets as PC-relative rather than absolute.
* Rename .test files to .asmDavid Phillips2019-08-03
|
* Add some (failing) testsDavid Phillips2019-08-03
|
* Tidy test runner scriptDavid Phillips2019-08-03
| | | | | | | Makes no-clean mode optional, and non-default. By default, we probably want failed test runs not to leave things lying around, since most of test running for now will be for test development. Perhaps once tests are stable, we can switch back to no-clean by default to catch bugs.
* Add test for asm-disasm-asm, fix bug with labelsDavid Phillips2019-08-03
| | | | | | | | | | | | | | This adds a support script for future expansion of an asm->disasm->asm series of tests, which will at minimum ensure some parity between the assembler and disassembler. Lower level tests to ensure correct behaviour rather than just symmetrical behaviour belong in another set of tests. This patch also fixes the assembler's behaviour around numeric labels. Many other assemblers support entirely numeric labels, and the output of the disassembler includes them. The assembler has been adjusted to lex a probably-numeric as a label if it is at the start of the line. Otherwise, old label behavour and old numeric behaviour is left in place.
* Implement quick disassemblerDavid Phillips2019-08-03
|
* Misc tidy up of assembler sourcesDavid Phillips2019-08-03
|
* Add support for // /**/ style commentsDavid Phillips2019-08-03
|
* Fix bug lexing char valuesDavid Phillips2019-08-03
|
* More unused code removalDavid Phillips2019-08-03
|
* Remove superfluous printfs, factor reg table lookupDavid Phillips2019-08-03
|
* emit_error -> emit, factor keywords outDavid Phillips2019-08-03
|
* Small tidy up of headers, misc outputDavid Phillips2019-08-03
|
* Factor out various lookup tablesDavid Phillips2019-08-03
|
* Tidy assembler.cDavid Phillips2019-08-03
|
* Dirst dump of working prototypeDavid Phillips2019-08-03