[zvm] 1 new revision pushed by david.jc.anderson on 2009-05-28 23:26 GMT

3 views
Skip to first unread message

codesite...@google.com

unread,
May 28, 2009, 7:27:24 PM5/28/09
to zvm...@googlegroups.com
Revision: fe4120b43b
Author: David Anderson <da...@natulte.net>
Date: Thu May 28 16:26:28 2009
Log: Implement the op_jl opcode properly.
http://code.google.com/p/zvm/source/detail?r=fe4120b43b

Modified:
/zvm/zcpu.py

=======================================
--- /zvm/zcpu.py Thu May 28 16:20:45 2009
+++ /zvm/zcpu.py Thu May 28 16:26:28 2009
@@ -196,9 +196,17 @@
# Fallthrough: No args were equal to a.
self._branch(False)

- def op_jl(self, a, b):
- """Branch if the first argument is less than the second."""
- self._branch(self._make_signed(a) < self._make_signed(b))
+ def op_jl(self, a, *others):
+ """Branch if the first argument is less than any subsequent
+ argument. Note that the second operand may be absent, in
+ which case there is no jump."""
+ for b in others:
+ if a < b:
+ self._branch(True)
+ return
+
+ # Fallthrough: No args were greater than a.
+ self._branch(False)

def op_jg(self, *args):
"""TODO: Write docstring here."""

Reply all
Reply to author
Forward
0 new messages