Skip to content

Commit

Permalink
Update microcode generator
Browse files Browse the repository at this point in the history
  • Loading branch information
atgreen committed Sep 23, 2012
1 parent de2823f commit 4701d7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/microcoder.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
(loop for filepos = (file-position in)
for line = (read-line in nil)
until (let ((s (cl-ppcre:split "\\|" line)))
(equal (length s) 9)))
(equal (length s) 10)))
(read-line in nil)

;; We're at the table contents now. Parse it and write our new
Expand All @@ -48,11 +48,11 @@
for line = (read-line in nil)
while line do
(let ((s (cl-ppcre:split "\\|" line)))
(if (equal 9 (length s))
(destructuring-bind (junk1 name code wr? rA? rB? rm? wm? &rest junk2)
(if (equal 10 (length s))
(destructuring-bind (junk1 name code wA? wB? rA? rB? rm? wm? &rest junk2)
(mapcar (lambda (v) (string-trim " " v)) s)
(setf (aref opcode-array (parse-integer code :radix 2))
(list name wr? rA? rB? rm? wm?))))))
(list name wA? wB? rA? rB? rm? wm?))))))
(loop for i from 0 to 63
do (let ((o (aref opcode-array i)))
(if o
Expand All @@ -63,7 +63,7 @@
((equal n 1) (format out "1"))
(t (error "bad table entry")))))
(cdr o))
(format out "00000"))
(format out "000000"))
(format out "~%"))))
(close in)))

Expand Down

0 comments on commit 4701d7c

Please sign in to comment.