Browse Source

add 'print_opcodes' binary

pull/9/head
Murad Karammaev 2 years ago
parent
commit
8889bd84ac
Signed by: foxpy GPG Key ID: 78BE32418B0C8450
  1. 8
      Makefile
  2. 3
      toy_cpu_4bit/Cargo.toml
  3. 7
      toy_cpu_4bit/examples/print_opcodes.rs

8
Makefile

@ -15,3 +15,11 @@ unit-tests:
acceptance-tests: build
@acceptance-tests/main.py
# Examples
.PHONY: print_opcodes
print_opcodes:
@cargo run --example print_opcodes

3
toy_cpu_4bit/Cargo.toml

@ -7,3 +7,6 @@ edition = "2021"
ux = "0.1.3"
regex = "1.5.4"
lazy_static = "1.4.0"
[[example]]
name = "print_opcodes"

7
toy_cpu_4bit/examples/print_opcodes.rs

@ -0,0 +1,7 @@
use toy_cpu_4bit::instruction::decode;
fn main() {
for i in 0..=255 {
println!("{:#04X}\t{:#010b}\t{:?}", i, i, decode(i));
}
}
Loading…
Cancel
Save