?
Solved

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

Posted on 2004-09-10
4
Medium Priority
?
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 23

Accepted Solution

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

Assisted Solution

by:manish_regmi
manish_regmi earned 500 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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

800 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