MSC Lab Manual-Mp
MSC Lab Manual-Mp
AIM:
APPARATUS REQUIRED:
ALGORITHM:
8-BIT MULTIPLICATION:
PROGRAM:
ALGORITHM:
8-BIT DIVISION:
PROGRAM:
PROCEDURE:
OBSERVATION :
Thus the assembly language programs for 8-bit multiplication and division are
written, executed and the results are verified.
FLOW CHART
START
no
IF CY =0
yes
INCREMENT D REG
DECREMENT C REG
yes
IF NO ZERO
no
STOP
FLOW CHART
START
CLEAR C REG
no
IF CY =1
yes
STOP
2.16-BIT ADDITION AND SUBTRACTION
AIM:
APPARATUS REQUIRED:
16-BIT ADDITION:
ALGORITHM:
PROGRAM:
16-BIT SUBTRACTION:
ALGORITHM:
OBSERVATION :
RESULT:
Thus the assembly language programs for 16-bit addition and subtraction are
written, executed and the results are verified.
4. 16-BIT MULTIPLICATION AND DIVISION
AIM:
APPARATUS REQUIRED:
ALGORITHM:
16-BIT MULTIPLICATION:
PROGRAM:
16-BIT DIVISION:
ALGORITHM:
PROGRAM:
PROCEDURE:
OBSERVATION :
RESULT:
Thus the assembly language program for 16-bit multiplication is written, executed
and the results are verified.
5. (A) ARITHMETIC OPERATIONS USING BCD NUMBERS
AIM:
APPARATUS REQUIRED:
BCD ADDITION:
ALGORITHM:
PROGRAM:
BCD SUBTRACTION:
ALGORITHM:
PROGRAM:
ALGORITHM:
PROGRAM:
PROCEDURE:
RESULT:
Thus the assembly language programs for BCD Addition, BCD Subtraction and
Bit manipulation (BCD to Binary conversion) are written, executed and the results are
verified.
6.CODE CONVERSION
AIM:
APPARATUS REQUIRED:
BINARY TO ASCII:
ALGORITHM:
PROGRAM:
4112
4113 Code: CPI 0A Compare immediate 0a with the content
of accumulator
4114
4115 JC L1 Jump on carry to label location L1
4116 ADI 07 ADD immediate 07, with the content of
accumulator
4117
4118 L1 ADI 30 ADD immediate 30, with the content of
accumulator
4119
411A RET Return to main program
OBSERVATION :
Thus the assembly language programs for the code conversion (Binary to ASCII
and ASCII to Binary) are written, executed and the results are verified.
VIVA QUESTIONS:
AIM:
To interface Keyboard/Display controller(8279) with 8085 processor and to
display a particular string.
PROGRAM:
RESULT:
The Keyboard/Display controller is interfaced with 8085 and the character display
is verified.
AIM:To Write A Program to move a block of data from one location to another location
using processor 8085,To add an array of numbers
APPARATUS REQUIRED:
PROGRAM:
LXI H, add1
LXI B, add2
MVI D, count
Loop1: MOV A,M
STAX B
INX H
INX B
DCR D
JNZ Loop1
HLT
LXI H, add
MVI D,00
MOV C,M
INX H
MOV A,M
Loop1: INX H
MOV B,M
ADD B
JNC Loop
INR D
Loop : DCR C
JNZ Loop1
STA add1
MOV A,D
STA add2
HLT
OBSERVATION :
MOVING A BLOCK
Binary(HEX) to ASCII Address Data
Input 4200 02
4201 08
4202 09
Output 4500 02
4501 08
4502 09
ADDING AN ARRAY
Address Data
Input 4200 02
4201 08
4202 03
Output 4500 OD
RESULT:
Thus the assembly language programs for moving an array of data and adding an
array of data are written, executed and the results are verified.
9 PROGRAMS FOR SORTING/ SEARCHING (USING 8085,8086)
AIM:To Write A Program to sort the given numbers using 8085 and 8086
APPARATUS REQUIRED:
8085 Kit and Power supply
PROGRAM:
i) Sorting of an array of 8-bit numbers using 8085
LXI H,add1
MOV B,M
MOV C,B
Loop3: LXI H,add1
MOV D,B
Loop2: MOV A,M
INX H
MOV B,M
CMP B
JC / JNC Loop1
MOV M,A
DCX H
MOV M,B
INX H
Loop1: DCR D
JNZ Loop2
DCR C
JNZ LooP3
HLT
ii) Searching a number in an array of data using 8085
MVI D,00
LXI H, add
MOV C,M
INX H
MOV B,M
Loop2: INX H
MOV A,M
CMP B
JNZ Loop1
INR D
Loop1: DCR C
JNZ Loop2
MOV A,D
STA add
HLT
OBSERVATION:
SORTING:
Address Data
Input 4200 02
4201 08
4202 03
4203 09
Output 4500 02
4501 03
4502 08
4503 09
SEARCHING:TO SEARCH 02
Address Data
Input 4200 02
4201 08
4202 03
4203 09
Output 4500 02
RESULT:
Thus the assembly language programs for sorting and searching in an array of data
are written, executed and the results are verified
13.INTERFACING & PROGRAMMING 8259
A0 – Address with A0 = 0
A1 – Address with A0 = 1
1.Initialize 8259 for the given specification
2.Send ICW1 to A0
3.Send ICW2 to A1
4.Send ICW4 T0 A1
5.Send OCW1 to A1
6.Send OCW2 To A0
Using 8085:
MVI A, ICW1
OUT A0
MVI A,ICW2
OUT A1
MVI A,ICW4
OUT A1
MVI A,OCW1
OUT A1
HLT
ISR: MVI A,OCW2 ; Non-specific EOI command
OUT A0
HLT
KIT2:
MVI A, C0 ; Control word to set PA in mode2
OUT CR
LOOP: IN PC ; check the status of IBF
ANI 20
JZ LOOP
IN PA ; get data
STA ADD
LOOP1: IN PC ; Control word to set PA in mode2
ANI 90
JZ LOOP1
MVI A, DATA ; Transfer data
OUT PA
HLT
11. REVERSING AN ARRAY OF DATA
AIM:
APPRATUS REQUIRED:
8085 KIT
ALGORITHM:
PROGRAM:
PROCEDURE::
RESULT:
Thus reversing an array of element is executed successfully and the output is
verified.
Start
NO
If
CY=1
YES
Stop
FLOWCHART FOR REVERSING AN ARRAY OF ELEMENTS
1.ADDITION OF TWO 8 BIT NUMBERS
AIM:
To write a program for adding the given two 8- bit number and store the result
in the memory .
APPARATUS REQUIRED:
Microprocessor :Intel 8085
Operating Frequency :3.012MHz
User RAM Area :4100-5FFF
ALGORITHM:
PROCEDURE:
1. Key in opcode from the address specified
2. Enter data to 4200, 4201.
3. Execute the program and check the result at 4202 and 4203.
RESULT:
Thus the 8-bit addition with carry is performed.
CONTENT ADDRESS FIELD DATA FIELD
OUTPUT FIELD
4202 0DH
4203 00H
11.INTERFACING STEPPER MOTOR WITH 8086 USING 8255
AIM:
To write an assembly language program to interface stepper motor with 8086.
APPARATUS REQUIRED:
8086 microprocessor kit
Key board
Stepper motor
Stepper motor Interface Board
THEORY:
A motor in which the rotor is able to assume only discrete stationary angular
position is a stepper motor. The basic two-phase motor has two pairs of stator poles
with its own windings. The excitation of any one winding generates a north and South
Pole gets induced at the diametrically opposite sides.
The stator frame is continuous and magnetic field passes through the cylindrical
annular ring. The rotor magnetic system has two end faces. The left face is
magnetized permanently as south pole and right face as north pole. North pole
structure is twisted with respect to south pole structure such that south pole comes in
between two north poles.Step angle is the minimum degree of rotation associated
with single step. Revolution is the number of steps needed to complete one rotation or
360 degree.
1. 1 0 0 1 09 1 0 1 0 0A
2. 0 1 0 1 05 0 1 1 0 06
3. 0 1 1 0 06 0 1 0 1 05
4. 1 0 1 0 0A 1 0 0 1 09
ALGORITHM:
1. Load the stepping sequence in DI register
2. Move the count value to CL register.
3. Move the contents of destination index to AL.
4. Output the loaded values between delay
5. Decrement the contents of DX register
6. If no zero jump to the L1
7. Increment destination index register.
8. Loop to loop1.
9. Move the delay value to BX register.
10. Decrement the contents of BX register
11. If no zero jump to L2.
12. Jump to beginning address
13. Stop the program.
14. Load the look up table values before execution
PROGRAM:
Start: MOV DI,1200
MOV CL,04
Loop1:MOV AL,[DI]
OUT C0,AL
L1: MOV DX,1010
DEC DX
JNZ L1
INC DI
LOOP LOOP1
MOV BX,0FFF
L2: DEC BX
JNZ L2
JMP Start
HLT
PROCEDURE:
1.Key in the code from the address specified
2Enter the count value and enter the look up table value at the specified address
3.Execute the program and check the result.
RESULT:
Thus program to perform stepper motor interface with 8086 was executed and
verified.
START
IF
DI>Cou
nt
CALL DELAY
STOP
13.SQUARE WAVE GENERATION USING 8253 INTERFACE WITH 8086
AIM:
To write an assembly language program to generate a square wave using 8253
interfacing with 8086 processor.
APPARATUS REQUIRED:
8086 microprocessor kit
Key board
8253 Interface Board
THEORY:
8253 acts as Timer/Counter. It generates accurate time delays and square
waves. contains three 16 bit independent counters. The device has 6 different
counting modes including square wave generation and monostable operation.
Control word:
0 0 1 1 0 1 1 0
D7 D0
D7:D6 - Counter 0
D5:D4 - LSB first MSB next
D3:D1 - Square wave rate generator
D0 - Binary Code
Divisor Value:
Divisor Value = Clock frequency of Counter0
Desired Frequency
ALGORITHM:
1. Load the Control word
2. Output the value through the port
3. Load the divisor value to count the specific frequency (LSB value)
4. Output the value through the port
5. Load the divisor value to count the specific frequency (MSB value)
6. Output the value through the port
7. Stop the program.
PROGRAM:
MOV AL,36
OUT 16,AL
MOV AL,0A
OUT 10,AL
MOV AL,00
OUT 10,AL
HLT
PROCEDURE:
1. Key in the code from the address specified
2. Load the control word for specific frequency
3. Execute the program and check the result.
RESULT:
Thus the square wave was generated by interfacing 8086 with 8253 and the
program was executed and verified.
14.TRAFFIC CONTROLLER USING 8255 WITH 8085
AIM:
To write an assembly language program to do traffic signal controller and store
result in memory.
APPARATUS REQUIRED:
Microprocessor : INTEL 8085
Operating frequency : 3.102 MHZ
User RAM area : 4100-5FFFH
ALGORITHM:
1. Load the HL-register pair, move the data OC to C-register.
2. Move the pair to A-register, out the counter
3. Increment HL pair, move HL pair to A-register.
4. Out the port A, increment HL pair.
5. Move the HL pair to A-register, out port B, call delay.
6. Increment HL pair, decrement C register.
7. If no jump to loop1, jump to start.
8. Push B, initialize 05 to C-register.
9. Move D-register to accumulator
10. OR the E-register
11. If no jump to loop, decrement C register.
12. If no jump to loop, pop the B-register.
13. Return.
PROGRAM:
PROCEDURE:
4. Key in opcode from the specified location.
5. Enter the data in 4500 to 4508.
RESULT:
Thus the traffic signal controller is carried out.
HEX LABEL
ADDRESS OPERAND COMMENTS
CODE MNEMONICS
4100 3A,00,42 LDA 4200 Load the accumulator with
data in 4200
4103 47 MOV B,A Move the contents of the
accumulator to B Register
4104 3A,01,42 LDA 4201 Load the accumulator with
data in 4201
4107 4F MOV C,A Move the contents of the
accumulator to C Register
4108 AF XRA A Clear A register
4109 16,00 MVI D,00
Clear D register
410B 80 ADD B Add the contents of B
Loop1
register to A
410C 27 DAA Decimal adjust the contents
of accumulator
410D D2,11,41 JNC Loop Jump to given location if
there is no carry
4110 14 INR D Increment the D register
4111 0D Loop DCR C Decrement the C register
4112 C2,0B,41 JNZ Loop1 Jump on no zero to Loop1
4115 32,02,42 STA 4202 Store the content of A to the
location 4202
4118 7A MOV A,D Move the contents of the to
D Register to accumulator
4119 32,03,42 STA 4203 Store the content of A to the
location 4202
411C 76 HLT Stop the current Program
PROCEDURE:
1. Key in opcode from the address specified
2. Enter data to 4200, 4201.
3. Execute the program and check the result at 4202 and 4203.
RESULT:
Thus the 8-bit BCD multiplication is performed.
OUTPUT FIELD
4202 12H
4203 00H