forked from MightyPork/crsn
Convert builtin ops into a pseudo-extension
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
use crsn::asm::data::{Rd, Wr};
|
||||
use crsn::asm::error::{Error};
|
||||
use crsn::asm::error::Error;
|
||||
use crsn::asm::instr::op::{AsmModule, ParseOpResult};
|
||||
|
||||
|
||||
use crsn::asm::instr::Op;
|
||||
use crsn::asm::parse::arg_parser::ArgParser;
|
||||
|
||||
use crate::defs::ArithOp;
|
||||
use crsn::asm::parse::arg_parser::ArgParser;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArithOpParser {
|
||||
@@ -26,7 +25,7 @@ impl AsmModule for ArithOpParser {
|
||||
}
|
||||
|
||||
fn parse_op(&self, keyword: &str, mut args: ArgParser) -> Result<ParseOpResult, Error> {
|
||||
Ok(ParseOpResult::Parsed(Box::new(match keyword {
|
||||
Ok(ParseOpResult::Parsed(Op::Ext(Box::new(match keyword {
|
||||
"cmp" => {
|
||||
ArithOp::Compare {
|
||||
a: args.next_rd()?,
|
||||
@@ -451,6 +450,6 @@ impl AsmModule for ArithOpParser {
|
||||
_other => {
|
||||
return Ok(ParseOpResult::Unknown(args));
|
||||
}
|
||||
})))
|
||||
}))))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user