# HG changeset patch # User Steve Losh # Date 1459462673 0 # Node ID bbbc9030a316dfc5834262ac8ce1ebd3f663b663 # Parent 8a18f9b3bb72dab062f0393aef269f26b60963bf Improve the code dumping function diff -r 8a18f9b3bb72 -r bbbc9030a316 src/wam/dump.lisp --- a/src/wam/dump.lisp Wed Mar 30 13:44:34 2016 +0000 +++ b/src/wam/dump.lisp Thu Mar 31 22:17:53 2016 +0000 @@ -52,15 +52,14 @@ (opcode-short-name (aref instruction 0)) (rest (coerce instruction 'list)))) -(defun dump-code (wam) - (let ((code (wam-code wam))) - (format t "CODE~%") - (let ((addr 0)) - (while (< addr (length code)) - (format t "; ~4,'0X: " addr) - (let ((instruction (wam-code-instruction wam addr))) - (format t "~A~%" (instruction-aesthetic instruction)) - (incf addr (length instruction))))))) +(defun dump-code (wam &optional (from 0) (to (length (wam-code wam)))) + (format t "CODE~%") + (let ((addr from)) + (while (< addr to) + (format t "; ~4,'0X: " addr) + (let ((instruction (wam-code-instruction wam addr))) + (format t "~A~%" (instruction-aesthetic instruction)) + (incf addr (length instruction)))))) (defun dump-wam-registers (wam)