    :jge   0x30    ; jump-if-greater-or-equal
    :jset  0x40})  ; jump-if-set
 
-(def src-table
+(def ^:private ^:const source-table
   "Value modes."
   {:k     0x00    ; constant
    :x     0x08})  ; index register
 
-(def rval-table
+(def ^:private ^:const retval-table
   "Return value modes."
   {:k     0x00    ; constant
    :x     0x08    ; index register
    :a     0x10})  ; accumulator
+
+(def ^:private ^:const table
+  "All instruction constants."
+  (merge kind-table
+         size-table
+         mode-table
+         operation-table
+         source-table
+         retval-table))
+
+; Category checking
+
+(defn kind? [ins]
+  (contains? kind-table ins))
+
+(defn size? [ins]
+  (contains? size-table ins))
+
+(defn mode? [ins]
+  (contains? mode-table ins))
+
+(defn op? [ins]
+  (contains? operation-table ins))
+
+(defn source? [ins]
+  (contains? source-table ins))
+
+(defn retval? [ins]
+  (contains? retval-table ins))
+
+; Translation
+
+(defn to-code [ins]
+  (get table ins))

   :ret   0x06    ; return
   :misc  0x07})  ; miscellaneous

(def size-table
  "Data size variants."
  {:w     0x00    ; word
   :h     0x08    ; halfword
   :b     0x10})  ; byte

(def mode-table
  "Addressing modes."
  {:imm   0x00    ; constant
   :abs   0x20    ; data at fixed-offset

   :len   0x80    ; packet length
   :msh   0xa0})  ; IP header length

(def ^:private ^:const operation-table
  "Arithmetic and jump instructions."
  {:add   0x00    ; acc <- acc + k 
   :sub   0x10    ; acc <- acc - k 
