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..
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
Operating system., assignments of bca 1st yaer
assignments of bca 1st yaer
Give birth to new life forms, Give birth to new life forms A research ...
Give birth to new life forms A research of Artificial Life will definitely throw light on what it means for a complex application to be 'alive'. Moreover, ALife researchers th
Handling Text Files, I. Write an application that accomplishes the followin...
I. Write an application that accomplishes the following tasks: 1. Read a text file that contains, integers, doubles, alphabet, alphanumeric, and others. The name of the input fil
Computer science, You recently returned some homework I completed but i lef...
You recently returned some homework I completed but i left of the final 10 questions. Should not take long just needs some commands interpreted. How much will it cost for me to get
Open source software, Open Source Software: Open Source Software (OSS)...
Open Source Software: Open Source Software (OSS) is software that comes with source code, and importantly also provides rights (typically reserved for copyright holders) to st
Computer, what is the computer science
what is the computer science
Encoders, compare encoders and multiplers
compare encoders and multiplers
ICT IN BUSINESS, Explain how ICT can be used for achievement of each of the...
Explain how ICT can be used for achievement of each of the following business objectives, illustrating your answer with examples: 1. Customer intimacy 2. Low-cost leadership
Programs, creating programs in scheme
creating programs in scheme
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
Terms & Conditions
Copyright by ExpertsMind IT Educational Pvt. Ltd.