| delorie.com/archives/browse.cgi | search |
| From: | "Matt" <para AT tampabay DOT rr DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| References: | <Pine DOT SUN DOT 3 DOT 91 DOT 1010702091418 DOT 3012G-100000 AT is> <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: | <Ekx07.85775$WB1.23431220@typhoon.tampabay.rr.com> |
| 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." <xos AT o2 DOT pl> wrote in message news:9htlpv$o5t$1 AT news DOT tpi DOT pl...
>
> Uzytkownik "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> 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).
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |