Computer Languages
Assembly Language
Assembly language is low-level programming language used to interface with computer hardware. Assembly language is a symbolic representation of the machine code needed to program a given CPU architecture.
Assembly language is the most basic programming language available for any processor. With assembly language, a programmer works only with operations that are implemented directly on the physical CPU.
Advantage
Use of mnemonic codes: example “JMP” for a jump instruction to a new location
Transferable across machines
Assembly language can be executed on firmware or other processor
Assembly language can interact directly with the hardware
It can be optimised for speed.
Assembly language can execute with accurate timing.
Following is example of assembly language:
MOV AX, 47104
MOV DS, AX
MOV [3998], 36
INT 32
Disadvantages
No Symbolic names for memory locations.
Hard to read.
Code is still machine dependent.
Hard to maintain and debug.
Code must be heavily documented.
High level language
Advantage High-Level Languages
- Support a high level of abstraction: both operations and data
- Greater portable for a program.
- As long as there is a translator for the language on a particular computer architecture, the program can be used on that architecture.
- Data representation is hidden.
Programmer avoids dealing with details that are not part of his/her problem. - Generally easier to read than machine or assembly language.
- Programs are generally easier to maintain and modify.
Assembler:
An assembler is a program for converting instructions written in low-level symbolic code into machine code.
Assembler converts assembly language programs into object files. Object files contain a combination of machine instructions, data, and information needed to place instructions properly in memory. An assembler is a type of computer program that interprets software programs written in assembly language into machine language, code and instructions that can be executed by a computer.
Assemblers need to:
– translate assembly instructions and pseudo-instructions into machine instructions.
– Convert decimal numbers, etc. specified by programmer into binary.
