943,735 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 1067
  • Assembly RSS
Jun 30th, 2008
-1

What is the assembly language?

Expand Post »
Please anybody tell me about the assembly language and the use of it.
Similar Threads
Reputation Points: 38
Solved Threads: 0
Light Poster
allena is offline Offline
32 posts
since Jun 2008
Jun 30th, 2008
0

Re: What is the assembly language?

Assembly is the closer you can get to the computer hardware with a programming language.
Instead of using IFs, WHILEs, etc., you will move values to registers and memory locations by hand.

If you write a program in C (or C++, Java, Python, etc) you will be able to compile the same code (with some minor changes) on any computer and Operating System. But you won't be able to do the same with Assembly, as it is platform and OS dependent.

You will use Assembly to write hardware drivers or to perform tasks that would take a lot longer using higher level languages.
High performance dependent software (such as games) may use some routines written in ASM to make things faster. You can call an ASM routine from higher level languages.

Just as an example, here goes a small program in Assembly 8086.
This code calculates 6 elements of the Fibonacci numbers.

assembly Syntax (Toggle Plain Text)
  1. org 100h
  2. mov cx, 6; n Fibonacci elements
  3. mov ax, 0
  4. mov bx, 1
  5. mov fib, bx
  6. dec cx
  7. repeat:
  8. add fib, ax
  9. mov ax, bx
  10. mov bx, fib
  11. dec cx
  12. jz fim
  13. jmp repeat
  14. end:
  15. ret
  16. fib dw 0
  17. end
Reputation Points: 10
Solved Threads: 0
Light Poster
marcosjp is offline Offline
42 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Difference between Macro and Procedure
Next Thread in Assembly Forum Timeline: Basic Program Help - file input





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC