Index: Sr. No Experiment Title Page No Date of Performance Date of Assessmen T Marks (Out of 20) Sign From To
Index: Sr. No Experiment Title Page No Date of Performance Date of Assessmen T Marks (Out of 20) Sign From To
INDEX
Page No Marks
Sr. Date of Date of
Experiment Title (out of Sign
No Performance Assessmen
From To 20)
t
EXPERIMENTNO.1
Objective(s):
Outcome:
Problem Statement:
Write the working of 8085 simulator GNUsim8085 and basic architecture of 8085 along with small introduction
Background Study:
GNUSim8085 is a graphical simulator, assembler and debugger for the Intel 8085 microprocessor in Linux
and Windows. It is among the 20 winners of the FOSS India Awards announced in February 2008.
NUSim8085 was originally written by Sridhar Ratna kumar in fall 2003 when he realized that no proper
simulators existed for Linux. Several patches, bug fixes and software packaging have been contributed by
the GNUSim8085 community.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Aim:- Write the working of 8085 simulator GNUsim8085 and basic architecture of 8085 along with small
introduction.
What is 8085 Microprocessor?
⮚ The general purpose means the 8085 microprocessor has to be relatively simple and
inexpensive to implement many small to medium computation tasks.
⮚ It follows the von Neumann architecture that uses one memory space for both
instructions and data.
⮚ It is capable of executing arithmetic, logical, and control operations and is designed to
interact with external devices like memory, I/O ports, and other peripherals.
⇒GNUSim8085 is a graphical simulator, assembler and debugger for the Intel 8085 microprocessor in
Linux and Windows.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ It has on chip clock generator this internal clock generator requires tuned circuit like LC, RC or crystal. The
internal clock generator divides oscillation frequency by 2 and generates clock signal, which can be used
for synchronizing external devices.
⮚ In 8085, the lower 8-bit address bus (A0-A7) and data bus (D0-D7) are multiplexed to reduce number of
external pins. But due to this, external hardware is required to separate address lines and data lines.
⮚ It supports 74 instructions with following addressing modes. (a) Immediate, (b) Register, (c) Direct (d)
Indirect (e) Implied.
⮚ The Arithmetic logic unit of 8085 performs a) 8 bit binary addition with or without carry. (b) 16 bit binary
addition (c) 2 digit BCD addition (d) 8-bit binary subtraction with or without borrow (e) 8-bit logical
AND, OR, EX-OR, complement (NOT) and bit shift operations.
⮚ It has 8-bit accumulator, flag register, instruction, register, six 8-bit general purpose. Registers (B, C, D, E,
H and C) and five 16-bit registers (SP and PC)
⮚ It provides five hardware interrupts: TRAP, RST 7.5. RST 6.5, RST 5.5 and INTR.
⮚ It provides control signals (IO /M, RD, WR) to control bus cycles.
⮚ The external hardware (another microprocessor or equivalent master) can detect which machine cycle
microprocessor is executing using status signals (IO/M, S0, S1) This feature is useful when more than one
processor are using common system resources (memory & I/O devices).
⮚ The 8085 has an ability to share system bus with direct memory access controller. This feature allows to
transfer large amount of data from I/O device to memory or from memory to I/O device with high speeds.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
FLAG REGISTER
⮚ In the 8085 microprocessor, the Flag Register is a kind of 8-bit register comprising five flags that
indicate the results from arithmetic and logical operations. These flags include:
⮚ The Sign flag, indicating whether the result is negative;
⮚ The Parity flag, which indicates whether the result has an even number of 1s
⮚ In essence, these flags assist the microprocessor in decision-making based on the result of
operations.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ Program Counter (PC): The program counter is a 16-bit special-purpose register. This is used
to hold the memory address of the next instruction which will be executed. This register keeps
track of memory locations of the instructions during execution of program. The microprocessor
uses this register to execute instructions in sequence. For this, the microprocessor increments the
content of the program counter.
⮚ Stack Pointer (SP): The stack pointer is a 16-bit register, which is used to point the memory
location called the stack. The stack is a sequence of memory locations in the R/W memory. The
starting of the stack is defined by loading a 16-bit address into the stack pointer. Generally, the
programmers use this register to store and retrieve the contents of the accumulator, flags, program
counter as well as general-purpose registers during the execution of a program.
⮚ PSW: The PSW is a 16-bit register that contains the contents of the 8-bit flag register and the 8-
bit Accumulator register. The PSW contains eight status flags that indicate the state of the
processor after an instruction is executed. These flags include carry, auxiliary carry, zero, sign,
parity,
overflow, unused, and interrupt. Conditional jump instructions can be used to check the status
flags in the PSW to conditionally execute code.
⮚ Interrupt register: The interrupt register can be used to check if interrupts are enabled or not.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ Accumulator: The accumulator is an 8-bit register that is used to store arithmetic and logical
results. It is the most commonly used register in the 8085 microprocessor and is used to perform
arithmetic and logical operations such as addition, subtraction, and bitwise operations.
⮚ Registers: The 8085 microprocessor has six general-purpose 8-bit registers, including B, C, D,
E, H, and L, which can be combined to form 16-bit register pairs.
⮚ These register pairs are commonly used to store memory addresses and other data.
⮚ Registers W and Z are reserved registers and can’t be used in arithmetic operations. It is reserved
for microprocessors and works as temporary registers for internal operations like swapping two
16-bit numbers.
⮚ Program counter: The program counter is a 16-bit register that contains the memory address of
the next instruction to be executed. The program counter is incremented after each instruction is
executed, which allows the microprocessor to execute instructions in sequence.
For Example: Suppose current value of Program Counter: [PC] = 4000H (It means that next executing
instruction is at location 4000H. After fetching, program Counter(PC) always increments by
+1 for fetching of next instruction.)
⮚ Stack pointer: The stack pointer is a 16-bit register that is used to manage the stack. The stack
is a section of memory that is used to store data temporarily, such as subroutine addresses and
other data. The stack pointer is used to keep track of the top of the stack.
⮚ Instruction registers: The instruction register is an 8-bit register that contains the current
instruction being executed. The instruction register is used by the microprocessor to decode and
execute
instructions.
⮚ Flags register: The flags register is an 8-bit register that contains status flags that indicate the
result of an arithmetic or logical operation. These flags include:
⮚ carry flag: The carry flag is set when an arithmetic operation generates a carry
⮚ zero flag: The zero flag is set when the result of an arithmetic or logical operation is zero
⮚ sign flag: The sign flag is set when the result of an arithmetic or logical operation is negative
⮚ parity flag: The parity flag is set when the result of an arithmetic or logical operation has an even
number of 1 bit.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ Data bus: The data bus is an 8-bit bus that is used to transfer data between the microprocessor
and memory or other devices. The data bus is bidirectional, which means that it can be used to
read data from
memory or write data to memory.
⮚ Address bus: The address bus is a 16-bit bus that is used to address memory and other devices.
The address bus is used to select the memory location or device that the microprocessor wants to
access, thus, allowing the 8085 to access up to 65,536 memory locations.
⮚ Control bus: The control bus is a set of signals that controls the operations of the microprocessor,
including the read and write operations. The control bus includes signals such as:
⮚ Read signal: The read signal is used to read data from memory or other devices
⮚ Write signal: The write signal is used to write data to memory or other devices
⮚ Interrupt signal: The interrupt signal is used to signal the microprocessor that an interrupt has occurred
⮚ Reset signal: The reset signal is used to reset the microprocessor to its initial state.
⮚ Instruction registers and decoder: It is an 8-bit register that holds the instruction code that is
being decoded. The instructions are fetched from memory.
⮚ Timing and control unit: The timing and control unit comes under the CPU section, and it
controls the flow of data from the CPU to other devices. It is also used to control the operations
performed by the microprocessor and the devices connected to it. Timing and control signals
include Control signals, DMA Signals, RESET signals and Status signals.
⮚ Interrupt control: Whenever a microprocessor is executing the main program and if suddenly
an interruption occurs, the microprocessor shifts the control from the main program to process
the incoming request. After the request is completed, the control goes back to the main program.
There are 5 interrupt signals in 8085
⮚ microprocessors: INTR, TRAP, RST 7.5, RST 6.5, and RST 5.5.
⮚ Priorities of Interrupts: TRAP > RST 7.5 > RST 6.5 > RST 5.5 > INTR
⮚ Serial Input/output control: It controls the serial data communication by using Serial input data
and Serial output data.
⮚ Serial Input/Output control in the 8085 microprocessor refers to the communication of data
between the microprocessor and external devices in a serial manner, i.e., one bit at a time.
⮚ The 8085 has a serial I/O port (SID/SOD) for serial communication.
⮚ The SID pin is used for serial input and the SOD pin is used for serial output.
⮚ The timing and control of serial communication is managed by the 8085’s internal circuitry.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ The 8085 also has two special purpose registers, the Serial Control Register (SC) and the Serial
Shift Register (SS)
⮚ For address fetching from the memory, multiplexed address/data bus acts as an address bus and
after fetching instruction this address bus will now acts as a data bus and extract data from the
specified memory location and send this data on an 8-bit internal bus.
⮚ For multiplexed address/data bus Address Latch Enable(ALE) Pin is used. If ALE = 1
(Multiplexed bus is Address Bus otherwise it acts as Data Bus).
⮚ After data fetching data will go into the Instruction Register it will store data fetched from
memory and now data is ready for decoding so for this Instruction decoder register is used.
⮚ After that timing and control signal circuit comes into the picture. It sends control signals all over
the microprocessor to tell the microprocessor whether the given instruction is for READ/WRITE
and whether it is for MEMORY/I-O Device activity.
⮚ Hence according to timing and control signal pins, logical and arithmetic operations are
performed and according to that data fetching from the different registers is done by a
microprocessor, and mathematical
⮚ operation is carried out by ALU. And according to operations Flag register changes dynamically.
⮚ With the help of Serial, I/O data pin (SID or SOD Pins) we can send or receive input/output to
external devices in this way execution cycle is carried out.
⮚ While execution is going on if there is any interrupt detected then it will stop execution of the
current process and Invoke Interrupt Service Routine (ISR) Function. Which will stop the current
execution
⮚ and do execution of the current occurred interrupt after that normal
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
EXPERIMENTNO.2
Objective(s):
Outcome:
Problem Statement:
Study the complete instruction set of 8085 and write the instructions in the instruction set of 8085 along
with examples
.
.
Background Study:
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ We know that an instruction set is a group of instruction that executes the desired operation
on the data specifically described by the microprocessor 8085.
⮚ An instruction is a binary pattern designed inside a microprocessor to perform a specific
function.
⮚ The entire group of instructions that a microprocessor supports is called Instruction Set.
⮚ 8085 has 246 instructions
⮚ Each instruction is represented by an 8-bit binary value.
⮚ These 8-bits of binary value is called Op-Code or Instruction Byte.
⮚ Each instruction requires some data on which it has to operate. There are different techniques
to specify data for instructions. These techniques are called addressing modes. Intel 8085
uses the following addressing modes.
Figure :- 3
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ The primary goal of data transfer instructions is to facilitate efficient and accurate data
movement within a computer system. This is essential for executing programs and
handling operations involving memory, registers, and I/O devices.
Table :
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
2) Arithmetic Instruction
Arithmetic Instructions are the instructions which perform basic arithmetic
⮚ Addition: Any 8-bit number or the contents of a register or the contents of a
memory location can be added to the contents of the accumulator and the sum is stored
in the accumulator. No two other 8-bit registers can be added directly
⮚ Example- the contents of register B cannot be added directly to the contents of register C
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Examples:-
Ex.1) ADC:
MVI A, 05H ;
MVI B, 03H ;
CMC ;
ADC B ;
Result: 05H + 03H + 1 = 09H
HLT ;
Ex.2) ADI:
MVI A, 05H ;
ADI 03H ;
HLT
Ex.3)ACI:
MVI A, 45H ;
STC ;
ACI 55H ;
HLT
Ex.4) DAD K
LXI H,1234
LXI D,4321
DAD D
HLT
Ex.5) SUB K
SUB K
MVI A,45
MVI B,25
SUB B
HLT
Ex.6) SUB M
SUB M
LXI H,2000
MVI A,45
MOV M,
MVI A,50
SUB M
HLT
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Ex.7) SBB B
MVI A,50
MVI B,30
CPI 00
SBB B
HLT
3) Control Instructions
⮚ Microprocessors are electronic devices that process digital information using instructions
stored in memory. Machine control instructions are a type of instruction that control
machine functions such as Halt, Interrupt, or do nothing. These instructions alter the
different type of operations executed in the processor. In this article, we will discuss the
various types of machine control instructions found in microprocessors and their
significance in controlling Thee microprocessor's operations.
⮚ 1.NOP (No operation): NOP is used when no operation is performed. It is commonly used to fill
in time delay or to delete and insert instructions while troubleshooting. During the execution of
NOP, no flags are affected.
⮚ 2. HLT (Halt):HLT is used to stop the execution of the program temporarily. The microprocessor
finishes executing the current instruction and halts any further execution. The contents of the
registers are unaffected during the HLT state. HLT can be used to enter a wait state in which the
microprocessor waits for a specific event to occur before resuming execution.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ 5. SIM (Set interrupt mask):SIM is used for the implementation of different interrupts of
8085 microprocessor like RST 7.5, 6.5, and 5.5 and also serial data output. It does not affect
the TRAP interrupt.
⮚ 6. RIM (Reset interrupt mask):RIM is a multipurpose instruction used to read the status
of 8085 interrupts 7.5, 6.5, 5.5, and to read serial data input bit.
Table : 3
4) Logical Instruction
⮚ Logical instructions in the 8085 microprocessor are a set of instructions that perform logical
operations on data in registers and memory. Logical operations are operations that
manipulate the bits of data without affecting their numerical value. These operations include
AND, OR, XOR, and NOT.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
⮚ ANA – Logical AND: This instruction performs a logical AND operation between the
accumulator and a specified register or memory location, and stores the result in the
accumulator. For example, the instruction “ANA B” performs a logical AND operation
between the contents of the accumulator and the contents of the B register.
⮚ ORA – Logical OR: This instruction performs a logical OR operation between the
accumulator and a specified register or memory location and stores the result in the
accumulator. For example, the instruction “ORA C” performs a logical OR operation
between the contents of the accumulator and the contents of the C register.
⮚ XRA – Logical XOR: This instruction performs a logical XOR operation between the
accumulator and a specified register or memory location, and stores the result in the
accumulator. For example, the instruction “XRA M” performs a logical XOR operation
between the contents of the accumulator and the contents of the memory location pointed
to by the HL register.
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Table : 4
Ex.1) CMP
LXI H,2000
MVI A,50
MVI M,45
CMP M
HLT
Ex.2) CPI
MVI A,50
CPI 45
HLT
Ex.3) ANA
LXI H,2000
MVI A,55
MOV M,A
MVI A,AA
ANA M
HLT
Ex.4) ANI
MVI A,AAH
ANI55H
HLT
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Ex.5) XRA
LXI H,2000
MVI A,5A
MOV M,A
MVI A,A3
XRA M
HLT
Ex.6) XRI
MVI A,AAH
XRI 55H
HLT
5) Branching Instruction
● Branching instructions refer to the act of switching execution to a different
instruction sequence as a result of executing a branch instruction. The three types
of branching instructions are:
Branching instructions refer to the act of switching execution to a different instruction sequence
as a result of executing a branch instruction.
⮚ 1.Jump Instructions – The jump instruction transfers the program sequence to the
memory address given in the operand based on the specified flag. Jump instructions are 2
types: Unconditional Jump Instructions and Conditional Jump Instructions.
(a) Unconditional Jump Instructions: Transfers the program sequence to the described memory
address.
(b) Conditional Jump Instructions: Transfers the program sequence to the described memory
address only if the condition in satisfied.
⮚ 2.Call Instructions – The call instruction transfers the program sequence to the memory
address given in the operand. Before transferring, the address of the next instruction after
CALL is pushed onto the stack. Call instructions are 2 types: Unconditional Call
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
(a) Unconditional Call Instructions: It transfers the program sequence to the memory address given
in the operand.
(b) Conditional Call Instructions: Only if the condition is satisfied, the instructions executes.
⮚ 3.Return Instructions – The return instruction transfers the program sequence from the
subroutine to the calling program. Return instructions are 2 types: Unconditional Jump
Instructions and Conditional Jump Instructions.
(a) Unconditional Return Instruction: The program sequence is transferred unconditionally from
the subroutine to the calling program.
⮚ Conditional Return Instruction: The program sequence is transferred unconditionally
from the subroutine to the calling program only is the condition is satisfied
Table : 5
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
EXPERIMENTNO.3
Objective(s):
Outcome:
The students will be able to implement and use data transfer program in GNU 8085 simulator
Problem Statement:
Background Study:
Data transfer instructions are the instructions that transfer data in the microprocessor. They are also called
copy instructions. Here is the following is the table showing the list of logical instructions:
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Code:
LDA 2011
MOV B,A
LDA 2010
ADD B
STA 3010
HLT
#ORG 2010
#DB 04H,05H
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Figure : 4
EnrollmentNo:2403031087106
ComputerOrganizationandArchitecture
Lab Manual (303108254) 2024-2025
Timing Diagram:
Figure : 5
Instruction: -
● LDA : The contents of a memory location, specified by a 16-bit address in the operand, are copied
to the accumulator.
● MOV : This instruction copies the contents of the source register into the destination register
without any alteration.
● STA : The contents of the accumulator are copied into the memory location specified by the
operand.
● HTL : The CPU finishes executing the current instruction and stops further execution. An interrupt
or reset is necessary to exit from the halt state.
EnrollmentNo:2403031087106