Assembly language programming is referred to low-level programming because each assembly language instruction performs a much lower-level task compared to an instruction in a high-level language. Assembly language instructions are processor specification dependents. For example, a program written in the Intel assembly language cannot be executed on the PowerPC processor.
Here are some IA-32 assembly language examples:
inc result
mov class_size, 45
and mask1, 128
add marks, 10
The first instruction increments the variable result. This assembly language instruction is equivalent to
result++;
in C. The second instruction initializes
class_size
to 45. The equivalent statement in C is
class_size = 45;
The third instruction performs the bitwise and operation on
mask1
and can be expressed in C as
mask1 = mask1 & 128;
The last instruction updates marks by adding 10. In C, this is equivalent to
marks = marks + 10;
We can translate the assembly language instructions to the equivalent machine language instructions. Machine language instructions are written in the hexadecimal number system. Here are some IA-32 machine language examples:
Assembly
|
Operation
|
Machine language (in hex)
|
nop
| No operation | 90 |
inc result
| Increment | FF060A00 |
mov class_size, 45
| Copy | C7060C002D00 |
and mask, 128
| Logical and | 80260E0080 |
add marks, 10
| Integer addition | 83060F000A |
References
- Guide to RISC Processors for Programmers and Engineers by Sivarama P. Dandamudi, Springer (2005), ISBN 0-387-21017-2.
3 comments:
Thanx this is very useful tip actually assembly language is kind of a language very difficult.
i have a blog ,subject is 89c51.i want some more information about 89c51 project.do you have.if yes just visit my blog and comment it anywhere in the blog
8051 micro controller is best approach for learning that what is micro controller and its architect.
What is 8051?
Post a Comment