0% found this document useful (0 votes)
234 views8 pages

Lab 01 8085-1-1

The document provides an introduction to assembly language and the 8085 microprocessor. It discusses the different types of programming languages including high-level languages, low-level languages, and machine language. It describes the registers of the 8085 including the accumulator, flags, program counter, and stack pointer. The accumulator is used to store data and perform arithmetic/logical operations. The flags indicate the status or result of operations. The program counter sequences instruction execution and the stack pointer manages the call stack. Sample assembly code is given to display a string on the screen using INT 21H to call the operating system.

Uploaded by

Hala
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)
234 views8 pages

Lab 01 8085-1-1

The document provides an introduction to assembly language and the 8085 microprocessor. It discusses the different types of programming languages including high-level languages, low-level languages, and machine language. It describes the registers of the 8085 including the accumulator, flags, program counter, and stack pointer. The accumulator is used to store data and perform arithmetic/logical operations. The flags indicate the status or result of operations. The program counter sequences instruction execution and the stack pointer manages the call stack. Sample assembly code is given to display a string on the screen using INT 21H to call the operating system.

Uploaded by

Hala
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/ 8

Lab # 01

Introduction To Assembly and Assemble

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.

Types of Programming Languages


Programming languages can be classified into three basic categories on the basis of understanding
level of users as well as the machine to which instructions has been given:

1. High Level Languages


A programming language that enables a programmer to write programs that are more or less
independent of a particular type of computer and are designed to give a better program efficiency.
Such languages are considered high-level because they are closer to human languages.

2. Low Level Languages


These are designed to have both: a relatively good programming efficiency and relatively good
machine efficiency.

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.

Program Counter (PC)


This 16-bit register deals with sequencing the execution of instructions. This register is a memory
pointer. Memory locations have 16-bit addresses, and that is why this is a 16-bit register. The
microprocessor uses this register to sequence the execution of the instructions. The function of the
program counter is to point to the memory address from which the next byte is to be fetched. When
a byte (machine code) is being fetched, the program counter is incremented by one to point to the
next memory location

Stack Pointer (SP)


The stack pointer is also a 16-bit register used as a memory pointer. It points to a memory location
in R/W memory, called the stack. The beginning of the stack is defined by loading 16-bit address in
the stack pointer. The stack concept is explained in the chapter "Stack and Subroutines."

Instruction register and decoder


Temporary store for the current instruction of a program. Latest instruction sent here
from memory prior to execution. Decoder then takes instruction and ‘decodes’ or interprets the
instruction. Note that IR is a 8-bit register.

Basic MOV Instruction

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

Syntax: MOV Destination, Source

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

Code to Display String

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

MOV AH, 4CH


INT 21H
END MAIN

LAB TASK

1. Write a program to display your complete name on the screen


2. Write a program to display you complete enrolment number on screen
3. Test your code after removing the $ sign from the string

Page 3
8085 Instruction set

Page 4
Page 5
Page 6
Page 7
Page 8

You might also like