summaryrefslogtreecommitdiff
path: root/6502.lisp
diff options
context:
space:
mode:
authoraleksei <aleksei@aj.org>2024-04-12 13:53:21 +1000
committeraleksei <aleksei@aj.org>2024-04-12 13:53:21 +1000
commit84ad1b97a5095cf6010593ec96e7d43d77fc0fa5 (patch)
tree36a00eb699bb0ce7cd7d18dc1bf608d9714538c0 /6502.lisp
parent82632e220e3a0c2f72c463f8c07b9678d7399972 (diff)
Added syntax evaluation for asm lines
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