Compute addresses for all ASM-OBJECTs

This commit is contained in:
John Lorentzson 2025-07-03 16:56:49 +02:00
parent a24c5353a5
commit 771748d2c2

View file

@ -219,10 +219,9 @@
(let ((address origin-address)) (let ((address origin-address))
(loop :for asm-obj := start-instruction :then (next asm-obj) (loop :for asm-obj := start-instruction :then (next asm-obj)
:until (null asm-obj) :until (null asm-obj)
:do (cond ((typep asm-obj 'asm-label) :do (setf (address asm-obj) address)
(setf (address asm-obj) address)) :when (typep asm-obj 'asm-instruction)
((typep asm-obj 'asm-instruction) :do (incf address (byte-length asm-obj)))
(incf address (byte-length asm-obj)))))
(values start-instruction address))) (values start-instruction address)))
(defun link-assembly (start-instruction origin-address) (defun link-assembly (start-instruction origin-address)