II-i It MPMC Unit-1
II-i It MPMC Unit-1
Unit--1
Unit
MPMC
SYLLABUS
UNIT - I
Introduction to 8086: The 8086 Microprocessor family-overview; 8086
internal architecture: the execution unit, the BIU;
8086 Family Assembly Language Programming: Program development
steps, constructing the machine codes for 8086 instructions, writing
program for use with an assembler, assembly language program
development tools.
1
10/16/2024
Number System
Problems
• 22710 = Binary Value?
• (10110.11) = Decimal Value?
• 22710 = Hexa Decimal Value?
• Decimal Value for BCD Code 010100101001 ?
2
10/16/2024
Number System
Problems
• 22710 = (11100011)2
• (10110.11) = (22.75)10
• 22710 = (E3)16
• Decimal Value for BCD Code 0101 0010 1001 = 529
Logic Circuits
3
10/16/2024
Logic Circuits
Logic Circuits
4
10/16/2024
Logic Circuits
Logic Circuits
5
10/16/2024
Logic Circuits
Types of Computers
• Main Frame Computers
• Mini Computers
• Micro Computers
6
10/16/2024
Types of Computers-
Computers- Main Frame Computers
• Mainframe computers may fill an entire room.
• They are designed to work at very high
speeds with large data words, typically 64
bits or greater, and they have massive
amounts of memory.
• Computers of this type are used for military
defense control, for business data processing
(in an insurance company, for example), and
for creating computer graphics displays for
science fiction movies.
• Examples of this type of computer are the
IBM 4381, the Honeywell DPS8, and the Cray
Y-MP1832. The fastest and most powerful
mainframes are called supercomputers
Types of Computers-
Computers- Mini Computers
• Scaled-down versions of mainframe
computers are often called minicomputers.
• The main unit of a minicomputer usually fits in
a single rack or box.
• A minicomputer runs more slowly, works
directly with smaller data words often 32-bit
words), and does not have as much memory as
a mainframe.
• Computers of this type are used for business
data processing, industrial control (for an oil
refinery, for example), and scientific research.
• Examples of this type of computer are the
Digital Equipment Corporation VAX 6360 and
the Data General MV/8000l1.
7
10/16/2024
Types of Computers-
Computers- Micro Computers
• As the name implies, microcomputers are
small computers.
• They range from small controllers that
work directly with 4-bit words and can
address a few thousand bytes of memory
to larger units that work directly with 32-
bit words and can address billions of bytes
of memory.
• One distinguishing feature of a
microcomputer is that the CPU is usually a
single integrated circuit called a
microprocessor.
• Examples of micro computers are the Intel
8o51 single-chip controller: the SDK-86, a
single-board computer design kit, the IBM
Personal Computer (PC) and the Apple
Macintosh computer.
8
10/16/2024
9
10/16/2024
10
10/16/2024
8086
Internal
Architecture
11
10/16/2024
12
10/16/2024
13
10/16/2024
14
10/16/2024
15
10/16/2024
• The four general purpose registers are the AX, BX, CX, and DX
registers.
• AX - accumulator, and preferred for most operations.
• BX - base register, typically used to hold the address of a procedure or
variable.
• CX - count register, typically used for looping.
• DX - data register, typically used for multiplication and division.
16
10/16/2024
17
10/16/2024
18
10/16/2024
19
10/16/2024
Addressing Modes
• Addressing mode indicates a way of locating data or operands.
• The addressing modes describe the types of operands and the way they are
accessed for executing an instruction.
• According to the flow of instruction execution, the instructions may be
categorized as
i) Sequential control flow instructions and
ii) Control transfer instructions
• Sequential control flow instructions are the instructions, which after execution,
transfer control to the next instruction appearing immediately after it (in the
sequence) in the program. For example, the arithmetic, logic, data transfer and
processor control instructions are sequential control flow instructions.
• The control transfer instructions, on the other hand, transfer control to some
predefined address or the address somehow specified in the instruction, after
their execution. For example, INT, CALL, RET and JUMP instructions fall under this
category.
Addressing Modes
• The addressing modes for sequential control transfer instructions are:
1.Immediate
2. Direct
3. Register
4. Register Indirect
5. Indexed
6. Register Relative
7. Based Indexed
8. Relative Based Indexed
20
10/16/2024
Addressing Modes
1. Immediate: In this type of addressing, immediate data is a part of
instruction and appears in the form of successive byte or bytes.
Ex: MOV AX, 0005H
In the above example, 0005H is the immediate data. The immediate data
may be 8-bit or 16-bit in size.
2. Direct: In the direct addressing mode a 16-bit memory address (offset) is
directly specified in the instruction as a part of it.
Ex: MOV AX, [5000H]
Here, data resides in a memory location in the data segment, whose effective
address may be completed using 5000H as the offset address and content of
DS as segment address. The effective address here, is 10H * DS + 5000H.
Addressing Modes
3. Register: In register addressing mode, the data is stored in a register and is
referred using the particular register. All the registers, except IP, may be used
in this mode.
Ex: MOV BX, AX
4. Register Indirect: Sometimes, the address of the memory location, which
contains data or operand, is determined in an indirect way, using the offset
register. This mode of addressing is known as register indirect mode. In this
addressing mode, the offset address of data is in either BX or SI or DI register.
The default segment is either DS or ES.
Ex: MOV AX, [BX]
Here, data is present in a memory location in DS whose offset address is in BX.
The effective address of the data is given as 10H * DS+[BX].
21
10/16/2024
Addressing Modes
5. Indexed: In this addressing mode, offset of the operand is stored in one of
the index registers. DS and ES are the default segments for index registers, SI
and DI respectively. This is a special case of register indirect addressing mode.
Ex: MOV AX, [SI]
Here, data is available at an offset address stored in SI in DS. The effective
address, in this case, is computed as 10*DS+[SI].
6. Register Relative: In this addressing mode, the data is available at an
effective address formed by adding an 8-bit or 16-bit displacement with the
content of any one of the registers BX, BP, SI and DI in the default (either DS
or ES) segment.
Ex: MOV AX, 50H[BX]
Here, the effective address is given as 10H *DS+50H+[BX]
Addressing Modes
7. Based Indexed: The effective address of data is formed, in this addressing
mode, by adding content of a base register (any one of BX or BP) to the
content of an index register (any one of SI or DI). The default segment register
may be ES or DS.
Ex: MOV AX, [BX][SI]
Here, BX is the base register and SI is the index register the effective
address is computed as 10H * DS + [BX] + [SI].
8. Relative Based Indexed: The effective address is formed by adding an 8 or
16-bit displacement with the sum of the contents of any one of the base
register (BX or BP) and any one of the index register, in a default segment.
Ex: MOV AX, 50H [BX] [SI]
Here, 50H is an immediate displacement, BX is base register and SI is an index
register the effective address of data is computed as
10H * DS + [BX] + [SI] + 50H
22
10/16/2024
Addressing Modes
• For control transfer instructions, the addressing modes depend upon whether the
destination is within the same segment or different one. It also depends upon the
method of passing the destination address to the processor.
• Basically, there are two addressing modes for the control transfer instructions,
intersegment addressing and intrasegment addressing modes.
• If the location to which the control is to be transferred lies in a different segment
other than the current one, the mode is called intersegment mode.
• If the destination location lies in the same segment, the mode is called
intrasegment mode.
23
10/16/2024
24
10/16/2024
25
10/16/2024
26
10/16/2024
A racetrack- or circular shaped symbol labeled START Is used to indicate the beginning of
the program.
27
10/16/2024
• If a flowchart column gets to the bottom of the paper, but not all the
program has been represented, you can put a small circle with a letter in
it at the bottom of the column, You then start the next Column at the
top of the same paper with a small circle containing the same letter.
• If you need to continue a flowchart to another page. you can end the
flowchart on the first page with the five-sided off page connector
symbol containing a letter or number. You then start the flowchart on
the next page with an off-page connector symbol containing the same
letter or number.
28
10/16/2024
29
10/16/2024
30
10/16/2024
Standard Program Structures. (c) IF-THEN. (d) CASE expressed as nested IF-THEN-ELSE
31
10/16/2024
32
10/16/2024
33
10/16/2024
SUBTRACTION INSTRUCTIONS:
34
10/16/2024
35
10/16/2024
36
10/16/2024
37
10/16/2024
• INTERRUPT INSTRUCTIONS:
• These instructions are used to call the interrupt during program execution.
38
10/16/2024
39
10/16/2024
40
10/16/2024
41
10/16/2024
42
10/16/2024
43
10/16/2024
44
10/16/2024
FIGURE 3-8 MOD and R/M bit patterns for 8086 instructions. The effective address (EA) produced by these addressing modes
will be added to the data segment base to form the physical address, except for those eases where BP is used as part of the
EA. In that case the EA will be added to the slack segment base to form the physical address. You can use a segment-override
prefix to indicate that you want the EA to be added to some other segment base.
45
10/16/2024
MOV SP,BX
46
10/16/2024
MOV CL,[BX]
47
10/16/2024
48
10/16/2024
49
10/16/2024
50
10/16/2024
51
10/16/2024
52
10/16/2024
53
10/16/2024
54
10/16/2024
55
10/16/2024
UNIT - I REVIEW
56
10/16/2024
UNIT-1 ENDS
UNIT-
THANK YOU
57