404 instruction = frame.f.instructions[frame.pc++]; |
404 instruction = frame.f.instructions[frame.pc++]; |
405 if(debugMode) |
405 if(debugMode) |
406 { |
406 { |
407 sys.puts("PC: "+(frame.pc-1)+" OP: "+instruction[0]); |
407 sys.puts("PC: "+(frame.pc-1)+" OP: "+instruction[0]); |
408 for(var i = 0; i < frame.reg.length; i++) |
408 for(var i = 0; i < frame.reg.length; i++) |
409 sys.puts("\t"+i+":\t("+frame.reg[i].type+") "+frame.reg[i].toString()); |
409 { |
|
410 var entry = frame.reg[i]; |
|
411 if(entry && entry.type) |
|
412 sys.puts("\t"+i+":\t("+entry.type+") "+entry.toString()); |
|
413 else |
|
414 sys.puts("\t"+i+": "+entry); |
|
415 } |
410 } |
416 } |
411 switch(INS_OPCODE(instruction)) |
417 switch(INS_OPCODE(instruction)) |
412 { |
418 { |
413 case OP_MOVE: |
419 case OP_MOVE: |
414 frame.reg[INS_A(instruction)] = frame.reg[INS_B(instruction)]; |
420 frame.reg[INS_A(instruction)] = frame.reg[INS_B(instruction)]; |