implement am26 support for constants
[fleet.git] / ships / Alu2.ship
index 081b4a5..df756ab 100644 (file)
@@ -4,14 +4,13 @@ ship: Alu2
 data  in:   in1
 data  in:   in2
 data  in:   inOp
+  constant ADD: 0
+  constant SUB: 1
+  constant MAX: 2
+  constant MIN: 3
 
 data  out:  out
 
-== Constants ========================================================
-ADD: add the two arguments; treat link as carry
-SUB: subtract the two arguments; treat link as carry
-MAX:
-MIN:
 
 == TeX ==============================================================
 This ship is a two-input arithmetic unit.  It features several
@@ -101,7 +100,34 @@ public void service() {
   end
 
 == Test ==============================================================================
-#skip
+// expected output
+#ship debug : Debug
+#ship alu   : Alu2
+
+#expect 17
+#expect 1
+#expect 8
+#expect 9
+
+debug.in:   [*] take, deliver;
+9:          sendto alu.in1;
+9:          sendto alu.in1;
+9:          sendto alu.in1;
+9:          sendto alu.in1;
+8:          sendto alu.in2;
+8:          sendto alu.in2;
+8:          sendto alu.in2;
+8:          sendto alu.in2;
+
+Alu2.inOp[ADD]:   sendto alu.inOp;
+Alu2.inOp[SUB]:   sendto alu.inOp;
+Alu2.inOp[MIN]:   sendto alu.inOp;
+Alu2.inOp[MAX]:   sendto alu.inOp;
+
+alu.in1:    [*] take, deliver;
+alu.in2:    [*] take, deliver;
+alu.inOp:   [*] take, deliver;
+alu.out:    [*] take, sendto debug.in;