Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!csd4.milw.wisc.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: iAPX86 code for ABS (using Microsof Message-ID: <225800188@uxe.cso.uiuc.edu> Date: 19 Jun 89 12:30:00 GMT References: <1202@draken.nada.kth.se> Lines: 27 Nf-ID: #R:draken.nada.kth.se:1202:uxe.cso.uiuc.edu:225800188:000:759 Nf-From: uxe.cso.uiuc.edu!mcdonald Jun 19 07:30:00 1989 >I remember a review of Microsoft's C compiler for MS-DOS that stated it >produced no-conditional-jump-abs-code. The function to convert an integer >to a positive integer was performed without a conditional jump (i.e. JS or >something). I'm very interested in this piece of code, so if someone >who does have a Microsoft C-compiler could try something like > main() > { int a,b; > a=-10; > b=abs(a); > } Here is the result of cl -c -Ox -Fa test.c, excluding the header and trailer: ; a = -10 mov WORD PTR [bp-2],-10 ;a ; b = abs(a) mov ax,-10 cwd xor ax,dx sub ax,dx mov WORD PTR [bp-4],ax ;b So your review was correct! I assume that they do this odd thing in order to not empty instruction prefetch queues???????????????? Doug McDonald