decoding more formats
1 files changed, 9 insertions(+), 5 deletions(-)

M src/main.fnl
M src/main.fnl +9 -5
@@ 207,19 207,23 @@ 
 
 (fn decode-abx [i]
   "Decode an instruction in the :iABx format"
-  0)
+  (let [a (extract i 7 8)
+        bx (extract i 15 17)]
+  {: a : bx})
 
 (fn decode-absbx [i]
-  "Decode an instruction in the :iAsBx format"
-  0)
+  "Decode an instruction in the :iAsBx format.  This is ABx but Bx is signed, which... doesn't matter for us I think...  so we're ok?"
+  (decode-abx i))
 
 (fn decode-ax [i]
   "Decode an instruction in the :iAx format"
-  0)
+  (let [a (extract i 7 25)]
+    {: a})
 
 (fn decode-asj [i]
   "Decode an instruction in the :isJ format"
-  0)
+  (let [j (extract i 7 25)]
+    {: j}))
 
 (fn decode [i]
   "Decodes a 32-bit integer into a table containing a Lua opcode"