From 70ad4b74dbd55102ceec1554aa57d2c74a1b537b Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Thu, 6 Aug 2020 16:49:30 +0800 Subject: [PATCH] README: add initial readme Signed-off-by: Sean Cross --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ad78105 --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# The Engine Assembler + +Provides an assembler-as-macro that lets you assemble The Engine bytecode +in your program. For example, to create an infinite loop, run: + +```rust + let mcode = engine25519_as::assemble_engine25519!( + start: + brz start, #0 + ); +``` + +## Disassembly + +You can use a basic disassembler provided by this crate. To disassemble a single opcode, run: + +```rust + let opcode = engine25519_as::disasm::Opcode::from_i32(0x14_7985); + println!("Opcode: {}", opcode); +``` + +## Debugging the Macro + +To debug the macro, use the `nightly` toolchain and enable the `macro-debug` feature. + +An easy way to do this is: + +```sh +$ cargo +nightly test --features macro-debug +... +```