Lab 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Experiment No: 01

Experiment Name: Basic Assembly code with EMU8086


Requirements:
⦁ PC/Laptop

⦁ EMU8086 software

Objectives:

⦁ To familiar with the basic syntax of assembly language.

⦁ To learn how to implement and execute assembly code in EMU8086.

Theory:
An assembly language is a type of low-level programming language that is intended to
communicate directly with a computer’s hardware. Unlike machine language, which
consists of binary and hexadecimal characters, assembly languages are designed to be
readable by humans. Low-level programming languages such as assembly language are a
necessary bridge between the underlying hardware of a computer and the higher-level
programming languages—such as Python or JavaScript—in which modern software
programs are written.

⦁ An assembly language is a type of programming language that translates highlevel


languages into machine language.

⦁ It is a necessary bridge between software programs and their underlying hardware


platforms.

⦁ Assembly language relies on language syntax, labels, operators, and directives to


convert code into usable machine instruction.

⦁ Assembly language may pass through single-pass or multi-pass assemblers, each


with specific uses and benefits.

⦁ Today, assemble languages are rarely written directly, although they are still used
in some niche applications such as when performance requirements are
particularly high.
How Assembly Languages Work: Fundamentally, the most basic instructions
executed by a computer are binary codes, consisting of ones and zeros. Those codes are
directly translated into the “on” and “off” states of the electricity moving through the
computer’s physical circuits. In essence, these simple codes form the basis of “machine
language,” the most fundamental variety of programming language. Of course, no human
1
would be able to construct modern software programs by explicitly programming ones
and zeros. Instead, human programmers must rely on various layers of abstraction that
can allow themselves to articulate their commands in a format that is more intuitive to
humans. Specifically, modern programmers issue commands in so-called “high-level
languages,” which utilize intuitive syntax such as whole English words and sentences, as
well as logical operators such as “and,” “or,” and “else” that are familiar to everyday
usage. Ultimately, however, these high-level commands need to be translated into
machine language. Rather than doing so manually, programmers rely on assembly
languages whose purpose is to automatically translate between these high-level and low-
level languages. The first assembly languages were developed in the 1940s, and though
modern programmers and modern natural language processors spend very little time
dealing with assembly languages, they nevertheless remain essential to the overall
functioning of a computer.
Hello World Program:
org 100h
mov ah,09h
mov dx, offset message
int 21h
mov ah,4ch
int 21h
endp
message db "Hello World $"
end main

Input Output Concept:


.model small
.stack 100h
.code
main proc
mov ah,1
int 21h
mov bl,al
mov ah,1
int 21h
mov ah,2
mov dl,bl
int 21h
mov ah,2
mov bh,al
int 21h
exit:
mov ah,4ch
int 21h
2
main endp
end main.
Declaring Variable:
.model small
.stack 100h
.data
msg db 3
msg1 db?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,2
add msg,48
mov dl,msg
int 21h
mov ah,1
int 21h
mov msg1, al
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
mov ah,2
mov dl,msg1
int 21h
exit:
mov ah,4ch
int 21h
main endp
end main

Task-1: Print your name.

3
Task-2: Take a variable which is last digit of your id, and take another input from user.

4
Discussion:
The assembly programming language is a low-level language which is developed
by using mnemonics.The 8086 is a processor that is represented for all peripheral
devices.A Register is the main part of the microprocessors and controllers which are
located in the memory that provides a faster way of collecting and storing the data.In this
lab we complete three task by using emu 8086.first i programme my name then shows
input output concept.And third task i take a variable which is last digit of my id and take
another input from user.There are rules about EMU8086 that code must be written in
upper case letters but first time i forgot it and got some error.With the help of google i
solved that problem.

You might also like