[comp.lang.c++] Testing the carry bit using Zortech's C++

c_uloth@vaxa.cc.uwa.oz.au (08/18/90)

Can anyone tell me how to test the carry bit on a PC386 using
Zortech's C++?

Thank's Chris
Department of Architecture
University of Western Austalia

"Is there life beyond the Darling Scarp?"

bright@Data-IO.COM (Walter Bright) (08/21/90)

In article <1990Aug18.145135.2074@vaxa.cc.uwa.oz.au> c_uloth@vaxa.cc.uwa.oz.au writes:
<Can anyone tell me how to test the carry bit on a PC386 using Zortech's C++?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Function to determine if carry is set.
;	extern int _cdecl iscarryset();
; Returns:
;	!=0	carry is set
;	0	carry is clear

include macros.asm

	begcode	iscarryset
	c_public iscarryset
func	iscarryset
	sbb	AX,AX
	ret
c_endp	iscarryset
	endcode iscarryset
	end