summaryrefslogtreecommitdiff
path: root/utilities.lisp
diff options
context:
space:
mode:
authorAleksei Eaves <alekseijeaves@protonmail.com>2024-04-14 12:50:36 +1000
committerAleksei Eaves <alekseijeaves@protonmail.com>2024-04-14 12:50:36 +1000
commit75db422f7b9c73f1057bf3187c73bfaeb6003a0b (patch)
tree71639abce71a942fe593ba9e5111291da061bbc2 /utilities.lisp
parent5fd0592e0bf449ec25392d2cb1b4c3b45b9cd718 (diff)
Shifted things around
Diffstat (limited to 'utilities.lisp')
-rw-r--r--utilities.lisp7
1 files changed, 7 insertions, 0 deletions
diff --git a/utilities.lisp b/utilities.lisp
index c231f72..cb6aa51 100644
--- a/utilities.lisp
+++ b/utilities.lisp
@@ -73,3 +73,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
return-value))
;; Return nil if string was not a hexadecimal number.
nil))
+
+(defun valid-instruction? (instruction addressing-mode)
+ "Is instruction and addressing mode combination correct?"
+ (cond
+ ((member addressing-mode
+ (caddr (assoc instruction *instructions*))) t)
+ (t nil)))