From 84ad1b97a5095cf6010593ec96e7d43d77fc0fa5 Mon Sep 17 00:00:00 2001 From: aleksei Date: Fri, 12 Apr 2024 13:53:21 +1000 Subject: Added syntax evaluation for asm lines --- 6502.lisp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to '6502.lisp') 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 -- cgit v1.2.3