mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-18 20:30:48 +00:00
JSR includes extra buffer
This commit is contained in:
parent
fc50481a58
commit
4ba53dd1b0
@ -19,9 +19,7 @@ public class AssemblerProgram extends AbstractFile
|
|||||||
private final int loadAddress;
|
private final int loadAddress;
|
||||||
private int executeOffset;
|
private int executeOffset;
|
||||||
|
|
||||||
private byte[] extraBuffer;
|
private byte[] extraBuffer = new byte[0];
|
||||||
// private int offset;
|
|
||||||
// private int length;
|
|
||||||
|
|
||||||
public AssemblerProgram (String name, byte[] buffer, int address)
|
public AssemblerProgram (String name, byte[] buffer, int address)
|
||||||
{
|
{
|
||||||
@ -49,7 +47,7 @@ public class AssemblerProgram extends AbstractFile
|
|||||||
{
|
{
|
||||||
String text = super.getHexDump ();
|
String text = super.getHexDump ();
|
||||||
|
|
||||||
if (extraBuffer == null)
|
if (extraBuffer.length == 0)
|
||||||
return text;
|
return text;
|
||||||
|
|
||||||
return text + "\n\n"
|
return text + "\n\n"
|
||||||
@ -61,7 +59,7 @@ public class AssemblerProgram extends AbstractFile
|
|||||||
{
|
{
|
||||||
String text = super.getAssembler ();
|
String text = super.getAssembler ();
|
||||||
|
|
||||||
if (extraBuffer == null)
|
if (extraBuffer.length == 0)
|
||||||
return text;
|
return text;
|
||||||
|
|
||||||
String extraName = String.format ("%s (extra)", name);
|
String extraName = String.format ("%s (extra)", name);
|
||||||
@ -262,8 +260,7 @@ public class AssemblerProgram extends AbstractFile
|
|||||||
String arrow = "";
|
String arrow = "";
|
||||||
if (cmd.value == 0x4C || cmd.value == 0x6C || cmd.value == 0x60 || cmd.offset != 0)
|
if (cmd.value == 0x4C || cmd.value == 0x6C || cmd.value == 0x60 || cmd.offset != 0)
|
||||||
arrow = "<--";
|
arrow = "<--";
|
||||||
if (cmd.value == 0x20 && // JSR
|
if (cmd.value == 0x20 && isLocal (cmd.target)) // JSR
|
||||||
cmd.target >= loadAddress && cmd.target < (loadAddress + buffer.length))
|
|
||||||
arrow = "<--";
|
arrow = "<--";
|
||||||
if (cmd.isTarget)
|
if (cmd.isTarget)
|
||||||
if (arrow.isEmpty ())
|
if (arrow.isEmpty ())
|
||||||
@ -273,6 +270,12 @@ public class AssemblerProgram extends AbstractFile
|
|||||||
return arrow;
|
return arrow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isLocal (int target)
|
||||||
|
{
|
||||||
|
return target >= loadAddress
|
||||||
|
&& target < loadAddress + buffer.length + extraBuffer.length;
|
||||||
|
}
|
||||||
|
|
||||||
private void getEquates ()
|
private void getEquates ()
|
||||||
{
|
{
|
||||||
equates = new HashMap<Integer, String> ();
|
equates = new HashMap<Integer, String> ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user