FF FF FF FF
__ __ ^^^^ - r3_imm third reg or imm
__ _^ __ __ - r2 second reg
__ ^_ __ __ - r1 first reg
^^__ __ __ - opcode - operation code
Registers: r0-r15
MEM_SIZE = 65536 words (32 bits)
0x0000 ↓ CODE + DATA
...
0x8000 ↑ STACK
... DISPLAY MEM (32768 words == 256*128 ARGB)
0xFFFF
For run CPU place assempler in the left window, Load code
and Run CPU
. During execution you can Pause CPU
and check status in the middle (PC and registers) and right (memory) windows. After pause you can execute one instruction with Step CPU
, reset with Stop CPU
and continue execution with Run CPU
.
In the lower left window full ISA description is placed.
{ cpu->stop(); }
{ cpu->m_nextPC = m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_PC + 1; cpu->m_nextPC = m_r3_imm; }
{ cpu->m_nextPC = cpu->m_regFile[m_r1]; }
{ if (cpu->m_regFile[m_r1] == cpu->m_regFile[m_r2]) { cpu->m_nextPC = m_r3_imm; } }
{ if (cpu->m_regFile[m_r1] != cpu->m_regFile[m_r2]) { cpu->m_nextPC = m_r3_imm; } }
{ if ((int32_t)cpu->m_regFile[m_r1] > (int32_t)cpu->m_regFile[m_r2]) { cpu->m_nextPC = m_r3_imm; } }
{ if ((int32_t)cpu->m_regFile[m_r1] m_regFile[m_r2]) { cpu->m_nextPC = m_r3_imm; } }
{ if (cpu->m_regFile[m_r1] > cpu->m_regFile[m_r2]) { cpu->m_nextPC = m_r3_imm; } }
{ if (cpu->m_regFile[m_r1] m_regFile[m_r2]) { cpu->m_nextPC = m_r3_imm; } }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2]; }
{ cpu->m_regFile[m_r1] = m_r3_imm; }
{ cpu->m_regFile[m_r1] = m_r3_imm
{ cpu->m_regFile[m_r1] = -cpu->m_regFile[m_r2]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] + cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] - cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] * cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] / cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] % cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = pow(cpu->m_regFile[m_r2], cpu->m_regFile[m_r3_imm]); }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] + (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] - (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] * (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] / (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] % (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = pow(cpu->m_regFile[m_r2], (int16_t)m_r3_imm); }
{ cpu->m_regFile[m_r1] = pow((int16_t)m_r3_imm, cpu->m_regFile[m_r2]); }
{ cpu->m_regFile[m_r1] = ~cpu->m_regFile[m_r2]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] & cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] | cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] ^ cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = (uint32_t)cpu->m_regFile[m_r2] >> cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] >> cpu->m_regFile[m_r3_imm]; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] & (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] | (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] ^ (int16_t)m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2]
{ cpu->m_regFile[m_r1] = (uint32_t)cpu->m_regFile[m_r2] >> m_r3_imm; }
{ cpu->m_regFile[m_r1] = cpu->m_regFile[m_r2] >> m_r3_imm; }
{ cpu->m_regFile[m_r1] = (int32_t)((float)cpu->m_regFile[m_r2] + (float)cpu->m_regFile[m_r3_imm]); }
{ cpu->m_regFile[m_r1] = (int32_t)((float)cpu->m_regFile[m_r2] - (float)cpu->m_regFile[m_r3_imm]); }
{ cpu->m_regFile[m_r1] = (int32_t)((float)cpu->m_regFile[m_r2] * (float)cpu->m_regFile[m_r3_imm]); }
{ cpu->m_regFile[m_r1] = (int32_t)((float)cpu->m_regFile[m_r2] / (float)cpu->m_regFile[m_r3_imm]); }
{ cpu->m_regFile[m_r1] = (int32_t)(pow((float)cpu->m_regFile[m_r2], (float)cpu->m_regFile[m_r3_imm])); }
{ cpu->m_regFile[m_r1] = cpu->readMem(cpu->m_regFile[m_r2] + cpu->m_regFile[m_r3_imm]); }
{ cpu->readMem(cpu->m_regFile[m_r2] + cpu->m_regFile[m_r3_imm]) = cpu->m_regFile[m_r1]; }
{ cpu->m_regFile[m_r1] = cpu->readMem(cpu->m_regFile[m_r2] + (int16_t)m_r3_imm); }
{ cpu->readMem(cpu->m_regFile[m_r2] + (int16_t)m_r3_imm) = cpu->m_regFile[m_r1]; }
{ cpu->updateDisplay(); QThread::usleep(10); }
{ cpu->m_regFile[m_r1] = QRandomGenerator::global()->generate(); }
{ cpu->pause(); }