|
|
@ -95,12 +95,25 @@ pub fn parse_data_disp(tok: Option<Sexp>, pcx: &ParserContext) -> Result<DataDis |
|
|
|
if let Some(val) = pstate.reg_aliases.get(reference) { |
|
|
|
if let Some(val) = pstate.reg_aliases.get(reference) { |
|
|
|
Ok(DataDisp::ObjectPtr(*val)) |
|
|
|
Ok(DataDisp::ObjectPtr(*val)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Ok(DataDisp::ObjectPtr(reg::parse_reg(reference)?)) |
|
|
|
let reg = reg::parse_reg(reference)?; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pstate.reg_aliases.values().find(|v| **v == reg).is_some() { |
|
|
|
|
|
|
|
Err(CrsnError::Parse(format!("Sym exists for register {}, direct access denied. Unsym it if needed.", reg).into())) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Ok(DataDisp::ObjectPtr(reg)) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if s.starts_with(|c: char| c.is_ascii_digit()) { |
|
|
|
} else if s.starts_with(|c: char| c.is_ascii_digit()) { |
|
|
|
Ok(DataDisp::Immediate(unsafe { std::mem::transmute(parse_i64(s)?) })) |
|
|
|
Ok(DataDisp::Immediate(unsafe { std::mem::transmute(parse_i64(s)?) })) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Ok(DataDisp::Register(reg::parse_reg(s)?)) |
|
|
|
let reg = reg::parse_reg(s)?; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let pstate = pcx.state.borrow(); |
|
|
|
|
|
|
|
if pstate.reg_aliases.values().find(|v| **v == reg).is_some() { |
|
|
|
|
|
|
|
Err(CrsnError::Parse(format!("Sym exists for register {}, direct access denied. Unsym it if needed.", reg).into())) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Ok(DataDisp::Register(reg)) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
_ => { |
|
|
|
_ => { |
|
|
|