 (ns ibcm-assembler.core
   (:gen-class))
+
+;; Go easy on me - this was the first clojure code I ever wrote
 
 (def hex-digits [\0 \1 \2 \3 \4 \5 \6 \7 \8 \9 \A \B \C \D \E \F])
 (def op-names [:halt :io :shift :load :store :add :sub :and :or :xor :not :nop :jmp :jmpe :jmpl :brl])

  (opmap (keyword op)))

(defn remove-first [input] (apply str (rest input)))
(defn parse-instr [instr]
  "takes an instruction as a string and returns a map representing the instruction"
  (let [instr-seq (clojure.string/split instr #"\s+")

(defn format-instruction [op locn comm labelmap]
  (str (encode op labelmap) \tab locn \tab (pad op) comm))

;; TODO refactor label-map because i know there's about 1,000 better ways to do this
(defn label-map [lines]
  (->> (map list lines addresses)  
       (filter (fn [[k v]] (not (empty? k))))
       print
       (filter (fn [[k v]] (= (subs k 0 1) \.)))
       (map (fn [[k v]] [(subs k 1) v]))
       (into {})))
;; TODO note, I think I could use the state monad here to handle labels
;; I'm realizing that once I introduce a label map to these functions, I have two
;; options: either add an argument, the label map, or pass in the state as a monad
(defn assemble [x]
