Popravil ekstrakcijo bitov nixbpe

This commit is contained in:
Timon 2025-11-23 12:02:28 +01:00
parent 5dae60dcec
commit 3cfdd46516

View file

@ -166,27 +166,31 @@ public:
}
InstructionInfo ii = it->second;
bool uspesno = false;
switch (ii.format) {
case 1:
execF1(opcode8, ii.mnemonic);
uspesno = execF1(opcode8, ii.mnemonic);
break;
case 2: {
uint8_t operand = fetch();
execF2(opcode8, operand, ii.mnemonic);
uspesno = execF2(opcode8, operand, ii.mnemonic);
break;
}
case 3: {
uint8_t b2 = fetch();
uint8_t b3 = fetch();
execSIC_F3_F4(opcode8, b2, b3, ii.mnemonic);
uspesno = execSIC_F3_F4(opcode8, b2, b3, ii.mnemonic);
break;
}
default:
break;
}
if (uspesno) return;
else {}
}
@ -201,9 +205,22 @@ public:
}
bool execSIC_F3_F4(uint8_t opcdode, uint8_t b1, uint8_t b2, string mnemonic) {
bool execSIC_F3_F4(uint8_t byte1, uint8_t byte2, uint8_t byte3, string mnemonic) {
uint8_t n = (byte1 >> 7) & 1;
uint8_t i = (byte1 >> 6) & 1;
uint8_t x = (byte2 >> 7) & 1;
uint8_t b = (byte2 >> 6) & 1;
uint8_t p = (byte2 >> 5) & 1;
uint8_t e = (byte2 >> 4) & 1;
if (n == 0 && i == 0) {
//imamo format SIC
} else if (e == 1) {
//imamo format 4
} else {
//imamo format 3
}
}
};