Replace unused code in code generation with assert

This commit is contained in:
John Lorentzson 2025-07-21 21:13:42 +02:00
parent 2331d15e11
commit e717f49afc

View file

@ -311,13 +311,8 @@ is the responsibility of the pre-assembly compilation step."
:when (typep asm-obj 'asm-instruction)
:do (case (opcode asm-obj)
((#x10 #x30 #x50 #x70 #x90 #xb0 #xd0 #xf0)
;; Relative branches
(when (typep (operand asm-obj) 'iblock)
(resolve-iblock asm-obj))
;; - 2 is to offset for the branch instruction's length
(unless (typep (operand asm-obj) '(unsigned-byte 8))
(let* ((offset (- (address (operand asm-obj)) (address asm-obj) 2)))
(setf (operand asm-obj) (ldb (byte 8 0) (the (signed-byte 8) offset))))))
;; Relative branches are all generated with hardcoded offsets
(assert (typep (operand asm-obj) '(unsigned-byte 8))))
(t
(when (typep (operand asm-obj) 'iblock)
(resolve-iblock asm-obj))