Practical 2 - COA
Practical 2 - COA
Practical 2
AIM: Write the working of simulator GNUsim8085 and
basic architecture of 8085 along with small instruction.
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)
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.
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.
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 3: click on reset and reset all the registers by clicking on reset
all.
8|Page
(231243107012)
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