summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-11-09 20:12:32 +0000
committerDamien <damien.p.george@gmail.com>2013-11-09 20:12:32 +0000
commit94658e2e2501cc1cdd3c0549f478573a97bac9ec (patch)
treee225b392f785960cd601724cddb8fa087e097195 /py
parentf3822fc34c42370ae1d4dae51e533d4e2069fe86 (diff)
downloadmicropython-94658e2e2501cc1cdd3c0549f478573a97bac9ec.tar.gz
micropython-94658e2e2501cc1cdd3c0549f478573a97bac9ec.zip
Add JUMP_IF_x_OR_POP opcodes to VM.
Diffstat (limited to 'py')
-rw-r--r--py/vm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/py/vm.c b/py/vm.c
index 735bb4366b..17df7e17f0 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -228,6 +228,24 @@ bool py_execute_byte_code_2(const byte **ip_in_out, py_obj_t *fastn, py_obj_t **
}
break;
+ case PYBC_JUMP_IF_TRUE_OR_POP:
+ DECODE_SLABEL;
+ if (rt_is_true(*sp)) {
+ ip += unum;
+ } else {
+ sp++;
+ }
+ break;
+
+ case PYBC_JUMP_IF_FALSE_OR_POP:
+ DECODE_SLABEL;
+ if (rt_is_true(*sp)) {
+ sp++;
+ } else {
+ ip += unum;
+ }
+ break;
+
/* we are trying to get away without using this opcode
case PYBC_SETUP_LOOP:
DECODE_UINT;