0% found this document useful (0 votes)
99 views10 pages

Practical 2 - COA

coa practical with commands

Uploaded by

yolirox135
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views10 pages

Practical 2 - COA

coa practical with commands

Uploaded by

yolirox135
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

(231243107012)

Practical 2
AIM: Write the working of simulator GNUsim8085 and
basic architecture of 8085 along with small instruction.

Computer Organization and architecture lab consist of


performing various experiments in GNU sim (A simulator for
8085 microprocessor).
Before doing the coding on the simulator it’s necessary to
study the computer architecture along with its instruction set.

Fig – Architecture of 8085 microprocessor

1|Page
(231243107012)
Accumulator
It is an 8-bit register used to perform arithmetic, logical, I/O &
LOAD/STORE operations. It is connected to internal data bus &
ALU.
Arithmetic and logic unit
As the name suggests, it performs arithmetic and logical operations
like Addition, Subtraction, AND, OR, etc. on 8-bit data.
General purpose register
There are 6 general purpose registers in 8085 processor, i.e. B, C, D,
E, H & L. Each register can hold 8-bit data.
These registers can work in pair to hold 16-bit data and their pairing
combination is like B-C, D-E & H-L.
Program counter
It is a 16-bit register used to store the memory address location of the
next instruction to be executed. Microprocessor increments the
program whenever an instruction is being executed, so that the
program counter points to the memory address of the next instruction
that is going to be executed.
Stack pointer
It is also a 16-bit register works like stack, which is always
incremented/decremented by 2 during push & pop operations.
Temporary register
It is an 8-bit register, which holds the temporary data of arithmetic
and logical operations.
Flag register
It is an 8-bit register having five 1-bit flip-flops, which holds
either 0 or 1 depending upon the result stored in the
accumulator.

2|Page
(231243107012)

These are the set of 5 flip-flops −


 Sign (S)
 Zero (Z)
 Auxiliary Carry (AC)
 Parity (P)
 Carry (C)
Its bit position is shown in the following table –
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY

Instruction registers and decoder


It is an 8-bit register. When an instruction is fetched from memory
then it is stored in the Instruction register. Instruction decoder decodes
the information present in the Instruction register.

Timing and control unit


It provides timing and control signal to the microprocessor to perform
operations. Following are the timing and control signals, which
control external and internal circuits −

Control Signals: READY, RD’, WR’, ALE


Status Signals: S0, S1, IO/M’
DMA Signals: HOLD, HLDA
RESET Signals: RESET IN, RESET OUT

Interrupt control

3|Page
(231243107012)
As the name suggests it controls the interrupts during a process. When
a microprocessor is executing a main program and whenever an
interrupt 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, RST


7.5, RST 6.5, RST 5.5, TRAP.

Serial Input/output control


It controls the serial data communication by using these two
instructions: SID (Serial input data) and SOD (Serial output data).

Address buffer and address-data buffer


The content stored in the stack pointer and program counter is loaded
into the address buffer and address-data buffer to communicate with
the CPU. The memory and I/O chips are connected to these buses; the
CPU can exchange the desired data with the memory and I/O chips.

Address bus and data bus


Data bus carries the data to be stored. It is bidirectional, whereas
address bus carries the location to where it should be stored and it is
unidirectional. It is used to transfer the data & Address I/O devices.

4|Page
(231243107012)
Introduction To GNUSIM8085
8085 simulators are software on which instructions are executed by
writing the programs in assembly language.
GNUSim8085 is an 8085-microprocessor simulator with following
features.
A simple editor component with syntax highlighting.
A keypad to input assembly language instructions with appropriate
arguments.
 Easy view of register contents.
 Easy view of flag contents.
 Hexadecimal Decimal converter.
 View of stack, memory and VO contents.

 Support for breakpoints for programming debugging


 Stepwise program execution.
 clicks conversion of assembly program to opcode listing.
 Printing support (known not to work well on Windows).
 UI translated in various languages.
Writing a program in assembly language: -
Format of the instruction is as follows: -
Label Operation Operands Comments
Its optional Necessary Necessary Its optional

A basic assembly program consists of 4 parts.


1. Labels
2. Operations: these operation can be specified as Machine
operations (mnemonics): - used to define operations in the form
of opcode as mention the instruction set of microprocessor 8085.
3. Pseudo operations (like pre-processor in C): - these are
assembly directives.

5|Page
(231243107012)
4. Operands
5. Comments
In addition, you have constants in an assembly program. Unless
otherwise specified. A constant which always numeric in decimal
form. If appended with a character h it is assumed to be in
hexadecimal form. If a hex constant starts with an alpha-char don't
forget to include the number 0 in the beginning, since that will help
the assembler to differentiate between a label and a constant.
Labels: -
When given to any particular instruction/data in a program. takes the
address of that instruction or data as its value But it has different
meaning when given to EQU directive. Then it takes the operand of
EQU as its value. Labels must always be placed and must be followed
by an instruction (no empty line) Labels must be followed by a:
(colon). to differentiate it from other tokens.
Operations: -
As mentioned above the operations can be specified in two ways that
are mnemonics and pseudo operation
Pseudo operations can be defined by using following directives: -
There are only 3 directives currently available in our assembly
language
I. DB - define byte (8 bits)
2. DS - define Size (no. of bytes)
3. EQU • like minimalistic #define in C
DB is used to define space for an array of values specified by comma
separated list And the label (if given to the beginning of DB) is
assigned the address of the first data item.
DS is used to define the specified number of bytes to be assigned and
initialize them to zero. To access each byte you can use the + or -
operator along with label.

6|Page
(231243107012)
EQU behaves similar to "define in C. But it is simple. It can be used
to give names only to numeric constants. Nesting of EQU is not
allowed. You can use EQU only in operands for pseudo ops and
mnemonics.
Operands: -
Operands are specified according to the user, The register set
specified in the architecture of 808S (A, B, C, D, H and L) are used to
access and store data. These registers are specified as operand. In case
of accessing data or storing data in the memory 'm' is specified as an
operand and the address of this memory location is taken from the HL
pair (data in HL pair).
Working With GNU Simulator 8085:

Step 1: open GNU Sim 8085 above window Will open. Now click
on close button highlighted in the above screen shot.

7|Page
(231243107012)

Step 2: Start Writing The Code After Start: Nop In Load Me At 10


That Is At Load Me At 11.

Step 3: click on reset and reset all the registers by clicking on reset
all.

8|Page
(231243107012)

Execute the program


from here.

Step 4: click on the highlighted button to execute the code

Step 5: After you execute the code mention the name your
program by writing the name in the name section as
mentioned in the screen shot in picture 5 and the drive where
you want to save it. After that click on save.

9|Page
(231243107012)

Step 6: after this you see the result of the instruction in the
respective registers as seen in the above picture.

10 | P a g e

You might also like