Add function to compute addresses of labels in instruction list

This commit is contained in:
John Lorentzson 2025-05-08 19:36:10 +02:00
parent 501da2341e
commit 37b2864a7d

View file

@ -96,6 +96,14 @@
'(branching-mixin)))
((%opcode :allocation :class :initform ,code)))))))
(defun fix-label-addresses-in-instruction-list (instruction-list origin)
(loop :with address := origin
:for obj :in instruction-list
:if (typep obj 'label)
:do (setf (address obj) address)
:else
:do (incf address (instruction-length obj))))
;;; Testing
(define-instruction "TXA" nil (:implied 0))