UNIT 3 Instruction Set Architecture and Assembly Language Programming
UNIT 3 Instruction Set Architecture and Assembly Language Programming
1. Implied mode:
in this the operand is explicitly
mentioned in opcode, e.g.
complement accumulator,
also called as zero address instruction
( no address field required,)
length of instruction is only one word
2. Immediate Mode:
The operand is provided immediately after opcode.
Operand is in instruction only
Useful for initializing the registers with constant value.
3. Register mode:
The operand is in some CPUU register
4. Register indirect:
In this the instruction specifies a CPU register
where operand address is found.
CPU register contains address of operand
5. Direct Addressing:
Address of operand is in copcode only
6. Indirect Addressing:
The effective address of operand is at location pointed by
content of memory location pointed by address field of
instruction
7. Auto Increment- Auto decrement addressing:
Pointing register is automatically incremented or decremented after each
use
8. Base Register Addressing:
EA=base register + Address field
9. Relative addressing:
EA=PC+ Address field of instruction
8085 microprocessor: 8 bit data bus, 16 bit address bus
Demultiplexing of address and data lines
Functional Block Diagram
Stack Pointer
LXI SP 5000H
MVI L, 00H
PUSH H
POP PSW /// clear flags
PUSH PSW
POP H
MOV A, L
Out 41H// display at port no 41 (display device connected)
HLT
Subroutine:
A small program written separately from the main program
to perform a particular task.
The task may be repeatedly required in the main program.
Used to avoid the repetition of smaller programs.
Subroutines are written separately and are stored in a
memory location that is different from the main program.
You can call a subroutine multiple times from the main
program using a simple CALL instruction.
Similar to function call of high level language.
CALL address // used to call a subroutine. It is done by
pushing the return address (content of PC) onto stack
RET // used to return from subroutine by POPing the
Stack Pointer into PC
It is advisable to initialise SP before using CALL
RET Instruction:
Implementing Call by Value and Call
by reference
Write a program to display FF and 11 repeatedly on seven segment
display. Write a delay subroutine and call it.
LXI SP FFFFH
Start: MVI A FFH
OUT 00H
CALL Delay
MVI A, 11
OUT 00H
CALL Delay
JUMP Start
https://www.slideshare.net/grambabu77/8085
-interrupts-50457972
E E’
Basic IO interfacing
For peripheral:
IO/M’=1
For memory:
IO/M’=0
Including
IO/M’and
WR’and RD’
total 4 control
signals can be
generated.
Interrupts in 8085