From: "Matt" Newsgroups: comp.os.msdos.djgpp References: <9htlpv$o5t$1 AT news DOT tpi DOT pl> Subject: Re: Accessing registers from C Lines: 29 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Wed, 04 Jul 2001 04:55:00 GMT NNTP-Posting-Host: 65.32.103.94 X-Complaints-To: abuse AT rr DOT com X-Trace: typhoon.tampabay.rr.com 994222500 65.32.103.94 (Wed, 04 Jul 2001 00:55:00 EDT) NNTP-Posting-Date: Wed, 04 Jul 2001 00:55:00 EDT Organization: RoadRunner - TampaBay To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Jacek K." wrote in message news:9htlpv$o5t$1 AT news DOT tpi DOT pl... > > Uzytkownik "Eli Zaretskii" napisal w wiadomosci > news:Pine DOT SUN DOT 3 DOT 91 DOT 1010702091418 DOT 3012G-100000 AT is... > > > > On Sun, 1 Jul 2001, Jacek K. wrote: > > > > > Are there some instructions/macros to access CPU registers? > > > > Can you tell what do you need that for? DJGPP has several provisions > > in the library which normally make accessing the registers > > unnecessary. Section 17.8 of the FAQ gives a couple of examples. > > I need to call a procedure via call gate. Because arguments must be passed > "manualy", doing it by registers will be faster then by stack. > > Jacek If I'm not mistaken, you can do this by doing the following: void my_func(...) __attribute___((regparm(3))); // the function body void my_func(...) { } Requires no inline assembly, and it's easier (in my opinion).