You are on page 1of 29

Computer Organization & Architecture

Lab
Faculty name: Sachin Garg Student name: Atishaye Jain

Roll no: 01614803119

Semester: 4th

Group: I-2

Maharaja Agrasen Institute of Technology, PSP Area,

Sector - 22, Rohini, New Delhi – 110085

Computer Organization & Architecture Lab


PRACTICAL RECORD

PAPER CODE : ETCS-260

Name of the student : Atishaye Jain

University Roll No. : 01614803119

Branch : IT

Section/ Group : I2

PRACTICAL DETAILS

Experiments according to the list provided by GGSIPU

Exp. no Experiment Name Date of Date of Remarks Marks


performance checking

1. To study about 8085 pins. 16 April 2021

2. To study instructions of 8085. 16 April 2021

3. To study how to install 8085 GNU 16 April 2021


simulator.

4. Perform Addition & Subtraction 16 April 2021


of two 8-bit Binary Numbers.

5. Find One's Complement AND 16 April 2021


Two's Complement of 8-bit
Binary Number.

6. Perform Addition & Subtraction 16 April 2021


of two 16-bit Binary Numbers.
7. Write a Programme to multiply 23 April 2021
two 8-bit numbers

8. Write a program to perform 23 April 2021


integer division on 8-bit numbers.

9. Write a Program to swap two 8- 28 May 2021


bit binary numbers.

10. Write a program to find larger of 28 May 2021


two 8-bit binary numbers.

11. Write a program to find smaller 28 May 2021


of two 8-bit binary numbers.

12. Write a Program to separate a 5 June 2021


byte into two nibbles.

13. Write a program to search a 5 June 2021


number in an array of n numbers.
Atishaye Jain
01614803119

Experiment - 1
AIM: To study about 8085 pins.

The following image depicts the pin diagram of 8085 Microprocessor –

The pins of a 8085 microprocessor can be classified into seven groups −

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.

Control and status signals


These signals are used to identify the nature of operation. There are 3 control signal and 3
status signals.
Three control signals are RD, WR & ALE.
Atishaye Jain
01614803119

• 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.

Interrupts & externally initiated signals


Interrupts are the signals generated by external devices to request the microprocessor to
perform a task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
We will discuss interrupts in detail in interrupts section.
• INTA − It is an interrupt acknowledgment signal.
• RESET IN − This signal is used to reset the microprocessor by setting the program
counter to zero.
• RESET OUT − This signal is used to reset all the connected devices when the
microprocessor is reset.
• READY − This signal indicates that the device is ready to send or receive data. If
READY is low, then the CPU has to wait for READY to go high.
• HOLD − This signal indicates that another master is requesting the use of the address
and data buses.
Atishaye Jain
01614803119

• 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.

Serial I/O signals


There are 2 serial signals, i.e. SID and SOD and these signals are used for serial
communication.
• SOD (Serial output data line) − The output SOD is set/reset as specified by the SIM
instruction.
• SID (Serial input data line) − The data on this line is loaded into accumulator
whenever a RIM instruction is executed.
Atishaye Jain
01614803119

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-

Opcode Operand Meaning Explanation

No No operation is performed, i.e., the


NOP None operation instruction is fetched and decoded.

Halt and The CPU finishes executing the current


enter wait instruction and stops further execution.
HLT None state An interrupt or reset is necessary to
exit from the halt state.

Disable The interrupt enable flip-flop is reset


DI None interrupts and all the interrupts are disabled
except TRAP.

2. Logical Instructions
For eg-

Opcode Operand Meaning Explanation

Compare the The contents of the operand


CMP R register or (register or memory) are M
M memory with the compared with the contents of
accumulator the accumulator.

Compare The second byte data is


CPI 8-bit data immediate with compared with the contents of
the accumulator the accumulator.

The contents of the


Logical AND accumulator are logically AND
R register or with M the contents of the
ANA
M memory with the register or memory, and the
accumulator result is placed in the
accumulator.
Atishaye Jain
01614803119

3. Branching Instructions
For eg-

Opcode Operand Meaning Explanation

The program
sequence is
Jump transferred to the
JMP 16-bit address
unconditionally memory address
given in the
operand.

Opcode Description Flag


Status

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-

Opcode Operand Meaning Explanation

The contents of the register or


memory are added to the
R Add register or contents of the accumulator
ADD memory, to the and the result is stored in the
M accumulator accumulator.
Example − ADD K.

The contents of the register or


memory & M the Carry flag are
R Add register to added to the contents of the
ADC the accumulator accumulator and the result is
M with carry stored in the accumulator.
Example − ADC K

The 8-bit data is added to the


Add the contents of the accumulator
ADI 8-bit data immediate to the and the result is stored in the
accumulator accumulator.
Example − ADI 55K

5. Data Transfer Instructions


For eg-

Opcode Operand Meaning Explanation

This instruction copies


Rd, Sc the contents of the
Copy from the source register into the
MOV
M, Sc source (Sc) to the destination register
destination(Dt) without any alteration.
Dt, M
Example − MOV K, L
Atishaye Jain
01614803119

The 8-bit data is stored


Rd, data Move immediate in the destination
MVI register or memory.
M, data 8-bit
Example − MVI K, 55L

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.

To install from source, run the following commands

$ meson builddir
$ cd builddir
$ ninja
$ sudo ninja install

The simplest way to compile this package is:

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.

Running `configure' takes awhile. While running, it prints some


messages telling which features it is checking for.

2. Type `make' to compile the package.

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.

By default, `make install' will install the package's files in


`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
Atishaye Jain
01614803119

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

You might also like