Solved

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

Posted on 2004-09-10
4
197 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
Comment Utility
0
 
LVL 8

Assisted Solution

by:manish_regmi
manish_regmi earned 125 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

16 Experts available now in Live!

Get 1:1 Help Now