[movitz-cvs] CVS update: movitz/losp/muerte/cpu-id.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Wed Jun 2 23:49:27 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv5396

Modified Files:
	cpu-id.lisp 
Log Message:
Added decode-eflags.

Date: Wed Jun  2 16:49:27 2004
Author: ffjeld

Index: movitz/losp/muerte/cpu-id.lisp
diff -u movitz/losp/muerte/cpu-id.lisp:1.4 movitz/losp/muerte/cpu-id.lisp:1.5
--- movitz/losp/muerte/cpu-id.lisp:1.4	Fri Apr 23 06:00:17 2004
+++ movitz/losp/muerte/cpu-id.lisp	Wed Jun  2 16:49:27 2004
@@ -10,7 +10,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Created at:    Mon Apr 15 22:47:13 2002
 ;;;;                
-;;;; $Id: cpu-id.lisp,v 1.4 2004/04/23 13:00:17 ffjeld Exp $
+;;;; $Id: cpu-id.lisp,v 1.5 2004/06/02 23:49:27 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -262,6 +262,16 @@
 
 (defun eflags ()
   (eflags))
+
+(defconstant +eflags-map+
+    '(:cf nil :pf nil :af nil :zf :sf
+      :tf :if :df :of :iopl0 :iopl1 :nt nil
+      :rf :vm :ac :vif :vip :id))
+
+(defun decode-eflags (&optional (eflags (eflags)))
+  (loop for flag in +eflags-map+ as bit upfrom 0
+      when (and flag (logbitp bit eflags))
+      collect flag))
 
 (define-compiler-macro (setf eflags) (value)
   `(with-inline-assembly (:returns :register)





More information about the Movitz-cvs mailing list