mirror of
https://github.com/ksherlock/x65.git
synced 2025-01-15 17:31:19 +00:00
Disassembler memory access check
This commit is contained in:
parent
7902863ccc
commit
1bf3afa0d0
@ -70,6 +70,6 @@ CIA2_TimerB_Ctrl = $dd0f data
|
||||
CIA2 = $dd10-$de00 data
|
||||
IO_Area1 = $de00-$df00 data
|
||||
IO_Area2 = $df00-$e000 data
|
||||
Interrupt_NMI_Address = $fffa-$fffc data
|
||||
Reset_Address = $fffc-$fffe data
|
||||
Interrupt_Address = $fffe-$10000 data
|
||||
NMIVector = $fffa-$fffc pointers vector to NMI interrupt
|
||||
ResetVector = $fffc-$fffe pointers vector to reset address
|
||||
IntVector = $fffe-$10000 pointers vector to interrupt address
|
||||
|
@ -1379,20 +1379,22 @@ void GetReferences(unsigned char *mem, size_t bytes, bool acc_16, bool ind_16, i
|
||||
for (int i = 0; i<last_user; ++i) {
|
||||
if (refs[i].data==DT_PTRS || refs[i].data==DT_PTRS_DATA) {
|
||||
int num = refs[i].size ? (refs[i].size/2) : ((refs[i+1].address - refs[i].address)/2);
|
||||
unsigned char *p = mem + refs[i].address - addr;
|
||||
for (int l = 0; l<num; l++) {
|
||||
int a = p[0] + ((unsigned short)p[1]<<8);
|
||||
int n = GetLabelIndex(a);
|
||||
int nr = (int)refs.size();
|
||||
struct RefLink ref = { 2*l + refs[i].address, refs[i].data==DT_PTRS ? RT_JSR : RT_DATA };
|
||||
if (n<0) {
|
||||
refs.push_back(RefAddr(a));
|
||||
refs[nr].pRefs = new std::vector<RefLink>();
|
||||
refs[nr].data = refs[i].data==DT_PTRS_DATA ? DT_DATA : DT_CODE;
|
||||
refs[nr].pRefs->push_back(ref);
|
||||
} else
|
||||
refs[n].pRefs->push_back(ref);
|
||||
p += 2;
|
||||
if (refs[i].address>=addr && (refs[i].address+refs[i].size)<=(addr+bytes)) {
|
||||
unsigned char *p = mem + refs[i].address - addr;
|
||||
for (int l = 0; l<num; l++) {
|
||||
int a = p[0] + ((unsigned short)p[1]<<8);
|
||||
int n = GetLabelIndex(a);
|
||||
int nr = (int)refs.size();
|
||||
struct RefLink ref = { 2*l + refs[i].address, refs[i].data==DT_PTRS ? RT_JSR : RT_DATA };
|
||||
if (n<0) {
|
||||
refs.push_back(RefAddr(a));
|
||||
refs[nr].pRefs = new std::vector<RefLink>();
|
||||
refs[nr].data = refs[i].data==DT_PTRS_DATA ? DT_DATA : DT_CODE;
|
||||
refs[nr].pRefs->push_back(ref);
|
||||
} else
|
||||
refs[n].pRefs->push_back(ref);
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1954,7 +1956,7 @@ void Disassemble(strref filename, unsigned char *mem, size_t bytes, bool acc_16,
|
||||
}
|
||||
if (addr>refs[curr_label_index].address) {
|
||||
if (ref.label)
|
||||
out.sprintf(STRREF_FMT " = %02x\n", STRREF_ARG(ref.label), ref.address);
|
||||
out.sprintf(STRREF_FMT " = $%02x\n", STRREF_ARG(ref.label), ref.address);
|
||||
else
|
||||
out.sprintf("%s_%d = $%02x\n", ref.local ? ".l" : (ref.data==DT_CODE ? "Code" : (ref.address>=0 && ref.address<0x100 ? "zp" : "Data")),
|
||||
ref.number, ref.address);
|
||||
|
Loading…
x
Reference in New Issue
Block a user