From fd5a8fac4f01272876685ea9c1b872381a795e37 Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Fri, 2 May 2025 22:38:35 +0200 Subject: [PATCH] Add check so zero-page instructions can't use too big operands --- wip-duuqnd/instruction.lisp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wip-duuqnd/instruction.lisp b/wip-duuqnd/instruction.lisp index ba20b59..900e103 100644 --- a/wip-duuqnd/instruction.lisp +++ b/wip-duuqnd/instruction.lisp @@ -13,6 +13,11 @@ (defclass immediate-mixin () ()) (defclass implied-mixin () ()) (defclass zero-page-mixin () ()) + +(defmethod shared-initialize :after ((instance zero-page-mixin) slot-names &rest initargs &key &allow-other-keys) + (declare (ignore slot-names initargs)) + (assert (< (operand instance) #x100))) + (defclass zero-page-x-mixin (zero-page-mixin) ()) (defclass absolute-mixin () ()) (defclass absolute-x-mixin (absolute-mixin) ())