Mirror of Betrusted repo
Go to file
Sean Cross 70ad4b74db README: add initial readme
Signed-off-by: Sean Cross <sean@xobs.io>
2020-08-06 16:49:30 +08:00
src test: implement jump tests 2020-08-06 16:45:07 +08:00
Cargo.lock initial commit 2020-08-06 03:21:51 +08:00
Cargo.toml disassembler: implement disassembler 2020-08-06 14:03:39 +08:00
README.md README: add initial readme 2020-08-06 16:49:30 +08:00

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:

    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:

    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:

$ cargo +nightly test --features macro-debug
...