Solved

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

Posted on 2004-09-10
4
202 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 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