mirror of
https://github.com/cc65/cc65.git
synced 2024-06-24 18:28:53 +00:00
Fixed the way that the disassembler looks for the end of a segment.
It checks only the bytes that actually were printed. It won't show a bad error message when disassembling address $0000. Fixes #506 on cc65's Github project.
This commit is contained in:
parent
15d9373ad7
commit
de1f80571a
|
@ -350,6 +350,7 @@ static void OneOpcode (unsigned RemainingBytes)
|
||||||
/* Disassemble one opcode */
|
/* Disassemble one opcode */
|
||||||
{
|
{
|
||||||
unsigned I;
|
unsigned I;
|
||||||
|
unsigned OldPC = PC;
|
||||||
|
|
||||||
/* Get the opcode from the current address */
|
/* Get the opcode from the current address */
|
||||||
unsigned char OPC = GetCodeByte (PC);
|
unsigned char OPC = GetCodeByte (PC);
|
||||||
|
@ -476,7 +477,7 @@ static void OneOpcode (unsigned RemainingBytes)
|
||||||
/* Change back to the default CODE segment if
|
/* Change back to the default CODE segment if
|
||||||
** a named segment stops at the current address.
|
** a named segment stops at the current address.
|
||||||
*/
|
*/
|
||||||
for (I = D->Size; I >= 1; --I) {
|
for (I = PC - OldPC; I > 0; --I) {
|
||||||
if (IsSegmentEnd (PC - I)) {
|
if (IsSegmentEnd (PC - I)) {
|
||||||
EndSegment ();
|
EndSegment ();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user