Documente Academic
Documente Profesional
Documente Cultură
Assembly language
Assembler
MOV AX,5000H ; Initialize DATA SEGMENT MOV DS,AX ; to 5000H MOV AX,[1000H] ; take lower 16-bit of NUM1 in AX MOV BX,[2000H] ; take lower 16-bit of NUM2 in BX ADD AX,BX ; AX = AX + BX MOV [3000H],AX ; Store lower 16-bit result at NUM3 MOV AX,[1002H] ; take higher 16-bit of NUM1 in AX MOV BX,[2002H] ; take higher 16-bit of NUM2 in BX ADC AX,BX ; AX = AX + BX + CF (add with carry) MOV [3002H],AX ; Store higher 16-bit result at NUM3 HLT ; Halt 8086
A program which converts assembly language into machine code. This is a 8086 Assembly Language Program to add two 32-bit signed & unsigned number.
Assembly language are architecture dependent and have different set of instruction for different architecture
Compiler
/* addition of 2 nos in c*/ #include<stdio.h> void main() { int i,j,k; puts(please enter two nos); scanf(%d%d,&i,&j); k=i+j; printf(sum=%d,k); } A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language . A program that translates from a low level language to a higher level one is a decompiler. A program that translates between high-level languages is usually called a language translator, source to source translator, or language converter.
Interpreter
An interpreter converts high level language into machine level language like a compiler but A compiler converts whole source coded into machine language and then executes where as an interpreter does this line by line. A compiler compiles only once and then the file can be executed any number of times where as interpreter does these conversion again and again.