                (-> (pop-item :code state)
                    (pop-item :boolean state)
                    (pop-item :integer state)
-                   (assoc-in [:gtm :tapes 0 pos]
+                   (assoc-in [:gtm :tracks 0 pos]
                              (-> write-instr-map
                                  (assoc :instruction new-instr)
                                  (assoc :silent new-silent)

  (fn [state]
    (if (:gtm state)
      (let [pos (:position (:gtm state))
            instr-map (get-in state [:gtm :tapes 0 pos])]
        (if instr-map
          (trace 'gtm_read_all
                 (push-item (:instruction instr-map) :code state)

             (not (empty? (ensure-list (stack-ref :code 0 state)))))
      (let [pos (:position (:gtm state))
            write-instr-map (ensure-instruction-map 
                              (get-in state [:gtm :tracks 0 pos]))
            new-instr (first (flatten (ensure-list (stack-ref :code 0 state))))]
        (trace 'gtm_write_instruction
               (-> (pop-item :code state)
                   (assoc-in [:gtm :tracks 0 pos]
                             (assoc write-instr-map :instruction new-instr)))))
      state)))

