Customer Service Chat
Get quote & make Payment
learn,how to mix C and Assembly Language ?, Basic Computer Science
The technique to mix C and assembly language is to apply the "asm" directive. To access C-language variables from assembly language, you just use the C identifier that name is a memory operand. These variables cannot be local to a procedure, and also cannot be static within a procedure. They have to be global (but can be static global). The newline characters are essential.
unsigned long a1, r;
void junk( void )
"pushl %eax \n"
"pushl %ebx \n"
"movl $100,%eax \n"
"movl a1,%ebx \n"
"int $59 \n"
"movl %eax,r \n"
"popl %ebx \n"
"popl %eax \n"
This instance does the following:
1. Pushes the value stored in %eax and %ebx onto the stack.
2. Puts a value of 100 into %eax.
3. Copies the value in global variable a1 into %ebx.
4. Executes a software interrupt number 59.
5. Copies the value in %eax into the global variable r.
6. Restores (pops) the contents of the temporary registers %eax and %ebx.
Posted Date: 5/4/2012 8:26:11 AM | Location : United States
Ask an Expert
learn,how to mix C and Assembly Language ?, Assignment Help, Ask Question on learn,how to mix C and Assembly Language ?, Get Answer, Expert's Help, learn,how to mix C and Assembly Language ? Discussions
Write discussion on learn,how to mix C and Assembly Language ?
Your posts are moderated
Write your message here..
Open systems interconnection, Open Systems Interconnection (OS1): As t...
Open Systems Interconnection (OS1): As there are many different protocols for LANs and WANs, communication between two different systems can be difficult. The International St
What is the intent of the singleton pattern, QUESTION Consider a Univer...
QUESTION Consider a University system which has several sub systems: Student Registration Module Registration Time Tabling Library System Human Resource Manag
Discuss about the descriptor classes, Question 1 List down any six feature...
Question 1 List down any six features of a Smartphone Question 2 Give a brief note on a) Internal Flash Disk. b) Use of C++ in Symbian OS Question 3 What are the naming
Packet switching, Packet Switching: This is one of recent techniques o...
Packet Switching: This is one of recent techniques of switching. Packet switching was originally developed for use by ARPA network by the Defence Department of US. According t
Computer organisation, The key characteristics of DRAM?
The key characteristics of DRAM?
How to assign Values to Variables in python?, ython variables do not compri...
ython variables do not comprise to be explicitly declared to already reserve memory space. The declaration occurs automatically when you allocate a value to a variable. The equal s
Flowchart, create a flowchart showing average score for the 3 quizzes assum...
create a flowchart showing average score for the 3 quizzes assume that there are 3 sections each having 5 students the only valid number to be entered is 1-100 for the quizzes shou
RMO CSMS marketing subsystem, I need to write a narrative n overview of the...
I need to write a narrative n overview of the diagram and an analysis of the actors
Idk, A rock weighs 33.6 N on Planet X and 49 N on Earth. What is g on Plane...
A rock weighs 33.6 N on Planet X and 49 N on Earth. What is g on Planet X
An e-mail account, An E-Mail Account: Inbox: Inbox is the main folder ...
An E-Mail Account: Inbox: Inbox is the main folder in your email account. It contains all the e-mails that have arrived in your e-mail account. You can click on inbox to see t
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
Why Us ?
~24x7 hrs Support
~Quality of Work
~Time on Delivery
~Privacy of Work
Human Resource Management
Literature Review Writing Help
Follow Us |
T & C
Copyright by ExpertsMind IT Educational Pvt. Ltd.