Professional Documents
Culture Documents
Microprocessor LAB Format
Microprocessor LAB Format
Experiment No. : 1
THEORY: DEBUG is a command in DOS, OS/2 and Microsoft Windows (only in 32bit) which runs
the program debug.exe (or DEBUG.COM in older versions of DOS). Debug can act as an assembler,
disassembler, or hex dump program allowing users to interactively examine memory contents (in
assembly language, hexadecimal or ASCII), make changes, and selectively execute COM, EXE and other
file types. It also has several subcommands which are used to access specific disk sectors, I/O ports and
memory addresses.
Debugging functions.
DEBUG COMMAND:-
Debug commands may be divided into four categories: program creation/debugging,memory
manipulation, miscellaneous, and input-output:
Memory Manipulation
C= Compare one memory range with another
D= Dump (display) the contents of memory
E= Enter bytes into memory
F= Fill a memory range with a single value
M= Move bytes from one memory range to another
S= Search a memory range for specific value(s)
Miscellaneous
H =Perform hexadecimal addition and subtraction
Q =Quit Debug and return to DOS
Input-Output
I= Input a byte from a port
L= Load data from disk
O= Send a byte to a port
N= Create a filename for use by the L and W commands
W= Write data from memory to disk
Experiment No. 2
AIM: write a program in assembly language to enter two values in register and perform
addition
START
Move to AX
Move BX to AX
Move to AX
Add AX to BX
STOP
OBSERVATION TABLE:-
Conclusion:
Hence the program was successfully executed.
Experiment No. 3
AIM: write a program in assembly language to enter two values in register and perform
subtraction.
ALGORITHM:
1. Initialize G.P. register
2. Transfer data 05 in AX
3. Transfer data in 04 BX
4. subtract the data
5. Stop
FLOWCHART
START
Initialize g.p.register
Move data in AX
Move data in BX
SUB AX FROM BX
STOP
OBSERVATION TABLE:-
Experiment No. 4
AIM: write a program in assembly language to enter two values in register and perform
multiplication.
ALGORITHM:
1. Initialize AX register
2. Initialize BX register
3. multiply the data
4. Stop
FLOWCHART
START
Move 05 in AX
Move 02 in BX
Multiplication of AX and BX
STOP
OBSERVATION TABLE:-
Conclusion:
Hence the program was successfully executed.
Experiment No. 5
AIM: write a program in assembly language to enter two values in register and perform
division.
ALGORITHM:
1. Initialize AX register
2. Initialize BX register
3. divide the data AX from BX register
4. Stop
FLOWCHART
START
Move to AX
Move to BX
DIV AX AND BX
STOP
OBSERVATION TABLE:-
Conclusion:
Experiment No. 6
AIM: Write a program to add a data byte located at offset 0500H in 2000H segment to
another data byte available at 0600H in same segment and store the resulting 0700H in same
segment.
ALGORITHM:
1) Initialise segment register
2) Get contain in 0500H in G.P. register
3) Perform addition
4) store result in 0700H
FLOWCHART
START
Perform Addition
STOP
OBSERVATION TABLE:-
Conclusion:
Hence the program was successfully executed.
Experiment No. 7
AIM: Write a program to find out the largest number from an unordered array of sixteen 8-
bit numbers stored sequentially in the memory location starting at offset 0500H in the
segment 2000H.
ALGORITHM:
1) Initialize counter for number of iterations.
2) Intialize data segment
3) Initialize source index
4) Take first number in AX
5) Increment source index
6) Compare next number with previous
7) If the next number is larger
8) Replace the previous one with the next
9) Repeat the procedure 5 times.
FLOWCHART
START
No Next
no.>1
st ?
?
yes
Replace the first number by the next number
EC-501 MICROPROCESSOR
STOP AND ITS APPLICATION
OBSERVATION TABLE:-
Conclusion:
Hence the program was successfully executed.
Experiment No. 8
AIM: Write a program to move a byte string, 16 bytes long, from the offset 0200H to
0300H in the segment 7000H.
ALGORITHM:
1) Data segment initialization
2) Initialize source pointer
3) Initialize destination pointer
4) Initialize counter for number of iteration
5) Take a source byte in AX
6) Move it to destination
7) Increment source pointer
8) Increment destination pointer
9) Decrement counter by 1
10) Continue if count is not 0
11) Stop if the count is 0
FLOWCHART
START
NO
Counter=0
?
yes
STOP
OBSERVATION TABLE:-
Conclusion:
Hence the program was successfully executed.
Experiment No. 9
EC-501 MICROPROCESSOR AND ITS APPLICATION
AIM: write a program to find out the number of even and odd number from a given series of
16 bit hexadecimal numbers.
ALGORITHM:
1. Clear BX and DX
2. Initialize data segment
3. Initialize counter for number of iteration
4. Initialize source pointer
5. Take first number in AX
6. Rotate the AX register by one bit
7. If carry flag is set increment of BX
8. If carry flag is not set increment of DX
9. Repeat this procedure till counter=0
FLOWCHART
START
Yes Increment of BX
Carry?
No
Increment of DX
No
CX=0
?
Yes
STOP
OBSERVATION TABLE:-
Conclusion:
Experiment No. 10
THEORY:
The Intel 8086 is a 16-bit microprocessor intended to be used as the CPU in a
Microcomputer. This is one step above 8085 (8-bit) microprocessor. The term '16-bit"
means that its arithmetic logic unit, internal registers, and most of its instructions are
designed to work with 16-bit binary words. The 8086 has a 16-bit data bus, so it can
read data from or write data to memory and ports either 16 bits or 8 bits at a time. As
its address bus is 20-bit wide, it can address memory upto 1,048,576 locations. Each
of the 1 MB locations represents bite-wide. Therefore it is necessary to study
by experimentation how an 8086 microprocessor responds for various conditions.
Microprocessor trainer Model MPT-86, is an 8086 trainer. Using this trainer, students
studying in, electronics, electrical, instrumentation, mechanical, chemical
engineering subjects, B.Sc. (electronics, computers, and physics) laboratory, and
polytechnics can learn programming an 8086 Microprocessor. This can be used to
some extent for designing prototypes.
SPECIFICATIONS:
HARDWARE FEATURES:
CPU 8086 with 6. 144MHz crystal working in maximum/minimum mode.
Memory: 32K EPROM : 32K RAM
Keys: 24 Software programmable keys.
Display: 7 numbers of high bright 7 segment displays for Data and address.
I/O port: One 8255 programmable peripheral interface port
Software: Enter, Alter, Increment! Decrement address, Move, Fill, POS etc.
Built-in Power supply
Memory: 16 KB Monitor ROM organized as 8KB x 2 ROM 16 KB RAM organized
as 8KB X 2 RAM.
50 pin flat cable termination for 24 parallel port lines using 8255
SOFTWARE FEATURES:
Program Entry
PROGRAM EXECUTION:
Program could be executed from the current user CS: IP contents.
Set a new CS: IP value through GO key. The code segment and instruction pointer
values are automatically decoded by the system from the 5 digit address .
Single step execution in RAM / ROM.Break set facility. The break set could be cleared
only through break clear function, Break clear.
Facility for register display / alter the contents in REG mode or in STEP/execution with
break.
DIAGRAM:
Experiment No. 11
THEORY:
An assembler is a program that creates object code by translating combinations of
mnemonics and syntax for operations and addressing modes into their numerical
equivalents. This representation typically includes an operation code ("opcode") as well as
other control bits.[2] The assembler also calculates constant expressions and resolves
symbolic names for memory locations and other entities.[3] The use of symbolic references is
a key feature of assemblers, saving tedious calculations and manual address updates after
program modifications. Most assemblers also include macro facilities for performing textual
substitution – e.g., to generate common short sequences of instructions as inline, instead of
called subroutines.
Some assemblers may also be able to perform some simple types of
instruction set-specific optimizations. One concrete example of this may be the ubiquitous
x86 assemblers from various vendors. Most of them are able to perform jump-instruction
replacements (long jumps replaced by short or relative jumps) in any number of passes, on
request. Others may even do simple rearrangement or insertion of instructions, such as some
assemblers for RISC architectures that can help optimize a sensible instruction scheduling to
exploit the CPU pipeline as efficiently as possible.
There may be several assemblers with different syntax for a particular CPU or
instruction set architecture. For instance, an instruction to add memory data to a register in a
x86-family processor might be add eax,[ebx], in original Intel syntax, whereas this would
be written addl (%ebx),%eax in the AT&T syntax used by the GNU Assembler. Despite
different appearances, different syntactic forms generally generate the same numeric
machine code, see further below. A single assembler may also have different modes in order
EC-501 MICROPROCESSOR AND ITS APPLICATION
to support variations in syntactic forms as well as their exact semantic interpretations (such
as FASM-syntax, TASM-syntax, ideal mode etc., in the special case of x86 assembly
programming).