summaryrefslogtreecommitdiff
path: root/6502.lisp
diff options
context:
space:
mode:
Diffstat (limited to '6502.lisp')
-rw-r--r--6502.lisp16
1 files changed, 16 insertions, 0 deletions
diff --git a/6502.lisp b/6502.lisp
index 1e9c7d4..7c0c2a7 100644
--- a/6502.lisp
+++ b/6502.lisp
@@ -202,6 +202,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
(NOP 234 (implied))
(BRK 0 (implied))))
+
+
+(defun extract-keys (list)
+ "Extract the keys of associative lists."
+ (let ((ret nil))
+ (progn
+ (dolist (i list)
+ (setf ret
+ (cons (car i) ret)))
+ (reverse ret))))
+
+;; Generated list of opcodes.
+(setf
+ *opcodes*
+ (extract-keys *instructions*))
+
(defun valid-instruction? (instruction addressing-mode)
"Is instruction and addressing mode combination correct?"
(cond