mirror of
https://github.com/cshepherd/yagsdisasm.git
synced 2024-12-11 18:49:18 +00:00
fix branch address calculation bug introduced in previous commit
This commit is contained in:
parent
cdf66ed8d5
commit
4677f075ae
@ -477,9 +477,9 @@ class Disassembler_65816
|
||||
case 'PCRel':
|
||||
if( ord($arg_bytes[0]) > 127)
|
||||
{
|
||||
$output .= sprintf( ' %04X {-%02X}', $this->rel_offset( $this->pc, ord($arg_bytes[0]),strlen($arg_bytes)), 256-ord($arg_bytes[0]));
|
||||
$output .= sprintf( ' %04X {-%02X}', $this->rel_offset( ord($arg_bytes[0]),strlen($arg_bytes)), 256-ord($arg_bytes[0]));
|
||||
} else {
|
||||
$output .= sprintf( ' %04X {+%02X}', $this->rel_offset( $this->pc, ord($arg_bytes[0]),strlen($arg_bytes)), ord($arg_bytes[0]));
|
||||
$output .= sprintf( ' %04X {+%02X}', $this->rel_offset( ord($arg_bytes[0]),strlen($arg_bytes)), ord($arg_bytes[0]));
|
||||
}
|
||||
break;
|
||||
case 'Abs':
|
||||
@ -527,9 +527,9 @@ class Disassembler_65816
|
||||
$offset = (ord($arg_bytes[1])*256)+ord($arg_bytes[0]);
|
||||
if( $offset > 32767 )
|
||||
{
|
||||
$output .= sprintf( ' %04X {-%02X}', $this->rel_long_offset( $this->pc, $offset, strlen($arg_bytes)), 65536-$offset);
|
||||
$output .= sprintf( ' %04X {-%02X}', $this->rel_long_offset( $offset, strlen($arg_bytes)), 65536-$offset);
|
||||
} else {
|
||||
$output .= sprintf( ' %04X {+%02X}', $this->rel_long_offset( $this->pc, $offset, strlen($arg_bytes)), $offset);
|
||||
$output .= sprintf( ' %04X {+%02X}', $this->rel_long_offset( $offset, strlen($arg_bytes)), $offset);
|
||||
}
|
||||
break;
|
||||
case 'StackAbs':
|
||||
|
Loading…
Reference in New Issue
Block a user