Documente Academic
Documente Profesional
Documente Cultură
Instruction Queue
The instructions of 8086 are classified into SIX groups. They are:
1. DATA TRANSFER INSTRUCTIONS
2. ARITHMETIC INSTRUCTIONS
3. BIT MANIPULATION INSTRUCTIONS
4. STRING INSTRUCTIONS
5. PROGRAM EXECUTION TRANSFER INSTRUCTIONS
6. PROCESS CONTROL INSTRUCTIONS
2.ARITHMETIC INSTRUCTIONS
These instructions are those which are useful to perform Arithmetic
calculations, such as addition, subtraction, multiplication and
division.They are again classified into four groups.They are:
3.BIT MANIPULATION INSTRUCTIONS
These instructions are used to perform Bit wise operations.
4. STRING INSTRUCTIONS
The string instructions function easily on blocks of memory.They are
user friendly instructions, which help for easy program writing and
execution. They can speed up the manipulating code.They are useful in
array handling, tables and records.
History
The earliest versions of MASM date back to 1981.
Up to version 5.0, MASM was available as an MS-DOS application only.
Versions 5.1 and 6.0 were available as both MS-DOS and OS/2
applications.
Version 6.0, released in 1992, added high-level programming support
and a more C-like syntax. By the end of the year, version 6.1A updated
the memory management to be compatible with code produced by Visual
C++. In 1993 full support for 32-bit applications and the Pentium
instruction set was added. The MASM binary at that time was shipped
as a "bi-modal" DOS-extended binary (using the Phar Lap TNT DOS
extender).
Versions 6.12 to 6.14 were implemented as patches for version 6.11. These
patches changed the type of the binary to native PE format; version 6.11 is
the last version of MASM that will run under MS-DOS.
By the end of 1997 MASM fully supported Windows 95 and
included some
AMD-specific
instructions.
In 1999 Intel released macros for SIMD and MMX instructions, which
were shortly after supported natively by MASM. With the 6.15 release in
2000, Microsoft discontinued support for MASM as a separate product,
instead subsuming it into the Visual Studio toolset. Though it was still
compatible with Windows 98, current versions of Visual Studio were not.
Support for 64-bit processors was not added until the release of Visual
Studio 2005, with MASM 8.0.
IDEs
• RadASM
• WinAsm Studio
• EasyCode
• Visual Studio
Debuggers
• OllyDbg
Disassemblers
• IDAPro the Interactive Disassembler
ASSEMBLE A [ADDRESS]
COMPARE C RANGE ADDRESS
DUMP D [RANGE]
ENTER E ADDRESS [LIST]
FILL F RANGE LIST
GO G [=ADDRESS] [ADDRESSES]
HEX H VALUE 1 VALUE 2
INPUT I PORT
LOAD L [ADDRESS] [DRIVE] [FIRSTSECTOR] [NUMBER]
MOVE M RANGE ADDRESS
NAME N [PATHNAME] [ARGLIST]
OUTPUT O PORT TYPE
PROCEED P [=ADDRESS] [NUMBER]
QUIT Q
REGISTER R [REGISTER]
SEARCH S RANGE LIST
TRACE T [=ADDRESS] [VALUE]
UNASSEMBLE U [RANGE]
WRITE W [ADDRESS] [DRIVE] [FIRSTSECTOR] [NUMBER]
6(i). Aim: To perform (i) addition and (ii) subtraction of two 8 bit numbers using
8086 microprocessor and get the result in
hexadecimal. Apparatus Used: MASM
SOFTWARE.
Program:
DATA SEGMENT
NUM DW 00h
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA, CS:CODE
START: MOVAX,DATA
MOV DS,AX
MOV AX,10H
ADD AX, 10H
MOV NUM,AX
INT 03H
CODE ENDS
END START
END
6(ii). Aim: To perform (i) addition and (ii) subtraction of two 8 bit numbers using
8086 microprocessor and get the result in
hexadecimal. Apparatus Used: MASM
SOFTWARE.
Program:
DATA SEGMENT
NUM DW 00h
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA, CS:CODE
START: MOV
AX,DATA MOV
DS,AX
MOV AX, 33H
SUB AX, 11H
MOV NUM, AX
INT 03H
CODE ENDS
END START
END
7(i). Aim: To perform (i) addition and (ii) subtraction of two 16 bit
numbers using 8086 microprocessor and get the result in hexadecimal.
Apparatus Used: MASM
SOFTWARE. Program:
DATA SEGMENT
NUM1 DW 1111H
NUM2 DW 2222H
RESULT DW 00
DATA ENDS
CODE SEGMENT
ASSUME CS: CODE, DS: DATA
START:
MOV AX, DATA
MOV DS, AX
MOV AX, 00H
MOV AX, NUM1
ADD AX, NUM2
MOV RESULT, AX
INT 03H
CODE ENDS
END START
END
7(ii). Aim: To perform (i) addition and (ii) subtraction of two 16 bits
numbers using 8085 microprocessor and get the result in hexadecimal.
Apparatus Used: MASM
SOFTWARE. Program:
DATA
SEGME
NT
NUM1 DW 5555H
NUM2 DW 2222H
RESULT DW 00
DATA ENDS
CODE SEGMENT
ASSUME CS: CODE, DS: DATA
START:
MOV AX, DATA
MOV DS, AX
MOV AX, 00H
MOV AX, NUM1
SUB AX, NUM2
MOV RESULT, AX
INT 03H
CODE ENDS
END START
END
8086 using numbers Bit 8. Aim: To perform multiplication of two 8s
microprocessor and get the result in hexadecimal.
Apparatus Used: MASM SOFTWARE.
Program:
MAIN SEGMENT
NUM1 DB 02
NUM2 DB 05
REST1 DB 00
REST2 DB 00
MAIN ENDS
MAT SEGMENT
START: MOV AX, MAIN
MOV DS, AX
MOV AX, 00
MOV AL, NUM1
MOV BL, NUM2
MUL BL
MOV REST1,
AL MOV
RSET2, AH
INT 03H
MAT ENDS
END START
END
Experiment no. (6)
1.1 Introduction
The first 50 years of the 20th century witnessed the invention of the
internal combustion engine, which greatly extended the physical strength of
the human body.
In the second half of the century, the birth of the microprocessor
further extended our mental capabilities. Applications of this amazing
product in various industries have introduced so much impact on our lives,
hence, it is called the second industrial Revolution.Microcomputers
represent a total change in designing systems. Both industrial and academic
institutions are active in the development and search for new applications for
microcomputers.
This book is designed to be used in conjunction with the "multi tech"
MDA-Win8086 Microcomputers as part of a one-year laboratory class on
microcomputers. With the aid of this book, students will be able to learn the
fundamentals of microcomputers, from basic CPU instructions to practical
applications.
The first part of this book is an introduction to the basic concepts of
microcomputer programming. It lays the foundation for year studies, the
second part of this book is the microcomputer hardware, such as ,
input/output, interrupt, timer and counter experiment, and experiments using
microcomputer instructions, such as, data transfers, arithmetic and logic
operations, jump and subroutine and memory address allocation in simple
program. Experiments involving more complicated arithmetic operations,
such as, binary to decimal conversion, decimal to binary conversion,
multiplication, division are presented.
There are various experiments in this book which are designed to
familiarize the student with the fundamentals of input/output programming.
These programs are centered around the keyboard and display. These
experiments establish the foundation for later experiments involving a
simple monitor program, which leads to more complicated MDA-Win8086
programs.
KEYBOARD
8253(TIMER/COUNTER)
To select the Machine Code and Serial monitor mode with P1 switch.
Solution
※ REG , + , - KEY : Display to register contents.
8. Microprocessor Lab Viva Questions with Answers
1.What is a Microprocessor?
Microprocessor is a CPU fabricated on a single chip, program-controlled device,
which fetches the instructions from memory, decodes and executes the instructions.
3. What is Bandwidth ?
The number of bits processed by the processor in a single instruction.
37.What is an Interrupts
Def:- An interrupt operation suspends execution of a program so that the system can
take special action.The interrupt routine executes and normally returns control to the
interrupted procedure, which then resumes execution.BIOS handles Int 00H-1FH,
whereas DOS handles INT 20H-3FH.
39.What is an Operand?
A:-The data on which the operation is to be performed is called as an Operand.
43.What is an Instruction?
A:-An instruction is a binary pattern enetered through an input device to command the
microprocessor to perform that specific function.
45.What is Assembler?
A:-The assembler translates the assembly language program text which is given as
input to the assembler to their binary equivalents known as object code.
The time required to translate the assembly code to object code is called access
time.The assembler checks for syntax errors&displays them before giving the object
code.
46.Define Variable?
A:-A Variable is an identifier that is associated with the first byte of data item
47.Explain Dup?
A:-The DUP directive can be used to initialize several location & to assign values to
these locations.
48.Define Pipelining?
A:-In 8086,to speedup the execution program,the instructions fetching and execution
of instructions are overlapped each other.this is known as Pipelining.
55.What are the 4 Segments? A:-Code Segment Register {CS} Data Segment Register
{DS} Extra Segment Register {ES} Stack Segment Register{SS}
62. What is the drawback in machine language and assembly language, programs?
The machine language and assembly language programs are machine dependent. The
programs developed using these languages for a particular machine cannot be directly
run on another machine .
The signal M/IO is used to differentiate memory address and 1/0 address When the
processor is accessing memory locations MI 10 is asserted high and when it is accessing
1/0 mapped devices it is asserted low.
70. What are the control words of 8251A and what are its functions ?
The control words of 8251A are Mode word and Command word. The mode word
informs 8251 about the baud rate, character length, parity and stop bits. The command
word can be send to enable the data transmission and reception.
71. What are the information that can be obtained from the status word of
8251 ?
The status word can be read by the CPU to check the readiness of the transmitter or
receiver and to check the character synchronization in synchronous reception. It also
provides information regarding various errors in the data received. The various error
conditions that can be checked from the status word are parity error, overrun error and
framing error.