diff --git a/src/isa/macros.rs b/src/isa/macros.rs index 6aa7ee7..8ef12b1 100644 --- a/src/isa/macros.rs +++ b/src/isa/macros.rs @@ -145,6 +145,10 @@ macro_rules! aluasm_inner { $code.push($crate::instr!{ $op $arg [ $idx ] , $arglit }); $crate::aluasm_inner! { $code => $( $tt )* } }; + { $code:ident => $op:ident $arg:ident [ $idx:literal ] , $arglit:ident ; $($tt:tt)* } => { + $code.push($crate::instr!{ $op $arg [ $idx ] , $arglit }); + $crate::aluasm_inner! { $code => $( $tt )* } + }; { $code:ident => $op:ident . $flag:ident $arg:ident [ $idx:literal ], $arglit:expr ; $($tt:tt)* } => { $code.push($crate::instr!{ $op . $flag $arg [ $idx ], $arglit }); $crate::aluasm_inner! { $code => $( $tt )* } @@ -221,6 +225,9 @@ macro_rules! instr { $crate::_reg_idx16!($offset_idx), )) }; + (put s16[$idx:literal], $val:ident) => {{ + Instr::Bytes(BytesOp::Put(RegS::from($idx), Box::new(ByteStr::with(&$val)), false)) + }}; (put s16[$idx:literal], $val:literal) => {{ Instr::Bytes(BytesOp::Put(RegS::from($idx), Box::new(ByteStr::with(&$val)), false)) }};