Unit II
Unit II
INSTRUCTION SET
The various techniques to specify data for instructions are:
1. 8-bit or 16-bit data may be directly given in the instruction itself.
2. The address of the memory location, I/O port or I/O device, where data resides, may
be given in the instruction itself.
3. In some instructions, only one register is specified. The content of the specified
register is one of the operands.
4. Some instructions specify two registers. The contents of the registers are the required
data.
5. In some instructions, data is implied. The most instructions of this type operate on the
content of the accumulator.
Instruction sets are instruction codes to perform some task. It is classified into five categories.
Control Instructions:
1 Includes the instructions related to interrupts and the instruction used to halt
program execution
Logical Instructions
The instructions which performs the logical operations like AND, OR,
EXCLUSIVE-OR, complement, compare and rotate instructions are grouped under this
heading. The flag conditions are altered after execution of an instruction in this group.
2
AND, ORA, XOR: Perform bitwise logical operations on the accumulator with
data from registers, memory, or immediate values.
CMP: Compare the accumulator with data from registers, memory, or
immediate values.
Branching Instructions
The instructions that are used to transfer the program control from one memory
location to another memory location are grouped under this heading.
JMP: Unconditional jump to a specific memory address.
3
JC, JNC, JP, JM, JZ, JNZ: Conditional jumps based on the status of the carry
flag (C), parity flag (P), sign flag (M), zero flag (Z), etc.
CALL: Call a subroutine at a specific memory address.
RET: Return from a subroutine.
Arithmetic Instructions
Includes the instructions, which performs the addition, subtraction, increment or
decrement operations. The flag conditions are altered after execution of an instruction
in this group.
4 ADD, ADC: Add data to the accumulator with or without carry.
SUB, SBB: Subtract data from the accumulator with or without borrow.
INR, DCR: Increment or decrement the value of a register or memory location.
DAD: Double the value of a register pair.
TIMING DIAGRAMS:
A time diagram is a graphical representation. The 8085 instruction timing diagram
represents the execution time of each instruction in graphical format.
Execution time is given in T-states. The 8085 microprocessor has a set of control signals
and data signals that play an important role in the execution of instructions.
A timing diagram is and how to draw a timing diagram of different instructions
Clock Signal: The time required to execute an instruction is called a clock cycle.
Machine Cycle: The time required to access memory or input/output devices is called
a machine cycle. The 8085 has 5 basic machine cycles i.e., load opcode, read from
memory, write to memory, read I/O, and write I/O.
T-State: A machine cycle and an instruction cycle take several clock periods. The
portion of an operation performed in one system clock period is called a T-state.
Control Signals: The control signal controls the operations. Common signals are
ALE (address block enable), RD (read), WR (write), and IO/M (input/output)
memory.
Machine Cycle of 8085
The 8085 microprocessor has 5 basic machine cycles. They are :
Opcode Fetch {4T- state}
Memory Read {3T- state}
Memory Write {3T- state}
I/O Read {3T- state}
I/O Write {3T- state}
Number of
Name Year of Invention Clock speed transistors Inst. per sec
Cache
memory 8 bit
PENTIUM 1993 66 MHz for
instructions 8
bit for data
Number of
Name Year of Invention Clock speed transistors Inst. per sec
64 KB of L1
2006 (other versions
INTEL 291 Million cache per core
core2 duo, core2 1.2 GHz to 3 GHz
core 2 transistors 4 MB of L2
quad, core2 extreme)
cache
2.2GHz – 3.3GHz,
2.4GHz – 3.6GHz,
i3, i5, i7 2007, 2009, 2010
2.93GHz –
3.33GHz
16 –bit Microprocessor:
16-bit stack processors in general have lower costs than 32-bit processors. Their
internal data paths are narrower, so they use fewer transistors and cost less to manufacture.
They only need 16-bit paths to external memory, so they have half as many memory bus data
pins as 32-bit processors.
System costs are also lower, since a minimum configuration 16-bit processor only
needs to have half the number of memory chips as a 32-bit processor for a single bank of
memory.
16-bit chips also have a reasonable amount of silicon area available for special
features, such as hardware multipliers, on-chip program memory, and peripheral interfaces.
The trend is for semicustom 16-bit stack processors such as the RTX 2000 to be complete
systems-on-a-chip, including I/O peripherals and program memory for embedded
applications.
32-bit Microprocessor:
32-Bit stack processors should be used instead of 16-bit processors only in cases
where the application requires high efficiency at one or more of the following: 32-bit integer
calculations, access to large amounts of memory, or floating point arithmetic.
32-Bit integer calculations are obviously well suited to a 32-bit processor. Occasions
where 32-bit integers are required include graphics and manipulation of large data structures.
While a 16-bit processor can simulate 32-bit arithmetic using double-precision operands, 32-
bit processors are much more efficient.
Floating point calculations also require a 32-bit processor for good efficiency. 16-Bit
processors spend a significant amount of time manipulating stack elements when dealing with
floating point numbers, whereas 32-bit processors are naturally suited to the size of the data
elements. There are many instances in which scaled integer arithmetic is more appropriate
than floating point numbers to increase speed on some processors
When microprocessor receives any interrupt signal from peripheral(s) which are
requesting its services, it stops its current execution and program control is transferred to a
sub-routine by generating CALL signal and after executing sub-routine by
generating RET signal again program control is transferred to main program from where it
had stopped.
When microprocessor receives interrupt signals, it sends an acknowledgement (INTA)
to the peripheral which is requesting for its service. Interrupts can be classified into various
categories based on different parameters:
Interrupt are classified into following groups based on their parameter −
1. Vector interrupt – Vectored Interrupts are those which have fixed vector address
(starting address of sub-routine) and after executing these, program control is transferred
to that address
In this type of interrupt, the interrupt address is known to the processor.
DMA basically stands for Direct Memory Access. It is a process which enables data
transfer between the Memory and the IO (Input/ Output) device without the need of or you
can say without the involvement of CPU during data transfer.
T
he
Block Diagram consists of 8 blocks which are – Data Bus Buffer, Read/Write Logic,
Cascade Buffer Comparator, Control Logic, Priority Resolver and 3 registers- ISR, IRR,
IMR.
1. Data bus buffer – This Block is used as a mediator between 8259 and 8085/8086
microprocessor by acting as a buffer. It takes the control word from the 8085 (let say)
microprocessor and transfer it to the control logic of 8259 microprocessor.
After selection of Interrupt by 8259 microprocessor (based on priority of the
interrupt), it transfer the opcode of the selected Interrupt and address of the Interrupt
service sub routine to the other connected microprocessor. The data bus buffer consists
of 8 bits represented as D0-D7 in the block diagram. Thus, shows that a maximum of 8
bits data can be transferred at a time.
2. Read/Write logic – This block works only when the value of pin CS is low (as this pin is
active low). This block is responsible for the flow of data depending upon the inputs of
RD and WR. These two pins are active low pins used for read and write operations.
3. Control logic – It is the center of the PIC and controls the functioning of every block. It
has pin INTR which is connected with other microprocessor for taking interrupt request
and pin INT for giving the output.
If 8259 is enabled, and the other microprocessor Interrupt flag is high then this causes
the value of the output INT pin high and in this way 8259 responds to the request made
by other microprocessor.
4. Interrupt request register (IRR) – It stores all the interrupt level which are requesting
for Interrupt services.