Sunday, 16 April 2017

Assembly language introduction

A Microprocessor is a chip, which has an ALU (Arithmetic and Logical Unit), CU (Control Unit) and few Registers. There are various microprocessors available in market e.g. 8085, 8085, 80286, Intel Pentium-1, Pentium-2, i3, i5 etc. Assembly Language is used to write programs for these micro processors.

The very basic microprocessor to learn assembly language is 8086, which is a 16-bit microprocessor i.e. it can process 16-bits at a time. Apart from ALU and CU it has a group of registers which is known as register set. 8086 microprocessor has several registers, few of which are accessible to coder i.e. a coder can modify their value according to his/her need,  and few registers are inaccessible to coder i.e. coder can not manipulate their values. Graphical representation of the register set of 8086 microprocessor is as follows.

Register Set of 8086 Microprocessor:

Main Registers:

AH AL AX Register (Primary Accumulator)
BH BL BX Register (Base Address Register)
CH CL CX Register (Counter Register)
DH DL DX Register(Data Register)
AX,BX,CS,DX are 16-bit registers, which can be divided into two parts e.g. AX register can be divided into two parts i.e. Ah and AL, it means AH= Higher byte of AX register and AL=lower byte of AX register

Index Registers

SI

Source Index
DI

Destination Index
BP

Base Pointer
SP

Stack Pointer
The Main Registers and Index Registers are general purpose registers

Segment Register:

CS

Code Segment
DS

Data Segment
ES

Extra Segment
SS

Stack Segment
IP :  Instruction Pointer

Flag : Flag Register

– – – – O D I T S Z – A – P – C
Assembly language is a low level language, which is used to write instructions to perform some action. The instruction in assembly language is called mnemonic code. Every executable instruction is defined by this mnemonic code. Three are various assemblers available to write assembly programs, few of them are TASM (Turbo Assembler) MASM (Microsoft Assembler), emu8086 (8086 Emulator) etc.

Microsoft Windows provide a tool (DEBUG) which can also be used to write assembly instruction, It is an built-in tool for window. To invoke the DEBUG we need

No comments:

Post a Comment