Functions to print some components of the x86 state, either
to file (
Function:
(defun print-component (base num) (declare (xargs :guard (and (member-equal base '(10 16)) (natp num)))) (case base (10 (str::nat-to-dec-string num)) (t (str::cat "#x" (str::nat-to-hex-string num)))))
Function:
(defun printing-x86-to-string (base x86) (declare (xargs :stobjs (x86)) (ignorable base x86)) "")
Function:
(defun printing-x86-components (base x86 state) (declare (xargs :stobjs (x86 state)) (ignorable base x86 state)) state)
Function:
(defun printing-x86-to-terminal (base x86 state) (declare (xargs :stobjs (x86 state))) (b* ((str (printing-x86-to-string base x86)) (state (fms str nil *standard-co* state nil))) (value :invisible)))
Function:
(defun printing-flgs (x86 state) (declare (xargs :stobjs (x86 state))) (b* ((cf (flgi :cf x86)) (pf (flgi :pf x86)) (af (flgi :af x86)) (zf (flgi :zf x86)) (sf (flgi :sf x86)) (of (flgi :of x86)) ((mv ?col state) (fmt! "(@@FLGS . ~%~ ~tI((CF . ~s0)~%~ ~tI (PF . ~s1)~%~ ~tI (AF . ~s2)~%~ ~tI (ZF . ~s3)~%~ ~tI (SF . ~s4)~%~ ~tI (OF . ~s5))~%~ @@)~%~%" (list (cons #\0 cf) (cons #\1 pf) (cons #\2 af) (cons #\3 zf) (cons #\4 sf) (cons #\5 of) (cons #\I '8)) *standard-co* state nil))) (value :invisible)))
Function:
(defun printing-flg-val (eflags state) (declare (xargs :stobjs (state))) (b* ((cf (rflagsbits->cf eflags)) (pf (rflagsbits->pf eflags)) (af (rflagsbits->af eflags)) (zf (rflagsbits->zf eflags)) (sf (rflagsbits->sf eflags)) (of (rflagsbits->of eflags)) ((mv ?col state) (fmt! "(@@FLGS . ~%~ ~tI((CF . ~s0)~%~ ~tI (PF . ~s1)~%~ ~tI (AF . ~s2)~%~ ~tI (ZF . ~s3)~%~ ~tI (SF . ~s4)~%~ ~tI (OF . ~s5))~%~ @@)~%~%" (list (cons #\0 cf) (cons #\1 pf) (cons #\2 af) (cons #\3 zf) (cons #\4 sf) (cons #\5 of) (cons #\I '8)) *standard-co* state nil))) (value :invisible)))