Commit Graph

5 Commits

Author SHA1 Message Date
Lephenixnoir c8b28b447f
masive improvements to memory use by compacting core objects
* Store CpuRegister on a single byte
* Store operation sizes (0, 1, 2, 4) on a single byte
* Share the (disp) and (imm) fields of instruction arguments
* Store instructions as char[12] instead of std::string (>32B)
* Store instruction args in Argument[2], not std::vector (>24B)

Size changes:
  CpuRegister:    4B ->  1B
  Argument:      24B ->  8B
  Instruction:  >64B -> 32B

This reduced the malloc size from 3.3M to 177k after a standard 40-line
disassembly (this excludes OS files mapped to memory), and improved the
loading time for the SH3 instruction table by about 30% (100 ms -> 65
ms).
2021-03-16 13:37:55 +01:00
Lephenixnoir 2e58a8850b
support non-decoded instructions
This finally makes it possible to disassemble any interval without
worrying about potential errors. That's some progress.

By the way, now we can fully disassemble fx@3.10. Takes about 6 seconds
for the analysis passes, and ~9 seconds for printing on my machine.
2020-02-29 16:32:25 +01:00
Lephenixnoir c1c1be2d2c
support for mova, and more responsible OS creation 2020-02-29 11:25:03 +01:00
Lephenixnoir c5a7071dcc better manage exceptions and instruction-level passes 2020-02-28 16:19:50 +01:00
Lephenixnoir d5c5fa6aeb
implement the syscall pass, and symbol resolution
New features:
* The syscall pass now resolves syscalls for the input target, provided
  that an OS is mapped on the ROM region.
* Formalized the variations of print's arguments as a sequence (tree, to
  be precise) of /promotions/.
* Added a short notion of Symbol and SymbolTable, and a loader for them.
  Data files of type "symbol" are read as such and provide name to
  syscalls or arbitrary addresses.

Code changes:
* The disassembly operation of the command-line interface is now finally
  in its own file with more room.
* Encoded the tree structure of promotions as a sequence of (mainly
  tail-calling) inter-calling methods in the print pass.
2020-02-15 18:42:14 +01:00