You are on page 1of 16

Objectives

Writing assembly language programs to achieve desired output.


Understand how to communicate using serial port.

Theory
An assembly language often abbreviated asm, is a low-level
programming language for a computer, or other programmable
device, in which there is a very strong (generally one-to-one)
correspondence between the language and
the architecture's machine code instructions. Each assembly
language is specific to a particular computer architecture, in
contrast to most high-level programming languages, which are
generally portable across multiple architectures, but
require interpreting or compiling.
Assembly language uses a mnemonic to represent each lowlevel machine instruction or operation, typically also each
architectural register, flag, etc. Many operations require one or
more operands in order to form a complete instruction and
most assemblers can take expressions of numbers and named
constants as well as registers and labels as operands, freeing
the programmer from tedious repetitive calculations.
Depending on the architecture, these elements may also be
combined for specific instructions or addressing
modes using offsets or other data as well as fixed addresses.
Many assemblers offer additional mechanisms to facilitate
program development, to control the assembly process, and to
aid debugging.
A serial port is a serial communication interface through
which information transfers in or out one bit at a time (in
contrast to a parallel port). Throughout most of the
history of personal computers, data was transferred
through serial ports to devices such as modems,
terminals and various peripherals. While such interfaces

as Ethernet, FireWire, and USB all send data as a


serial stream, the term "serial port" usually identifies
hardware more or less compliant to the RS-232 standard,
intended to interface with a modem or with a similar
communication device.

In telecommunications, RS-232 is a standard for serial


communication transmission
of data. It formally defines the signals connecting between a
DTE (data terminal equipment) such as a computer terminal,
and a DCE(data circuit-terminating equipment or data
communication equipment), such as a modem. The RS-232
standard is commonly used in computer serial ports. The
standard defines the electrical characteristics and timing of
signals, the meaning of signals, and the physical size and pin
out of connectors.

Procedure
Programs are written in notepad and saved as .asm file
format.
Then the program is compiled using nasm compiler in
command prompt.
The program is run step b step using the function key F8.

Task 1: Debug and run the given program


Bug Termination code of the program

Task 2
Step 1- 7,5,1 numbers are taken as A,B,C
Step 2- The program is written in assembler 80386 for the
following equations
Y=A+(B-C)
X=A-B*C
Z=X-Y

Task 3:Write an ALP for input string from the


keyboard and print it on the screen

Task 4: Write an ALP for transmission in one


computer and receiving in another computer
using serial communication port

Program for transmission

Program for receiving

Objectives

Use parallel port communication


Understand the pin configuration of the parallel port
Describe what the ISA bus is
Understand the pin configuration and the bus
connection of the ISA
Select the base address for the ISA hardware
interface
Use I/O interfacing techniques in a design
Use logic analyzer

Theory
A parallel port is a type of interface found
on computers (personal and otherwise) for connecting
peripherals. In computing, a parallel port is a parallel
communication physical interface. It is also known as
a printer port or Centronics port.
Today, the parallel port interface is virtually non-existent
because of the rise of Universal Serial Bus (USB) devices,
along with network printing using Ethernet and WiFi connected printers.

Industry Standard Architecture (ISA) is


a retronym term for the 16-bit internal bus of IBM
PC/AT and similar computers based on the Intel 80286 and
its immediate successors during the 1980s. The bus was
(largely) backward compatible with the 8-bit bus of
the8088-based IBM PC, including the IBM PC/XT as well
as IBM PC compatibles. All recent computers today no
longer included the ISA slots and instead are using
morePCI, AGP, and other slots.

10

Input/output
interfaced with
systems in two

devices can be
microprocessor
ways,

1. I/O mapped
2. Memory

I/O
mapped I/O

I/O mapped I/O :


8086 has special instructions IN and OUT to transfer data
through the input/output ports in I/O mapped I/O system.
The IN instruction copies data from a port to the

11

Accumulator. If an 8-bit port is read data will go to AL and If


16-bit port is read the data will go to AX. The OUT
instruction copies a byte from AL or a word from AX to the
specified port. The M/IO signal is always low when 8086 is
executing these instructions. In this address of I/O device is
8-bit or 16-bit. It is 8-bit for direct addressing and 16-bit for
indirect addressing.
Memory mapped I/O
In this type of I/O interfacing, the 8086 uses 20 address
lines to identify an I/O device. The I/O device is connected
as if it is a memory device. The 8086 uses same control
signals and instructions to access I/O as those of memory,
here RD and WR signals are activated indicating memory
bus cycle.

A logic analyzer is an electronic instrument that captures


and displays multiple signals from a digital system or digital
circuit. A logic analyzer may convert the captured data
into timing diagrams, protocol decodes, state
machine traces, assembly language, or may correlate
assembly with source-level software. Logic Analyzers have
advanced triggering capabilities, and are useful when a
user needs to see the timing relationships between many
signals in a digital system.

Task 1
Procedure
An assembly language program is written for an up
counter which counts from 0 to (256-X) and the counted

12

sequence is sent to the hardware circuit through the


parallel port.( Value X is the input from the hardware
circuit which is connected to the parallel port.
Signals of the hardware are analyzed using the logic
analyzer in both time analysis and state domain analysis.

Program

Discussion
Each personal computer has a microprocessor that manages
the computer's arithmetical, logical, and control activities.

13

Each family of processors has its own set of instructions


for handling various operations such as getting input from
keyboard, displaying information on screen and
performing various other jobs. These set of instructions
are called 'machine language instructions'.
A processor understands only machine language instructions,
which are strings of 1's and 0's. However, machine language is
too obscure and complex for using in software development.
So, the low-level assembly language is designed for a specific
family of processors that represents various instructions in
symbolic code and a more understandable form.

Having an understanding of assembly language makes one


aware of
How programs interface with OS, processor, and BIOS
How data is represented in memory and other external
devices
How the processor accesses and executes instruction
How instructions access and process data
How a program accesses external device

Other advantages of using assembly language are


It requires less memory and execution time
It allows hardware-specific complex jobs in an easier way
It is suitable for time-critical jobs
It is most suitable for writing interrupt service routines
and other memory resident programs

14

Serial and parallel are two types of ports which are used for
communication in computers. Parallel transmission occurs
across a parallel wire. Parallel wires are flat and think,
constituting multiple, smaller cables. Each cable can carry a
single bit of information (either representing a 1 or 0). A parallel
cable can carry multiple bits at the same time, one for each
cable. An eight-cable parallel wire, for example, could carry an
entire byte of data. This results in faster data transmission per
second, all things being equal.

Serial transmission occurs over a single cable, one bit at a time.


This type of communication is named "serial" not simply
because data travels one bit at a time, but also because these
bits must be organized in a particular way so that transmissions
can be organized and considered trustworthy. For example, a
single transmission from a peripheral device using serial data
might take only 6 bits, so the serial mechanism has a way to
dictate how to signal things like an "end of transmission."

The Parallel port can be fast enough for most applications, but
it suffers from many problems. The most significant issue is
that the port is non-standard. Often times, users of the parallel
port will run into OS issues or BIOS issues. The serial port does
not suffer the same problems of the parallel port. The behavior
of the serial port has been standardized across computers so
there are no surprises there. The real problems are bandwidth
and limited ports.

An Industry Standard Architecture bus (ISA bus) is a computer


bus that allows additional expansion cards to be connected to a
computer's motherboard. It is a standard bus architecture for
IBM compatibles. Introduced in 1981, the ISA bus was designed
to support the Intel 8088 microprocessor for IBMs firstgeneration PC.

15

In the late 1990s the faster peripheral component interconnect


(PCI). Soon afterwards, use of the ISA bus began to diminish,
and most IBM motherboards were designed with PCI slots.
Although there are still a few motherboards being made with
ISA slots, these are generally referred to as the legacy bus
motherboards.
The ISA bus provides direct memory access using multiple
expansion cards on a memory channel allowing separate
interrupt request transactions for each card. Depending on the
version, the ISA bus can support a network card, additional
serial ports, a video card and other processors and
architectures, including:
IBM PC with Intel 8088 microprocessor
IBM AT with Intel 80286 processor (1984)
Extended Industry Standard Architecture (1988)
The ISA bus first included synchronicity with the CPU clock. It
was later upgraded to high-level buffering, which interfaced the
chipsets with the CPU. Likewise, the ISA bus used bus
mastering, which directly accessed just the first 16 MB of main
memory.

16