Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
205 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

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…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

609 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