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

What is a pragma?
In computer programming, a directive pragma is a language construct that specifies how a compiler should process its input. The ' #pragma ' directive is the method specified by the C standard for providing...
Anil
Why c++ introduced reference variable?
C++ references allow you to create a second name for the a variable that you can use to read or modify the original data stored in that variable.
Sunita

What are the two techniques of Machine Learning?

There are three main techniques: 1) Supervised learning 2) Unsupervised learning 3) Reinforcement learning
Janvi
Explain about member functions?
Member functions are part of the class, member functions are used to access, member variable in private, protected, public area and also call another member functions.
Zeeshan
0 0
5
What are the restriction in making a inline function?
Inline function is the optimization technique used by the compilers. One can simply prepend inline keyword to function prototype to make a function inline. Inline function instruct compiler to insert complete...
Keshav

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

Ask a Question

Related Lessons

Hi,
To learn online is really convenient for both the sides but still trust is risk factor until and unless you don't know the teaching style of your tutor.so I will give you small free session to decide my...

How to Create A Master Page Template In PHP?
A master page template is essential to give a consistent look and feel to any website having multiple pages. It is quite easy to create a master page template in PHP using Dreamweaver. Let’s have...

Write your first Python program in 10 minutes
1. Download python from python official site search "python download" in google 2. Install in your machine 3. verify using : "python --version" command 4. Write first program using notepad create...

Turbo C++ Keyboard Shortcuts
S.No. Shortcuts keys Action 1. F1 For Help 2. F2 Save 3. F3 Open 4. F4 Go to cursor 5. F5 Zoom 6. F6 Next 7. F7 Trace...

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

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