Feature (simulator): Add 'simulation halting - reached cycle limit' notice
This commit is contained in:
parent
245da348ea
commit
79ad1678f4
|
|
@ -288,7 +288,11 @@ exports.runProgram = async (code, debug = false) => {
|
|||
let step = 0;
|
||||
while (true) {
|
||||
step = step + 1;
|
||||
if (CYCLE_LIMIT && (step > CYCLE_LIMIT)) { break; } // Temporary limit as a lazy way to halt infinite loops:
|
||||
// Temporary limit as a lazy way to halt infinite loops:
|
||||
if (CYCLE_LIMIT && (step > CYCLE_LIMIT)) {
|
||||
console.log('SIMULATION HALTING - reached cycle limit');
|
||||
break;
|
||||
}
|
||||
if (!CPU.running) break;
|
||||
if (CPU.IP >= CPU.memory.length) break;
|
||||
stepCPU();
|
||||
|
|
|
|||
Loading…
Reference in New Issue