Professional Documents
Culture Documents
Lab
Faculty name: Sachin Garg Student name: Atishaye Jain
Semester: 4th
Group: I-2
Branch : IT
Section/ Group : I2
PRACTICAL DETAILS
Experiment - 1
AIM: To study about 8085 pins.
Address bus
A15-A8, it carries the most significant 8-bits of memory/IO address.
Data bus
AD7-AD0, it carries the least significant 8-bit address and data bus.
• RD − This signal indicates that the selected IO or memory device is to be read and is
ready for accepting data available on the data bus.
• WR − This signal indicates that the data on the data bus is to be written into a
selected memory or IO location.
• ALE − It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes
down it indicates data.
Three status signals are IO/M, S0 & S1.
IO/M
This signal is used to differentiate between IO and Memory operations, i.e. when it is high
indicates IO operation and when it is low then it indicates memory operation.
S1 & S0
These signals are used to identify the type of current operation.
Power supply
There are 2 power supply signals − VCC & VSS. VCC indicates +5v power supply and VSS
indicates ground signal.
Clock signals
There are 3 clock signals, i.e. X1, X2, CLK OUT.
• X1, X2 − A crystal (RC, LC N/W) is connected at these two pins and is used to set
frequency of the internal clock generator. This frequency is internally divided by 2.
• CLK OUT − This signal is used as the system clock for devices connected with the
microprocessor.
• HLDA (HOLD Acknowledge) − It indicates that the CPU has received the HOLD
request and it will relinquish the bus in the next clock cycle. HLDA is set to low after
the HOLD signal is removed.
Experiment - 2
AIM: To study instructions of 808.
Instruction sets are instruction codes to perform some task. It is classified into five categories.
1. Control Instructions:
For eg-
2. Logical Instructions
For eg-
3. Branching Instructions
For eg-
The program
sequence is
Jump transferred to the
JMP 16-bit address
unconditionally memory address
given in the
operand.
Jump on
JC CY=1
Carry
Jump on no
JNC CY=0
Carry
The program
Jump on sequence is
JP S=0
positive transferred to the
Jump memory address
16-bit address
conditionally given in the
Jump on operand based on
JM S=1 the specified flag
minus
of the PS
Jump on
JZ Z=1
zero
Jump on no
JNZ Z=0
zero
Jump on
JPE P=1
parity even
Atishaye Jain
01614803119
4. Arithmetic Instructions
For eg-
The contents of a
memory location,
specified by a 16-bit
Load the address in the operand,
LDA 16-bit address
accumulator are copied to the
accumulator.
Example − LDA 2034K
Atishaye Jain
01614803119
Experiment - 3
AIM: To study how to install 8085 GNU simulator.
$ meson builddir
$ cd builddir
$ ninja
$ sudo ninja install
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself. If configure script does not exist then run
'./autogen.sh' to generate it.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
Experiment - 4
AIM: Write programs to perform addition and subtraction of two 8-bit binary numbers.
;<Addition(8-bit)>
jmp start
;data
;code
start: nop
LXI H, 90
MOV A, M
INX H
ADD M
STA 92
Hlt
Atishaye Jain
01614803119
Atishaye Jain
01614803119
;<Subtraction(8-bit)>
jmp start
;data
;code
start: nop
MVI C, 00
LDA 1100
MOV B, A
LDA 1101
SUB B
JNC skip
INR C
skip: STA 1102
MOV A, C
STA 1103
HLT
Atishaye Jain
01614803119
Atishaye Jain
01614803119
Experiment - 5
AIM: Write a program to find one’s and two’s compliment of 8-bit binary numbers
;<1’s Compliment>
jmp start
;data
;code
start: nop
LDA 3000H
CMA
STA 3001H
Hlt
Atishaye Jain
01614803119
;<2’s Compliment>
jmp start
;data
;code
start: nop
LDA 3000H
CMA
INR A
STA 3001H
Hlt
Atishaye Jain
01614803119
Experiment - 6
AIM: Write programs to perform addition and subtraction of two 16-bit binary numbers.
;<Addition(16-bit)>
jmp start
;data
;code
start: nop
LXI H, 1
MVI C, 00
MOV A, M
INX H
ADD M
JNC AHEAD
INR C
AHEAD: STA 3
MOV A, C
STA 4
Hlt
Atishaye Jain
01614803119
Atishaye Jain
01614803119
;<Subtraction(16-bit)>
jmp start
;data
;code
start: nop
LHLD 9000
XCHG
LHLD 9002
LDA 9000
SUB L
MOV L, A
LDA 9001
SBB H
MOV H, A
SHLD 9004
HLT
Atishaye Jain
01614803119
Atishaye Jain
01614803119
Experiment - 7
AIM: Write a Programme to multiply two 8-bit numbers
;<Multiply>
jmp start
;data
;code
start: nop
LXI H, 8000H
MOV B, M
INX H
XRA A
MOV C, A
LOOP: ADD M
JNC SKIP
INR C
SKIP: DCR B
JNZ LOOP
LXI H, 8002H
MOV M, C
INX H
MOV M, A
Hlt
Atishaye Jain
01614803119
Experiment - 8
AIM: Write a program to perform integer division on 8-bit numbers.
;<Division>
jmp start
;data
;code
start: nop
LXI H, 0EH
MVI B, 04H
MVI C, 08
UP: DAD H
MOV A, H
SUB B
JC DOWN
MOV H, A
INR L
DOWN: DCR C
JNZ UP
SHLD 8020
hlt
Atishaye Jain
01614803119
Experiment - 9
AIM: Write a Program to swap two 8-bit binary numbers.
;<Swap>
LDA 2500
MOV B,A
LDA 2501
STA 2500
MOV A,B
STA 2501
Hlt
Atishaye Jain
01614803119
Experiment - 10
AIM: Write a program to find larger of two 8-bit binary numbers.
;<Larger>
LHLD 2050
MOV A, H
SUB L
JP X
MOV A, L
STA 2052
HLT
X: MOV A, H
STA 2052
HLT
Atishaye Jain
01614803119
Experiment - 11
AIM: Write a program to find smaller of two 8-bit binary numbers.
;<Smaller>
LXI H, 8000
MOV B, M
INX H
MOV A, M
CMP B
JC STORE
MOV A, B
STORE: STA 8002
HLT
Atishaye Jain
01614803119
Experiment - 12
AIM: Write a Program to separate a byte into two nibbles.
LDA 2500H
ANI 0FH
STA 2501H
LDA 2500H
ANI 0F0H
RRC
RRC
RRC
RRC
STA 2502H
HLT
Atishaye Jain
01614803119
Experiment - 13
AIM: Write a program to search a number in an array of n numbers.
LXI H, 2050
MOV C, M
LDA 2056
MOV B, A
LOOP: INX H
MOV A, M
CMP B
JNZ JUMP
MVI A, 1
STA 2057
HLT
JUMP: MVI A, 2
STA 2057
DCR C
JNZ LOOP
HLT
Atishaye Jain
01614803119