Lets start from pretty basic concepts:
Before setting out to learn assembly language you need to have an idea about number systems and their interconversion like HEX to BCD and all that.
Assembly is low level programming which deals with processor and its internal registers directly as you write instructions that manipulate these registers. A computer is made up of,
- A CPU where all computations are carried out generally called "Heart" of computer though "Brain" is more appropriate word.
- RAM is the memory where the program to be executed is stored.
- system bus is a mechanism which connects CPU, RAM and external devices with each other.
The general purpose registers for 8086 are
- AX : Accumulator register
- BX : Base register
- CX : Count register
- DX : Data register
eg: AX can be divided into AH AND AL
5. SP: Stack pointer
6. SI: Source index
7. DI: Destinations index
8. BP: Base pointer
As inter-processor registers are are much faster than any other form of memory care should be taken to optimize their usage in program. (more about this later)
Segment registers are
- CS : Code segment
- DS : Data segment
- ES : Extra segment
- SS : Stack segment
When used with general purpose registers they point at accessible locks of memory this concept is called segmentation and enables a greater memory access otherwise impossible.
eg. a physical memory location 10060h is represented as
1000 : 0060h
segment : offset called logical address
To calculate original address just multiply segment by 10h and add offset to it.
BX,SI,DI are used with DS
BP and SP with SS
Special purpose registers
- IP : instruction pointer
- Flag registers
Flag registers are used by the processor to indicate status or results after any operation.
Now with this i'll conclude this article and next one will start with real programming tutorials .
Keep visiting.
No comments :
Post a Comment