Computer Organization & Assembly Language Programming
Computer Organization & Assembly Language Programming
Language Programming
Lecture-3
Introduction to Assembly Language
Basic Computer Organization
iAPX 88 Registers (16-bit)
• IBM PC based on Intel architecture because of free assemblers
and debuggers available for it.
• iAPX88 stands for “Intel Advanced Processor Extensions 88.”
It was a very successful processor also called 8088 and was
used in the very first IBM PC machines.
• we will use iAPX386 which is very advanced and powerful
processor. 8088 is a 16bit processor with its accumulator and
all registers of 16 bits. 386 on the other hand, is a
32bitprocessor. However, it is downward compatible with
iAPX88 .
Basic Computer Organization
HISTORY
•Intel did release some 4bit processors in the beginning but the first
meaningful processor was 8080, an 8bit processor.
•Advanced version was released as 8085.The processor became
widely popular in the engineering community again due to its simple
and logical nature.
•Intel introduced the first 16bit processor named 8088 at a time when
the concept of personal computer was evolving. With a maximum
memory of 64Kon the 8085, the 8088 allowed a whole mega byte.
•IBM embedded this processor in their personal computer. The first
machines ran at 4.43 MHz; a blazing speed at that time
iAPX 88 Registers (16-bit)
General Purpose
AX
BX
CX
DX
X in their names stand for extended meaning 16bit registers.
For example, AX means we are referring to the extended
16bit “A” register
iAPX 88 Registers (16-bit)
General Purpose
16-bit
AX
AH AL
8-bit 8-bit
General Purpose
16-bit
BX
BH BL
8-bit 8-bit
iAPX 88 Registers (16-bit)
General Purpose
AX A Accumulator Register
BX B Base Register
CX C Counter Register
DX D Destination Register
• BX stands for Base because of its role in memory addressing.
• C of CX stands for Counters there are certain instructions that work with an
automatic count in the register.
• The D of DX stands for Destination as it acts as the destination in I/O operations.
iAPX 88 Registers (16-bit)
SI
DI
• These are the index registers of the Intel architecture which hold
address of data and used in memory access.
• Intel allows many mathematical and logical operations on these
registers as well like the general registers.
• SI and DI are 16bit and cannot be used as8bit register pairs like
AX, BX, CX, and DX.
iAPX 88 Registers (16-bit)
Flag Register
- - - - O D I T S Z - A - P - C
Program Counter
Instruction Pointer
Function:
Address of next instruction to be executed
• This is the special register containing the address of the next
instruction to be executed.
• No mathematics or memory access can be done through this
register. It is out of our direct control and is automatically used.
Playing with it is dangerous and needs special care. Program
control instructions change the IP register.
iAPX 88 Registers (16-bit)
Segment
General Purpose
AX AH,AL
BX BH,BL
CX CH,CL
DX DH,DL
A Simple Program
NASM
ALINK
Debugger
AFD
mov ax,5
mov bx,10
Add ax,bx
Mov bx,15
Add ax,bx
Mov ax,0x4c00
Int 0x21
EX01.LST
Word Representation
4 Byte Word
MSB LSB
Representation in Memory
Representation 1
Little Endian Notation MSB LSB
0 1 2 3
Representation 2
Big Endian Notation LSB MSB
0 1 2 3