Sunteți pe pagina 1din 5

EXPT.

NO:8 DISPLAY USING SUBROUTINES

AIM:
i. To write a program to display 00 and FF alternately on the display.

APPARATUS REQUIRED:

1. Microprocessor kit
2. Power supply (+5V)
3. Keyboard
i. ALGORITHM:
SI:NO ALGORITHM INSTRUCTION
Initialize stack pointer register with the address LXI SP,27F0
1
27F0
2 Call the subroutine CRLF to clear display. CALL CRLF
3 Load the E register with data 00 to display MVI E,00
4 Load B register with the number of digit MVI B,02
5 Call subroutine to display CALL NMOUT
6 Call for delay program CALL DELAY
7 Next load E register with the data FF to display MVI E,FF
8 Call subroutine to display CALL NMOUT
9 Call for delay program CALL DELAY
10 Repeat the process from the step 5. JMP START

OPCODE /
INSTRUCTION HOW TO ENTER IN THE KIT
OPERAND
It is 3 byte instruction.
The first byte, opcode is entered in the address 6100 and
press enter key
LXI SP,27F0 31,F0,27 The second byte (Low order address) is entered in the
address 6101 and press enter key
The third byte ( High order address) is entered in the
address 6102 and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 6103 and
press enter key
CALL CRLF CD,8A,04 The second byte (Low order address) is entered in the
address 6104 and press enter key
The third byte ( High order address) is entered in the
address 6105 and press enter key
It is 2 byte instruction.
The first byte (opcode) is entered in the address (say 6106)
MVI E,00 1E,00 and press enter key
The second byte is entered in the next address 610700H (
1st data) and press enter key
It is 2 byte instruction.
The first byte (opcode) is entered in the address (say 6108)
MVI B,02 06,02 and press enter key
The second byte is entered in the next address 610902H (
1st data) and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 610A and
press enter key
CALL NMOUT CD,6C,03 The second byte (Low order address) is entered in the
address 610B and press enter key
The third byte ( High order address) is entered in the
address 610C and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 610D
and press enter key
LXI D,FFFF 11,FF,FF The second byte (Low order address) is entered in the
address 610E and press enter key
The third byte ( High order address) is entered in the address
610F and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 6110 and
press enter key
CALL DELAY CD,15,06 The second byte (Low order address) is entered in the
address 6111 and press enter key
The third byte ( High order address) is entered in the
address 6112 and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 6113 and
press enter key
CALL CRONY CD,97,04 The second byte (Low order address) is entered in the
address 6114 and press enter key
The third byte ( High order address) is entered in the
address 6115 and press enter key
It is 2 byte instruction.
The first byte (opcode) is entered in the address (say 6116)
MVI E,FF 1E,FF and press enter key
The second byte is entered in the next address 6117FFH
( 1st data) and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 6118 and
press enter key
CALL NMOUT CD,6C,03 The second byte (Low order address) is entered in the
address 6119 and press enter key
The third byte ( High order address) is entered in the
address 611A and press enter key
It is 3 byte instruction.
11,FF,FF The first byte, opcode is entered in the address 611B and
LXI D,FFFF
press enter key
The second byte (Low order address) is entered in the
address 611C and press enter key
The third byte ( High order address) is entered in the address
611D and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 611E and
press enter key
CALL DELAY CD,15,06 The second byte (Low order address) is entered in the
address 611F and press enter key
The third byte ( High order address) is entered in the
address 6120 and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 6121 and
press enter key
CALL CRONY CD,97,04 The second byte (Low order address) is entered in the
address 6122 and press enter key
The third byte ( High order address) is entered in the address
6123 and press enter key
It is 3 byte instruction.
The first byte, opcode is entered in the address 6124 and
press enter key
JMP START C3,96,63 The second byte (Low order address) is entered in the
address 6125 and press enter key
The third byte ( High order address) is entered in the
address 6126 and press enter key

PROGRAM: To Display 00 & FF

ADDRESS LABEL MNEMONICS OP CODE COMMENTS


6100 LXI SP,27F0 31,F0,27 Initialize stack pointer
6103 CALL CRLF CD,8A,04 Clear display
6106 START MVI E,00 1E,00 E00
6108 MVI B,02 06,02 2 digit display. B02
610A CALL NMOUT CD,6C,03 Call display
610D LXI D,FFFF 11,FF,FF Delay Count
6110 CALL DELAY CD,15,06 Call delay
6113 CALL CRONY CD,97,04 Cursor at 1st position
6116 MVI E,FF 1E,FF EFF
6118 CALL NMOUT CD,6C,03 Call display
611B LXI D,FFFF 11,FF,FF Delay Count
611E CALL DELAY CD,15,06 Call delay
6121 CALL CRONY CD,97,04 Cursor at 1st position
6124 JMP START C3,96,63 Jump to Start
RESULT:

Thus the following programs were executed and verified using 8085 microprocessor kit
i. To write a program to display 00 and FF alternately on the display.
VIVA QUESTION & ANSWERS

1. Explain the difference between a JMP instruction and CALL instruction.


A JMP instruction permanently changes the program counter. A CALL instruction
leaves information on the stack so that the original program execution sequence can
be resumed.

2. Define instruction cycle, machine cycle and T-state


Instruction cycle is defined, as the time required completing the execution of an
instruction. Machine cycle is defined as the time required completing one operation of
accessing memory, I/O or acknowledging an external request. Tcycle is defined as
one subdivision of the operation performed in one clock period

3. Compare CALL and PUSH instructions

CALL PUSH

1.When CALL is executed the


1.PUSH The programmer
microprocessor automatically
uses the instruction to
stores the 16-bit address of the
save the contents of the
instruction next to CALL on the
register pair on the stack
stack.
2. When PUSH is
2.When CALL is executed the
executed the stack pointer
stack pointer is decremented by
is decremented by two
two

4. How does the microprocessor differentiate between data and instruction?


Ans:When the first m/c code of an instruction is fetched and decoded in the instruction
register, the microprocessor recognizes the number of bytes required to fetch the entire
instruction. For example MVI A, Data, the second byte is always considered as data. If the
data byte is omitted by mistake whatever is in that memory location will be considered as
data & the byte after the data will be treated as the next instruction.

S-ar putea să vă placă și