lvm.js

changeset 106
04eb68b0f3e3
parent 105
fdcc139587a3
child 107
40b25248703b
equal deleted inserted replaced
105:fdcc139587a3 106:04eb68b0f3e3
403 { 403 {
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 sys.puts("STACK: "+sys.inspect(frame.reg)); 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 }
410 switch(INS_OPCODE(instruction)) 411 switch(INS_OPCODE(instruction))
411 { 412 {
412 case OP_MOVE: 413 case OP_MOVE:
413 frame.reg[INS_A(instruction)] = frame.reg[INS_B(instruction)]; 414 frame.reg[INS_A(instruction)] = frame.reg[INS_B(instruction)];

mercurial