23c98ecd47
nop now doesn't have any arguments if only 1 nop exists.
...
Renamed and added some data / functions.
2021-04-27 17:48:06 +01:00
e2761ac842
Removed old line and renamed line2 to line.
2021-04-27 16:43:12 +01:00
f7c8572dd9
Added line2 for parsing.
2021-04-27 16:40:59 +01:00
53963b5a7e
Switched to a 120 max width.
2021-04-26 18:07:33 +01:00
443c6f6c38
Fixed jalr not supporting parsing single argument.
...
Fixed `[ls]wc{n}` not supporting non-offset register arguments.
Fixed `li` prefering unsigned values.
`pseudo::{load, store}` now use their unique mnemonics to avoid collision with basic instructions.
`ParseCtx:arg_pos` now supports label offsets.
Added `Inst::write` to write instructions.
Added `Pos + i64` impl.
Brought back and fixed `dcb-compiler`.
Fixed current function labels not having a leading `.`.
2021-04-26 17:58:05 +01:00
be3a9d6ec0
main Inst, pseudo::Inst and Directive are now Parsable.
2021-04-26 16:32:19 +01:00
9b79f3b5c9
Added lifetime to Parsable trait.
2021-04-26 16:05:07 +01:00
f54325bafe
Removed InstFmt, InstTargetFmt and InstTarget.
2021-04-26 15:39:27 +01:00
8d027e580f
dcb-decompiler now uses the new instruction display trait.
...
`DisplayCtx` now supports custom label types.
`Directive::Dw` now returns a target instead of literal.
Main `Inst` now implements `InstDisplay`.
2021-04-26 15:25:41 +01:00
c066f3f2f8
Implemented InstDisplay for pseudo instructions and directives.
...
Added a lifetime and string variant for `InstFmtArg`.
Added a lifetime to `InstDisplay`.
Added `InstFmtArg::write` to write an argument.
2021-04-26 14:55:46 +01:00
d0bd0d22b3
Added InstDisplay for better instruction formatting.
2021-04-26 14:24:43 +01:00
3c7bed14e6
Store instructions now don't print a register offset if the offset is 0.
2021-04-26 12:24:42 +01:00
8c24f616e2
Renamed Encodable to Encode and Decodable to Decode.
...
Added `TryEncode` for fallible encodings.
2021-04-26 12:21:00 +01:00
2ebc4eca28
Removed Decodable::Raw now that they're all u32.
2021-04-26 12:09:51 +01:00
049ba7665e
Moved Parsable, ParseError and ParseCtx to parse.
2021-04-26 12:07:16 +01:00
88cb7ed679
Moved line parsing into it's own module and renamed it's types to be preprended with Line.
2021-04-26 11:53:26 +01:00
17dfe03800
Added basic::Parsable for parsable basic instructions.
2021-04-26 11:45:22 +01:00
2e44a3e382
clippy::map_err_ignore is now allowed.
2021-04-25 09:46:24 +01:00
1cc35f830d
Temporarily removed dcb-compiler while parsing is re-done.
...
Renamed some types in `inst::parse`.
2021-04-25 09:33:50 +01:00
bb7e0d40af
Removed all Raw from inst::basic. Instructions are now decoded directly by their raw form.
...
`slti` and `sltiu` cannot be shortened anymore.
2021-04-25 09:24:17 +01:00
e6f09fa31c
Started work on documenting all instructions.
2021-04-25 07:20:47 +01:00
47454a636d
Added ModifiesReg for basic instructions.
2021-04-25 06:59:42 +01:00
4076e2a18b
Added clippy::if_not_else to allowed lints.
2021-04-22 20:08:58 +01:00
6fbf3da552
Added Inst::from_parsed to compile instructions.
...
`Inst::decode` now doesn't make pseudo instructions if there's a label in the middle of it.
2021-04-22 15:23:57 +01:00
521d85b355
Fixed issue with encoding some basic instructions
2021-04-22 15:23:31 +01:00
9270461f33
FuncTable::search_instructions now doesn't consider functions that are not word aligned.
2021-04-22 15:21:48 +01:00
23b7a4f6fb
Fixed issue with converting load_imm, pseudo::load and pseudo::store addresses.
2021-04-22 14:12:08 +01:00
491831e867
FuncTable::search_instructions now accepts the known func table to avoid collisions with it too.
2021-04-21 22:27:54 +01:00
3985d3706e
Fixed bc{n}(t|f) and (l|s)wc{n} instructions not displaying their offset in signed hex.
2021-04-21 22:20:24 +01:00
7d14942f26
Fixed issue where heuristically found functions would overlap.
2021-04-21 21:41:39 +01:00
106a472c52
Added min_type_alias_impl_trait feature for previous commit.
2021-04-21 14:25:21 +01:00
48c21f5e88
Added pseudo::Encodable.
2021-04-21 14:21:05 +01:00
9a580f4345
Renamed some of load / store instruction operands to be more clear.
...
Fixed bug where pseudo::store instructions always output `$at` register instead of the proper register.
2021-04-21 12:56:50 +01:00
357d2f172d
Directive::write now properly null terminates strings.
2021-04-21 11:43:54 +01:00
669cf1a049
Implemented Bytes::to_bytes for Header.
2021-04-20 02:59:41 +01:00
df6c03e291
Added Directive::write.
2021-04-20 02:59:13 +01:00
d6dec17d91
Pos's add and sub operators now use wrapping by default.
2021-04-20 02:43:37 +01:00
3cecba468c
Added ParsedLabel to parse module in dcb_exe::inst.
...
`dcb-compiler` now collects all labels and instructions before beginning to iterate.
2021-04-20 00:33:04 +01:00
40545a4aab
Ran rustfmt on inst.
2021-04-19 23:10:05 +01:00
ba799baf85
Removed usages of removed Option::expect_none api.
...
Added more sanity checks to `btree_set_modify`.
2021-04-19 23:06:40 +01:00
2b9cf4a790
Added instruction parsing to dcb-exe.
...
Fixed bug in `dcb-compiler` where `-o` didn't actually take a value.
2021-04-19 22:49:32 +01:00
de556f37da
Added an allow of clippy::single_match_else.
2021-04-19 22:48:06 +01:00
e690763fc3
Fixed emission of extra '$' with arguments in co-processor instructions.
2021-04-19 21:50:23 +01:00
76a76439b7
Fixed major bug in range_disjoint.
...
Added some more data and functions.
2021-04-19 03:12:52 +01:00
6c2de4fd80
Renamed function table's comments to inline comments and added block comments.
...
Found some of C's standard library functions.
Added random functions found.
`dcb-decompiler` will now properly align inline comments.
2021-04-18 23:12:32 +01:00
558e4cbfb1
Fixed all extra lines in // Import sections.
2021-04-16 05:27:18 +01:00
991fa6ecce
Fixed all documentation errors.
...
Renamed some errors to their function's name.
2021-04-10 05:41:58 +01:00
64aacedaf6
Moved inst::DecodeError to inst::error.
2021-04-10 05:17:58 +01:00
e2ba82e8af
Revert "Added checksum checking for the executable bytes."
...
This reverts commit b0053bfb1c .
2021-04-06 19:23:14 +01:00
dd6fbba431
Renamed dcb_exe::Exe to ExeReader.
2021-04-06 19:20:19 +01:00