MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / opcode_loop_mode

Function opcode_loop_mode

src/readcpu.cpp:932–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930}
931
932bool opcode_loop_mode(uae_u16 opcode)
933{
934 struct instr *c = &table68k[opcode];
935 bool loopmode = false;
936 int i;
937 for (i = 0; lookuptab[i].name[0]; i++) {
938 if (c->mnemo == lookuptab[i].mnemo)
939 break;
940 }
941 if (lookuptab[i].flags & MNEMOFLAG_LOOPMODE) {
942 // Source is Dn,An,(An),(An)+,-(An)
943 // Destination is Dn,An,(An),(An)+,-(An)
944 // Both source and destination must not be Dn or An.
945 // RMW instruction must not be Dn or An
946 if (((isreg(c->smode) || c->smode == Aind || c->smode == Apdi || c->smode == Aipi)) &&
947 ((!c->duse && !isreg(c->smode)) || (c->duse && (isreg(c->dmode) || c->dmode == Aind || c->dmode == Apdi || c->dmode == Aipi))) &&
948 (!c->duse || (isreg(c->smode) && !isreg(c->dmode)) || (!isreg(c->smode) && isreg(c->dmode)) || (!isreg(c->smode) && !isreg(c->dmode)))) {
949 loopmode = true;
950 }
951 if (c->mnemo == i_MOVE || c->mnemo == i_MOVEA) {
952 // move x,reg: not supported
953 if (isreg(c->dmode))
954 loopmode = false;
955 // move reg,-(an): not supported
956 if (isreg(c->smode) && c->dmode == Apdi)
957 loopmode = false;
958 }
959 }
960 return loopmode;
961}
962
963void init_table68k(void)
964{

Callers 4

test_mnemoFunction · 0.85
testFunction · 0.85
gen_opcodeFunction · 0.85
build_cpufunctblFunction · 0.85

Calls 1

isregFunction · 0.70

Tested by 2

test_mnemoFunction · 0.68
testFunction · 0.68