Article View: borland.public.cppbuilder.language.basm
Article #27Re: ASM conversion from Delphi to C++Builder
From: Ed Mulroy [TeamB]
Date: Mon, 23 Jul 2007 17:19
Date: Mon, 23 Jul 2007 17:19
33 lines
2011 bytes
2011 bytes
>>Better to use >>__declspec(naked) >>and write every byte of the assembly code yourself. > > Oooh, sexy...I like it. Be careful when using it. It truely is naked. When the function ends there isn't even a RET or RETN statement - you must add that yourself. . Ed > Bob Gonder wrote in message > news:rkl9a39ctqn0ims2tejfb8scko90vemda0@4ax.com... > >>> I would also be tempted to turn off stack frames for this function. > >> In that case you would be jumping out of a plane without your >> parachute. > > It's small enough, and no local variables, so no problems. > Feathers don't need parachutes. > >>Better to use >>__declspec(naked) >>and write every byte of the assembly code yourself. > > Oooh, sexy...I like it. > > That's what I intended to mean. > I was thinking a local pragma, but this does the job. > > __declspec(naked) > void __fastcall GetCPUID(unsigned int cmd, TRegisters & regs)
Technical Details
Message-ID:
<46a4e30d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<46a047d3$1@newsgroups.borland.com> <46a3542c$1@newsgroups.borland.com> <37l6a3dnmrn3m9blstu4dqvmmjah97nbif@4ax.com> <46a4ab6c$1@newsgroups.borland.com> <rkl9a39ctqn0ims2tejfb8scko90vemda0@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 107b11,b95ef5f9173e844a X-Google-Attributes: gid107b11,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.language.basm References: <46a047d3$1@newsgroups.borland.com> <46a3542c$1@newsgroups.borland.com> <37l6a3dnmrn3m9blstu4dqvmmjah97nbif@4ax.com> <46a4ab6c$1@newsgroups.borland.com> <rkl9a39ctqn0ims2tejfb8scko90vemda0@4ax.com> Subject: Re: ASM conversion from Delphi to C++Builder Date: Mon, 23 Jul 2007 13:19:06 -0400 Lines: 35 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 69.142.254.168 Message-ID: <46a4e30d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1185211149 69.142.254.168 (23 Jul 2007 10:19:09 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail