Lab 01 8085-1-1
Lab 01 8085-1-1
OBJECTIVE:
Developing basic understanding about Assembly and Assembler (8085simulator)
INTRODUCTION:
Programming Languages
A programming language is an artificial language that can be used to control the behavior of a
machine, particularly a computer. Programming languages, like human languages, have syntactic and
semantic rules to define meaning.
3. Machine Language
Machine language is at the lowest level, because it is the actual binary code of 1s and 0s that the
computer understands. These are designed to give a better machine efficiency.
Registers
The 8085-programming model includes six registers, one accumulator, and one flag register, as
shown in Figure. In addition, it has two 16-bit registers: the stack pointer and the program counter.
They are described briefly as follows. The 8085 has six general-purpose registers to store 8-bit data;
these are identified as B, C, D, E, H, and L. They can be combined as register pairs - BC, DE, and
HL - to perform some 16-bit operations. The programmer can use these registers to store or copy
data into the registers by using data copy instructions.
Accumulator
The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU). This register is
used to store 8-bit data and to perform arithmetic and logical operations. The result of an operation
is stored in the accumulator. The accumulator is also identified as register A.
Flags
The ALU includes five flip-flops, which are set or reset after an operation according to data
conditions of the result in the accumulator and other registers. They are called Zero (Z), Carry
(CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags. The most commonly used flags are
Zero, Carry, and Sign. The microprocessor uses these flags to test data conditions. For example,
Page 1
after an addition of two numbers, if the sum in the accumulator id larger than eight bits, the flip-flop
uses to indicate a carry - called the Carry flag (CY) – is set to one. When an arithmetic operation
results in zero, the flip-flop called the Zero (Z) flag is set to one. It is not used as a register; five bit
positions out of eight are used to store the outputs of the five flip-flops. The flags are stored in the
8-bit register so that the programmer can examine these flags (data conditions) by accessing the
register through an instruction these flags have critical importance in the decision-making process
of the microprocessor. The conditions (set or reset) of the flags are tested through the software
instructions. For example, the instruction JC (Jump on Carry) is implemented to change the
sequence of a program when CY flag is set. The thorough understanding of flag is essential in
writing assembly language programs.
· The basic MOV instruction is used to transfer data between registers, between and memory
locations, or to have a number directly to a register or memory location.
Examples:
MOV A, B Move data from register B to Accumulator
MOV A, M Move data from Memory to Accumulator
MOV M, A Move data from Accumulator to Memory
TITLE LAB01
.MODEL SMALL
.STACK 100H
.DATA
MESSAGE1 DB 0AH, 0DH, "INDUS UNIVERSITY$"
.CODE
Page 2
MAIN:
MOV AX, @DATA
MOV DS, AX
MOV DX, OFFSET MESSAGE1
MOV AH, 09H
INT 21H
LAB TASK
Page 3
8085 Instruction set
Page 4
Page 5
Page 6
Page 7
Page 8