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

2 views
Skip to first unread message

codesite...@google.com

unread,
May 28, 2009, 5:35:26 PM5/28/09
to zvm...@googlegroups.com
Revision: 2e460d6fc7
Author: David Anderson <da...@natulte.net>
Date: Thu May 28 14:32:26 2009
Log: Implement the call_2s and call_2n opcodes....
http://code.google.com/p/zvm/source/detail?r=2e460d6fc7

Modified:
/zvm/zcpu.py
/zvm/zstackmanager.py

=======================================
--- /zvm/zcpu.py Wed May 27 18:08:36 2009
+++ /zvm/zcpu.py Thu May 28 14:32:26 2009
@@ -203,7 +203,7 @@
def op_jg(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
def op_dec_chk(self, variable, test_value):
"""Decrement the variable, and branch if the value becomes
less than test_value."""
@@ -239,15 +239,15 @@
def op_test_attr(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
def op_set_attr(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
def op_clear_attr(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
def op_store(self, variable, value):
"""Store the given value to the given variable."""
self._write_result(value, store_addr=variable)
@@ -278,11 +278,11 @@
def op_get_prop_addr(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
def op_get_next_prop(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
def op_add(self, a, b):
"""Signed 16-bit addition."""
result = self._unmake_signed(
@@ -312,14 +312,14 @@
def op_mod(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
- def op_call_2s(self, *args):
+
+ def op_call_2s(self, routine_addr, arg1):
"""TODO: Write docstring here."""
- raise ZCpuNotImplemented
-
- def op_call_2n(self, *args):
- """TODO: Write docstring here."""
- raise ZCpuNotImplemented
+ self._call(routine_addr, [arg1], True)
+
+ def op_call_2n(self, routine_addr, arg1):
+ """Call routine(arg1) and throw away the result."""
+ self._call(routine_addr, [arg1], False)

def op_set_colour(self, *args):
"""TODO: Write docstring here."""
@@ -392,7 +392,7 @@
# signed integer. We need to make it signed before applying
# the offset.
if (offset >= 2**15):
- offset = - 2**16 + offset
+ offset = - 2**16 + offset
log("Jump unconditionally to relative offset %d" % offset)

# Apparently reading the 2 bytes of operand *isn't* supposed
@@ -748,7 +748,7 @@
def op_check_unicode(self, *args):
"""TODO: Write docstring here."""
raise ZCpuNotImplemented
-
+
# Declaration of the opcode tables. In a Z-Machine, opcodes are
# divided into tables based on the operand type. Within each
# table, the operand is then indexed by its number. We preserve
=======================================
--- /zvm/zstackmanager.py Wed May 27 15:38:42 2009
+++ /zvm/zstackmanager.py Thu May 28 14:32:26 2009
@@ -8,6 +8,8 @@
# root directory of this distribution.
#

+from zlogging import log
+
class ZStackError(Exception):
"General exception for stack or routine-related errors"
pass

Reply all
Reply to author
Forward
0 new messages