diff nworker_c.rhope @ 176:327bcf35e094

Add bytecode interpreter
author Mike Pavone <pavone@retrodev.com>
date Wed, 08 Jun 2011 23:24:29 -0700
parents 926b56a43f47
children
line wrap: on
line diff
--- a/nworker_c.rhope	Wed Jun 08 23:24:15 2011 -0700
+++ b/nworker_c.rhope	Wed Jun 08 23:24:29 2011 -0700
@@ -1661,7 +1661,7 @@
 
 Register Builtins@NProgram[prog:out]
 {
-	registered <- [[[[[[[[[[[prog]Register Worker["Print", "rhope", 1, 1]
+	registered <- [[[[[[[[[[[[prog]Register Worker["Print", "rhope", 1, 1]
 	]Register Worker["If@Boolean", "rhope", 1, 2]
 	]Register Worker["Build", "rhope", 1, 1]
 	]Register Worker["Blueprint Of", "rhope", 1, 1]
@@ -1671,9 +1671,10 @@
 	]Register Worker["Blueprint From ID", "rhope", 1, 2]
 	]Register Worker["Pause", "rhope", 1, 1]
 	]Register Worker["Resume", "rhope", 2, 2]
+	]Register Worker["Run Bytecode", "rhope", 2, 1]
 	]Register Number Methods
 	
-	out <- [[[[[[[[[registered]Bind Worker["If@Boolean",
+	out <- [[[[[[[[[[registered]Bind Worker["If@Boolean",
 		[[[[[NWorker["rhope"]
 		]Inputs <<[("condition")]
 		]Input Types <<[ [()]Append[Type Instance["Boolean"]] ]
@@ -1736,6 +1737,14 @@
 		]Outputs <<[("success","cantresume")]
 		]Output Types <<[ [[()]Append[Type Instance["Any Type"]]]Append[Type Instance["Any Type"]] ]
 		]Builtin? <<[Yes]]
+	]Bind Worker["Run Bytecode",
+		[[[[[NWorker["rhope"]
+		]Inputs <<[("bytecode","constants")]
+		]Input Types <<[ [[()]Append[Type Instance["Array"]]]Append[Type Instance["Boxed Array"]] ]
+		]Outputs <<[("ret1")]
+		]Output Types <<[ [()]Append[Type Instance["Any Type"]] ]
+		]Builtin? <<[Yes]
+	]
 }
 
 Find Worker@NProgram[prog, name:out,notfound]