-1

Please anybody tell me about the assembly language and the use of it.

Votes + Comments
What is a spammer posting 1-line google queries? Only to promulgate their web-links signature of course!
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by marcosjp
0

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.

org 100h
    mov cx, 6; n Fibonacci elements
    mov ax, 0 
    mov bx, 1
    mov fib, bx
    dec cx
repeat:
    add fib, ax
    mov ax, bx
    mov bx, fib
    dec cx
    jz fim
    jmp repeat
end:
    ret
    fib dw 0
    end
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.