Solved

How to embed assembly code into C++ code running on Linux (Red Har 2.4.xx)?

Posted on 2004-09-10
4
200 Views
Last Modified: 2010-04-22
Hi,

I need to embed some assembly code into C++ code running on Linux. The CPU is i686 (Intel Xeon CPU).
Do you know how to do it, please help.

Thanks,

Rfr1tz

0
Comment
Question by:rfr1tz
4 Comments
 
LVL 23

Accepted Solution

by:
Mysidia earned 125 total points
ID: 12032074
0
 
LVL 8

Assisted Solution

by:manish_regmi
manish_regmi earned 125 total points
ID: 12037318
hi,
 It can be easily done by asm(); keyword.

 you can put it anywhere in the C++ code.
It has a format.
asm(
   "assembly codes"
   : output regs
   : input regs
   : clobbers
);

or simply
asm(" sti ");

See brenan's page. You will have a good start on inline assembly.
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html


regards manish
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now