[syslinux:master] bitops: the bt instructions returns result in CF, not ZF

syslinux-bot for H. Peter Anvin hpa at zytor.com
Mon Apr 4 10:33:53 PDT 2011


Commit-ID:  af97187d32aa51d5109af813187b98081e7d7b2f
Gitweb:     http://syslinux.zytor.com/commit/af97187d32aa51d5109af813187b98081e7d7b2f
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 4 Apr 2011 09:58:44 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 4 Apr 2011 10:00:25 -0700

bitops: the bt instructions returns result in CF, not ZF

The bit test instructions returns the tested bit in CF, not the
inverse of the tested bit in ZF.  I don't know how I got that idea...

Reported-by: Matt Fleming <matt.fleming at intel.com>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 com32/include/sys/bitops.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/com32/include/sys/bitops.h b/com32/include/sys/bitops.h
index 06cf9f3..bfc09d7 100644
--- a/com32/include/sys/bitops.h
+++ b/com32/include/sys/bitops.h
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------- *
  *   
- *   Copyright 2010 Intel Corporation; author: H. Peter Anvin
+ *   Copyright 2010-2011 Intel Corporation; author: H. Peter Anvin
  *
  *   Permission is hereby granted, free of charge, to any person
  *   obtaining a copy of this software and associated documentation
@@ -49,7 +49,7 @@ static inline void clr_bit(long __bit, void *__bitmap)
 static inline int __purefunc test_bit(long __bit, const void *__bitmap)
 {
     unsigned char __r;
-    asm("btl %2,%1; setnz %0"
+    asm("btl %2,%1; setc %0"
 	: "=r" (__r)
 	: "m" (__bitmap), "Ir" (__bit));
     return __r;



More information about the Syslinux-commits mailing list