0% found this document useful (0 votes)
14 views24 pages

Branch Instructions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views24 pages

Branch Instructions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Microprocessors

COURSE PCC-EE 503


NIRMAL MURMU
DEPARTMENT OF APPLIED PHYSICS
UNIVERSITY OF CALCUTTA
DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA
Course Outcomes
At the end of this course, students will demonstrate the ability
to,
CO1: Understand the basic concept and architecture of Microprocessors.

CO2: Do assembly language programming with clear understanding of


algorithms.
CO3: Develop knowledge of interfacing of peripherals like I/O, A/D, D/A,
timer etc.
CO4: Develop systems using microprocessor and understand
microcontroller.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Syllabus
Module 1: 8085 Microprocessor Architecture (8 Hours)
Microprocessor Architecture-8085 microprocessor CPU architecture, pin diagram,
temporary registers, ALU, timing and control unit, machine cycles, bus interfacing,
memory maps, special function registers, stack memory.

Module 2: Data transfer techniques (4 Hours)


Data transfer techniques: Programmed data transfer, concept of interrupt,
Interrupts of 8085, interrupt priority, interrupt driven data transfer, 8259
programmable interrupt controller, DMA transfer, 8257 DMA controller.

Module 3: Interfacing issues (8 Hours)


Interfacing- Basic principles of interfacing memory and I/O devices, 8255A
programmable peripheral interface, Interfacing of D/A and A/D converter, Concept
of serial data transfer, 8251 USART; concept of timer and counter, 8253
programmable timer interval IC.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Syllabus
Module 4: Instruction set and programming (14 Hours)
Programming of 8085 mocroprocessors: Addressing modes, instruction
set, assembly language programming, simple numerical operations, data
sorting examples, block data movement.

Module 5: 8051 microcontroller introductions (6 Hours)


Microcontroller- 8051 basics, architecture, Internal RAM, SFR area,
Instruction set and basic interfacing programes.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Lecture Plan
Sl no. Topic Hours
1. Introduction To Microprocessor & 2
Computer
2. 8085 Architecture 2

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Prerequisite
Understanding of
◦ Digital system
◦ Digital number system
◦ Digital Logic

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


References
[1] Ramesh S. Goankar, “Microprocessor Architecture,
Programming and Applications with 8085”, 5th Edition, Prentice
Hall
[2] K. Uday Kumar and B. S. Umashankar, ”8085 Microprocessor”,
Pearson India, 2008.
[3] D. V. Hall, “Microprocessors & Interfacing”, McGraw Hill
Higher Education, 1991.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Virtual Lab:
8085 Simulator: http://vlabs.iitb.ac.in/vlabs-
dev/labs_local/microprocessor/labs/exp7/procedure.php

8051 Simulator: http://vlabs.iitb.ac.in/vlabs-dev/labs/8051-


Microcontroller-Lab/labs/index.php

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Branching Instructions
The branching instruction alter the normal sequential
flow.

These instructions alter either unconditionally or


conditionally.
Branch Operations
Two types:
◦ Unconditional branch.
◦ Go to a new location no matter what.
◦ Conditional branch.
◦ Go to a new location if the condition is true.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Unconditional Branch
JMP Address
◦ Jump to the address specified (Go to).
CALL Address
◦ Jump to the address specified but treat it as a
subroutine.
RET
◦ Return from a subroutine.
The addresses supplied to all branch operations must
be 16-bits.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Conditional Branch
Go to new location if a specified condition is met.
◦ JZ Address (Jump on Zero)
◦ Go to address specified if the Zero flag is set.
◦ JNZ Address (Jump on NOT Zero)
◦ Go to address specified if the Zero flag is not set.
◦ JC Address (Jump on Carry)
◦ Go to the address specified if the Carry flag is set.
◦ JNC Address (Jump on No Carry)
◦ Go to the address specified if the Carry flag is not set.
◦ JP Address (Jump on Plus)
◦ Go to the address specified if the Sign flag is not set
◦ JM Address (Jump on Minus)
◦ Go to the address specified if the Sign flag is set.

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Jump Conditionally
Machine Code Opcode Operand Description
C3 JMP 16-bit address Jump unconditionally

The program sequence is transferred to the memory location specified


by the 16-bit address given in the operand.
While writing a program,
◦ The exact memory location may be unknown
◦ Memory address can be specified with a label (or a name); useful and
necessary for an assembler
◦ However, should not specify both a label and its 16-bit address in a
Jump instruction
◦ Furthermore, do not use the same label for different memory
locations.
Example: JMP 2034 H.
Program Example
Write a program to read the switch positions continuously and
turn on the appliances accordingly.

Memory Machine Code Label Mnemonics Comments


Address
2000 DB START: IN 00H ;Read input switches
2001 00
2002 D3 OUT 01H ;Turn on devices
according to
2003 01 ; switch positions
2004 C3 JMP START ;Go back to beginning and
2005 00 ; read the switches again
2006 20

DEPARTMENT OF APPLIED PHYSICS, UNIVERSITY OF CALCUTTA


Jump Conditionally
Opcode Operand Description
Jx 16-bit address Jump conditionally

The program sequence is transferred to the memory location


specified by the 16-bit address given in the operand based on
the specified flag of the PSW.
It control the flow of program based on flag value
Example: JZ 2034 H.
Jump Conditionally
Machine Code Opcode Description Status Flags
DA JC Jump if Carry CY = 1

D2 JNC Jump if No Carry CY = 0

F2 JP Jump if Positive S=0

FA JM Jump if Minus S=1

CA JZ Jump if Zero Z=1

C2 JNZ Jump if No Zero Z=0

EA JPE Jump if Parity Even P=1

E2 JPO Jump if Parity Odd P=0


Call Conditionally
Opcode Operand Description
CALL 16-bit address Call unconditionally

The program sequence is transferred to the memory location


specified by the 16-bit address given in the operand.
Before the transfer, the address of the next instruction after
CALL (the contents of the program counter) is pushed onto the
stack.
Example: CALL 2034 H.
Call Conditionally
Opcode Operand Description
Cx 16-bit address Call conditionally

The program sequence is transferred to the memory location


specified by the 16-bit address given in the operand based on
the specified flag of the PSW.
Before the transfer, the address of the next instruction after the
call (the contents of the program counter) is pushed onto the
stack.
Example: CZ 2034 H.
Call Conditionally
Machine Code Opcode Description Status Flags
DC CC Call if Carry CY = 1

D4 CNC Call if No Carry CY = 0

F4 CP Call if Positive S=0

FC CM Call if Minus S=1

CC CZ Call if Zero Z=1

C4 CNZ Call if No Zero Z=0

EC CPE Call if Parity Even P=1

E4 CPO Call if Parity Odd P=0


Return Conditionally
Opcode Operand Description
RET None Return unconditionally

The program sequence is transferred from the


subroutine to the calling program.
The two bytes from the top of the stack are copied
into the program counter, and program execution
begins at the new address.
Example: RET.
Return Conditionally
Opcode Operand Description
Rx None Call conditionally

The program sequence is transferred from the


subroutine to the calling program based on the
specified flag of the PSW.
The two bytes from the top of the stack are copied
into the program counter, and program execution
begins at the new address.
Example: RZ.
Return Conditionally
Opcode Description Status Flags
RC Return if Carry CY = 1

RNC Return if No Carry CY = 0

RP Return if Positive S=0

RM Return if Minus S=1

RZ Return if Zero Z=1

RNZ Return if No Zero Z=0

RPE Return if Parity Even P=1

RPO Return if Parity Odd P=0


Restart Instructions
Opcode Operand Description
RST 0–7 Restart (Software Interrupts)

The RST instruction jumps the control to one of eight


memory locations depending upon the number.
These are used as software instructions in a program
to transfer program execution to one of the eight
locations.
Example: RST 3.
Restart Address Table
Instructions Restart Address
RST 0 0000 H

RST 1 0008 H

RST 2 0010 H

RST 3 0018 H

RST 4 0020 H

RST 5 0028 H

RST 6 0030 H

RST 7 0038 H

You might also like