What is the assembly language?

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2008
Posts: 32
Reputation: allena is an unknown quantity at this point 
Solved Threads: 0
allena allena is offline Offline
Light Poster

What is the assembly language?

 
-1
  #1
Jun 30th, 2008
Please anybody tell me about the assembly language and the use of it.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 42
Reputation: marcosjp is an unknown quantity at this point 
Solved Threads: 0
marcosjp marcosjp is offline Offline
Light Poster

Re: What is the assembly language?

 
0
  #2
Jun 30th, 2008
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.

  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC