Macro cambridge_asm::inst

source ·
macro_rules! inst {
    ($(#[$outer:meta])* $vis:vis $name:ident ($ctx:ident, $op:ident) { $( $code:tt )* }) => { ... };
    ($(#[$outer:meta])* $vis:vis $name:ident ($ctx:ident) { $( $code:tt )* }) => { ... };
    ($(#[$outer:meta])* $vis:vis $name:ident { $( $code:tt )* }) => { ... };
}
Expand description

Macro to generate an instruction implementation

Examples

use cambridge_asm::inst;

// No Context
inst!(name1 { /* Do something that doesn't need context or op*/ });

// Context only
inst!(name3 (ctx) { /* Do something with ctx */ });

// Context and op
inst!(name5 (ctx, op) { /* Do something with ctx and op */ });

For further reference, look at the source of the module super::io