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..
Indexing and abstracting databases, Indexing and Abstracting Databases: ...
Indexing and Abstracting Databases: A study of growth of indexing and abstracting services over the years would show that during the past two centuries, these services have be
Python Numbers, Number data types store numeric values. They are an immutab...
Number data types store numeric values. They are an immutable data type, which means that changing the value of a number data type results in a newly allocated object. Number objec
Memory unit of computer, Memory unit of computer: The Memory unit is ...
Memory unit of computer: The Memory unit is an important component of a computer where all the data and information are stored in the form of binary digits (combination of 0
Printer output, Printer output : Consider what is required here. ...
Printer output : Consider what is required here. Do you just require management information on the one hand or camera copy for reprographic purposes? Inkjet Very quiet. C
Vector processor, tell me about vector processor
tell me about vector processor
Transfer instructions, They are utilized to move the contents of the operat...
They are utilized to move the contents of the operators. Each instruction can be used with many different modes of addressing. MOV MOVS (MOVSB) (MOVSW) MOV INSTRUCTION Principle: D
Probability, Mike sells on the average 15 newspapers per week (Monday – Fri...
Mike sells on the average 15 newspapers per week (Monday – Friday). Find the probability that 2.1 In a given week he will sell all the newspapers
Q1, Write a half-page summary explaining IP spoofing.
Write a half-page summary explaining IP spoofing.
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
The skill of Assembly Language, The skill of Assembly Language Programming ...
The skill of Assembly Language Programming (AoA), Randy Hyde''s acclaimed text on assembly language programming, is the most-frequently recommended book on 80x86 assembly language
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.