UrbanPro

Learn Programming Languages from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

how to write assembly language programs in c++? what is use of asm ?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Java with web technologies tutor

in simple advanced PHP contains object oriented concepts like inheritance,abstraction, and encapsulation,polymarphisim, and in general uses of classes , interface and abstract etc concepts come in to the picture,for implementing complex projects in PHP we have somany frame works ex: ZEND frame work...
read more
in simple advanced PHP contains object oriented concepts like inheritance,abstraction, and encapsulation,polymarphisim, and in general uses of classes , interface and abstract etc concepts come in to the picture,for implementing complex projects in PHP we have somany frame works ex: ZEND frame work and codeignitor, kohana MVC frame works and ,Drupal(CMS) . read less
Comments

Software Professional Trainer with 26+ years of Experience in Software Design and Development

asm is KEYWORD used to write assembly code inside C or C++ code. Use __asm key for Microsoft Compiler Use __asm__ key for GCC Compiler Microsoft Inline Assembly: The assembly code is wrapped in curly braces The destination register is on the *left*, just like yasm. int...
read more
asm is KEYWORD used to write assembly code inside C or C++ code. Use __asm key for Microsoft Compiler Use __asm__ key for GCC Compiler Microsoft Inline Assembly: The assembly code is wrapped in curly braces The destination register is on the *left*, just like yasm. int func() { __asm{ mov eax,25 ret }; } GCC Inline Assembly The assembly code is wrapped in parenthesis. The assembly code shows up as a string int func(void) { __asm__( " mov $25,%eax\n" " leave\n" " ret\n" ); } read less
Comments

Assembly language appears in two flavors: Intel Style & AT&T style. GNU C compiler i.e. GCC uses AT&T syntax and this is what we would use. Let us look at some of the major differences of this style as against the Intel Style. Register Naming: Register names are prefixed with %, so that registers...
read more
Assembly language appears in two flavors: Intel Style & AT&T style. GNU C compiler i.e. GCC uses AT&T syntax and this is what we would use. Let us look at some of the major differences of this style as against the Intel Style. Register Naming: Register names are prefixed with %, so that registers are %eax, %cl etc, instead of just eax, cl. Ordering of operands: Unlike Intel convention (first operand is destination), the order of operands is source(s) first, and destination last. For example, Intel syntax "mov eax, edx" will look like "mov %edx, %eax" in AT&T assembly. Operand Size: In AT&T syntax, the size of memory operands is determined from the last character of the op-code name. The suffix is b for (8-bit) byte, w for (16-bit) word, and l for (32-bit) long. For example, the correct syntax for the above instruction would have been "movl %edx, %eax". Immediate Operand: Immediate operands are marked with a $ prefix, as in "addl $5, %eax", which means add immediate long value 5 to register %eax). Memory Operands: Missing operand prefix indicates it is a memory-address; hence "movl $bar, %ebx" puts the address of variable bar into register %ebx, but "movl bar, %ebx" puts the contents of variable bar into register %ebx. Indexing: Indexing or indirection is done by enclosing the index register or indirection memory cell address in parentheses. For example, "movl 8(%ebp), %eax" (moves the contents at offset 8 from the cell pointed to by %ebp into register %eax). read less
Comments

c,c++,vb,vb.net,php.joomal,basic,all computer subjects

Generally the inline term is used to instruct the compiler to insert the code of a function into the code of its caller at the point where the actual call is made. Such functions are called "inline functions". The benefit of inlining is that it reduces function-call overhead. Now, it's easier to guess...
read more
Generally the inline term is used to instruct the compiler to insert the code of a function into the code of its caller at the point where the actual call is made. Such functions are called "inline functions". The benefit of inlining is that it reduces function-call overhead. Now, it's easier to guess about inline assembly. It is just a set of assembly instructions written as inline functions. Inline assembly is used for speed, and you ought to believe me that it is frequently used in system programming. We can mix the assembly statements within C/C++ programs using keyword asm. Inline assembly is important because of its ability to operate and make its output visible on C/C++ variables. Assembly language appears in two flavors: Intel Style & AT&T style. GNU C compiler i.e. GCC uses AT&T syntax and this is what we would use. Let us look at some of the major differences of this style as against the Intel Style. If you are wondering how you can use GCC on Windows, you can just download Cygwin from www.cygwin.com. Register Naming: Register names are prefixed with %, so that registers are %eax, %cl etc, instead of just eax, cl. Ordering of operands: Unlike Intel convention (first operand is destination), the order of operands is source(s) first, and destination last. For example, Intel syntax "mov eax, edx" will look like "mov %edx, %eax" in AT&T assembly. Operand Size: In AT&T syntax, the size of memory operands is determined from the last character of the op-code name. The suffix is b for (8-bit) byte, w for (16-bit) word, and l for (32-bit) long. For example, the correct syntax for the above instruction would have been "movl %edx, %eax". Immediate Operand: Immediate operands are marked with a $ prefix, as in "addl $5, %eax", which means add immediate long value 5 to register %eax). Memory Operands: Missing operand prefix indicates it is a memory-address; hence "movl $bar, %ebx" puts the address of variable bar into register %ebx, but "movl bar, %ebx" puts the contents of variable bar into register %ebx. Indexing: Indexing or indirection is done by enclosing the index register or indirection memory cell address in parentheses. For example, "movl 8(%ebp), %eax" (moves the contents at offset 8 from the cell pointed to by %ebp into register %eax). read less
Comments

Coaching

The __asm keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at the very least, an empty pair of braces. The term "__asm block" here refers to any instruction or group...
read more
The __asm keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at the very least, an empty pair of braces. The term "__asm block" here refers to any instruction or group of instructions, whether or not in braces. example: __asm { mov al, 2 mov dx, 0xD007 out dx, al } read less
Comments

Trainer

Nice Questions , Assemble language or coding are use to interface with processors , You can say direct command , C or C++ is just another layer who offer user friendly commands who invoke action and transfer asm to machine level language .Asm Language is Processor language who use memory management...
read more
Nice Questions , Assemble language or coding are use to interface with processors , You can say direct command , C or C++ is just another layer who offer user friendly commands who invoke action and transfer asm to machine level language .Asm Language is Processor language who use memory management operation mostly , keywords are like PUSH-POP etc .MAchine just understand "0" and "1" i.e machine level language . *.a(lib) ,*.o(object) are input for Linker , Linker offer -*.lib,*.dll.*.exe,*.out files which is the input for Loader ,Loader relocate Memory For Task. For More Information please click on following links for better understanding.. http://www.bogotobogo.com/cplusplus/assembly.php read less
Comments

View 4 more Answers

Related Questions

In Java programming, what are the differences between the functions of 'int' and 'int []' when working with an array?
The may appear as part of the type at the beginning of the declaration, or as part of the declarator for a particular variable but But int a keeps type information together and is more verbose so I prefer it.
Kalpana
0 0
5
Which Internet companies use Python?
Many major internet companies use Python due to its versatility and ease of use. Some prominent examples include: 1. **Google**: Uses Python for various internal and external applications.2. **Facebook**:...
Ankur
0 0
5
How can you be sure that a program follows the ANSI C standard?
The ANSI C standard provides a predefined symbol named __STDC__ that is set to 1 when the compiler is enforcing strict ANSI standard conformance. If you want your programs to be 100 percent ANSI conformant,...
Vibha
Can the last case of a switch statement skip including the break?
Last case if a switch should be DEFAULT.. Good to have this case always. Executed only when there's no other matching cases found.
Sanjeev

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Datetime Module
#this examples demonstrate use of datetime module import datetimeob=datetime.datetime.now()print("-"*25)print(ob)print(ob.year)print(ob.month)print(ob.day)print(ob.hour)print(ob.minute)print(ob.second)str1=str(ob.hour)+':'+str(ob.minute)+':'+str(ob.second)print...

Learning a new technology
Each and every day new technologies are getting introduced. Its quite clear that to be part of the fast moving professional world you should be upto date with the cutting edge technologies in the market....
S

Saurav Singh

1 0
0

Do You Know How Is Size Of Structure Defined?
Size of the structure is defined based on multiplies of bigger data type member in the structure. Example: If a structure contains integer, char, short data type, then size of the Structure will be multiples...

C #-Program Sample Application
//using system namespace using System; //Namespace declaration namespace first{ //Class declaration class helloworld { //Main method public static void Main() { //Statement to print output on console...
S

Why Python
Python can be used in any futuristics technology A= Analytics Data Science Artificial Intelligence(AI) Neural Network(NN) Natural Language Processing(NLP) Computer Vision(OpenCV) In Analytics...

Recommended Articles

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Looking for Programming Languages Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Programming Languages Classes?

The best tutors for Programming Languages Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Programming Languages with the Best Tutors

The best Tutors for Programming Languages Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more