426 { |
428 { |
427 this.frame.pc += INS_sBx(instruction); |
429 this.frame.pc += INS_sBx(instruction); |
428 this.frame.reg[A+3].value = RA.value; |
430 this.frame.reg[A+3].value = RA.value; |
429 } |
431 } |
430 break; |
432 break; |
|
433 case OP_TEST: |
|
434 var RA = this.frame.reg[INS_A(instruction)]; |
|
435 var RA_bool = RA.type == "nil" || (RA.type == "boolean" && RA.value == false); |
|
436 if(RA_bool == (INS_C(instruction)!=0)) |
|
437 this.frame.pc++; |
|
438 break; |
|
439 case OP_JMP: |
|
440 this.frame.pc+=INS_sBx(instruction); |
|
441 break; |
431 default: |
442 default: |
432 throw "Unhandled opcode: "+INS_OPCODE(instruction); |
443 throw "Unhandled opcode: "+INS_OPCODE(instruction); |
433 } |
444 } |
434 } |
445 } |
435 } |
446 } |