From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: info, FAQ not enough -> GCC and ASM Date: Tue, 11 Mar 1997 18:51:55 +0000 Organization: None Distribution: world Message-ID: <$0mMKSALnaJzEw5E@talula.demon.co.uk> References: <5g1hv1$qtb$1 AT thor DOT atcon DOT com> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 35 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp SteelGolem writes: >what i don't understand is how you put them in the registers >ax/bx/eax/etc.. is it possible to access the registers? (i know, i know, >its protected mode..) Look in "info gcc machine constraints machine", at the Intel 386 section. You have to realise that the info docs apply to gcc on any platform, so machine-specific registers like eax aren't included in the main body of the text. Briefly, the register-specific constraints are: a = eax b = ebx c = ecx d = edx S = esi D = edi >or at least, convert the following borland c function: I found the best way of learning the gcc asm syntax was to read as much example code as I could get my hands on: in particular the contents of include/sys/farptr.h are well worth taking a look at. If you are after a fixed point multiply routine, look at the fmul() function in allegro.h. It's a bit more complicated than your example because it checks for overflows, and it uses 16.16 format numbers rather than 24.8, but the same principles apply. /* * Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ * Beauty is a French phonetic corruption of a short cloth neck ornament. */