From: clc5q AT cobra DOT cs DOT Virginia DOT EDU (Clark L. Coleman) Newsgroups: comp.os.msdos.djgpp Subject: Re: Some assembly questions Date: 18 Mar 1999 16:40:10 GMT Organization: University of Virginia Lines: 22 Message-ID: <7cra9a$ui$1@murdoch.acc.Virginia.EDU> References: <199903170746 DOT IAA06061 AT login-2 DOT eunet DOT no> <7cq156$q5$2 AT news DOT luth DOT se> NNTP-Posting-Host: cobra.cs.virginia.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In article <7cq156$q5$2 AT news DOT luth DOT se>, Martin Str|mberg wrote: >Gisle Vanem (gvanem AT eunet DOT no) wrote: >: ams AT ludd DOT luth DOT se (Martin Str|mberg) said: >: >: > How do I set or clear the carry flag? I _think_ "andl %%eax, %%eax" >: > clears it (and "orl %%eax, %%eax" too). >: >: How about "setc" and "clc" ? > >Hmm. I get "operands given don't match any known 386 instruction". > >What is setc called in gas assembly? > >And yes, I _am_ an assembly neophyte. Your were given a bad mnemonic: "setc" is actually "stc". asm volatile("clc"); /* clears (sets to 0) the carry flag */ asm volatile("cmc"); /* complements (inverts) the carry flag */ asm volatile("stc"); /* sets (to 1) the carry flag */