Add Disassemble, fix bug in position calculation
* Disassemble structure can be used for dumping an object section * Assembler position calculation was messing up, causing jump addresses to be wrong. This is fixed. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -7,6 +7,15 @@ macro_rules! registers {
|
||||
$(
|
||||
pub const $variant: Reg = $value;
|
||||
)*
|
||||
|
||||
pub fn reg_name(reg: Reg) -> Option<&'static str> {
|
||||
match reg {
|
||||
$(
|
||||
$value => Some(stringify!($variant)),
|
||||
)*
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -91,5 +100,6 @@ registers! {
|
||||
R47 = 61,
|
||||
R48 = 62,
|
||||
R49 = 63,
|
||||
LAST_REG = R49,
|
||||
}
|
||||
|
||||
pub const LAST_REG: Reg = R49;
|
||||
|
||||
Reference in New Issue
Block a user