ignore many common instruction fragments
This commit is contained in:
1 parent
2674adf1e6
commit
e63b978137
2 files changed
+29
No files matched your search
@@ -100,6 +100,28 @@ int main(int argc,char **argv)
|
|||||||
// since that is the max length of a 6502 instruction
|
// since that is the max length of a 6502 instruction
|
||||||
int single_instruction=0;
|
int single_instruction=0;
|
||||||
if (k==3) {
|
if (k==3) {
|
||||||
|
// Reject some very common instruction fragments
|
||||||
|
|
||||||
|
|
||||||
|
// Branch followed by any opcode
|
||||||
|
if (f1[i]==0xd0) break;
|
||||||
|
if (f1[i]==0xf0) break;
|
||||||
|
if (f1[i]==0xb0) break;
|
||||||
|
if (f1[i]==0x10) break;
|
||||||
|
|
||||||
|
if (f1[i+1]==0x85) {
|
||||||
|
// Single byte followed by STA $xx
|
||||||
|
// Super common, so can be ignored.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Common 2-byte instructions followed by
|
||||||
|
// any single byte are very common and not
|
||||||
|
// copyrightable.
|
||||||
|
if (f1[i]==0x85) break;
|
||||||
|
if (f1[i]==0xa9) break;
|
||||||
|
if (f1[i]==0xc9) break;
|
||||||
|
|
||||||
// Filter out all 3 byte instructions
|
// Filter out all 3 byte instructions
|
||||||
switch(f1[i]) {
|
switch(f1[i]) {
|
||||||
case 0x0C: // TSB $nnnn
|
case 0x0C: // TSB $nnnn
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
LDA #$20, then call a routine
|
||||||
|
|
||||||
|
LDA #$20
|
||||||
|
JSR $xxxx
|
||||||
|
|
||||||
|
Obvious sequence for doing this.
|
||||||
|
Not copyrightable.
|
||||||
Reference in new issue
Block a user