SlideShare a Scribd company logo
5
Most read
7
Most read
10
Most read
Exp no: 1

                Program for 16-bit Addition & Subtraction in 8086 Microprocessor kit

Aim:
         To write an Assembly Language Program for 16-bit Addition & Subtraction in 8086
Microprocessor kit
Apparatus Required:
         8086 Microprocessor Trainer Kit with Power Supply.
Addition:
Algorithm:

      1. Start the Program
      2. Initialize the contents of memory locations in AX & BX registers
      3. Initialize the value 00 for CL register.
      4. Add the value of AX and BX by using ADD Mnemonics and store the result in a memory
         location.
      5. If there is carry Increment the value of CL register by 1, else move the content of AX to a
         location for result.
      6. Move the value of CL to a location for output.
      7. Stop the Program

Program:
Start: Mov AX,[2000H]
         Mov BX,[2002H]
         Mov CL,00
         ADD AX,BX
         JNC L1
         INC CL
L1:       Mov [2006H],AX
         Mov [2008H],CL
End:      HLT
Subtraction:
Algorithm:

      1. Start the Program
      2. Initialize the contents of memory locations in AX & BX registers
      3. Initialize the value 00 for CL register.
      4. Subtract the value of AX and BX by using SUB Mnemonics and store the result in a
          memory location.
      5. If there is carry Increment the value of CL register by 1, else move the content of AX to a
          location for result.
      6. Move the value of CL to a location for output.
      7. Stop the Program



Program:
Strat: Mov AX,[2000H]
          Mov BX,[2002H]
          Mov CL,00H
          SUB AX,BX
          JNC L1
          INC CL
L1:       Mov [2006H],AX
          Mov [2008H],CL
End:      HLT


Result:
          Thus the ALP to add and subtract 16 bit number using 8086 Microprocessor Kit was
written and executed successfully.
Exp no: 2
             Program for 16-bit Division & Multiplication in 8086 Microprocessor kit.
Aim:
       To write an Assembly Language Program for 16-bit Division & Multiplication in 8086
Microprocessor kit.


Apparatus Required:
       8086 Microprocessor Trainer Kit with Power Supply.
Multiplication:
Algorithm:

   1. start the program
   2. initialize the contents for AX and BX from memory locations
   3. Multiple the AX and BX value using MUL Mnemonics and store the result in a memory
       location.
   4. move the content of AX and DX to memory locations to check the result.
   5. stop the program

Program:
Start: mov AX,[2000H]
       mov BX,[2002H]
       MUL BX
       mov [2006H],AX
       mov [2008H],DX
end:   HLT
Division:
Algorithm:

   1. start the program
   2. initialize the contents for AX and BX from memory locations
   3. Multiple the AX and BX value using MUL Mnemonics and store the result in a memory
       location.
4. move the content of AX and DX to memory locations to check the result.
   5. stop the program

Program:
Start: mov AX,[2000H]
          mov BX,[2002H]
          DIV BX
          mov [2006H],AX
          mov [2008H],DX
end:      HLT


Result:
          Thus the ALP to multiple and divide 16 bit number using 8086 Microprocessor Kit was
written and executed successfully.
Exp no: 3
         Program for Ascending order and Descending order in 8086 Microprocessor kit.
Aim:
         To write an Assembly Language Program for Ascending order and Descending order in
8086 using MASM software.
Apparatus Required:
         MASM Software
Ascending order:
Algorithm:

     1. Start the program
     2. Declare the set of elements in list and initialize the count value in the data segment.
     3. In code segment(CS), move the data segment values to data segment register.
     4. Initialize the starting address of list to BX and count values to CX register.
     5. Get the succesive elements in source index(BX) and sort the elements in ascending order.
     6. Termination interrupt is performed to terminate the program.
     7. Stop the program.

Program:
          Assume CS:code,DS:Data
          Data Segment                    #Open the data segment
          List dw 05h,07h,06h,02h         #Declare the set of values to list
          Count equ 04h                   #Assign the control values
          Data ends                       #end of data segment
          Code segment                    #Open code segment
Start:    Mov AX,data                     #Assign the value of data to DS through an
                                          accumulator
          Mov DS,AX                       #Iniatilize AX value to DS
          Mov DX,count-1                  #Initialize the count register
L3        Mov CX,DX                       #Initialize the DX value to CX
          Mov BX,offset list              #Assign the first address of list to bx
L2        Mov AX,[BX]                     #Move the first value to AX
          Cmp AX,[BX+2]                   #Compare AX with successive element
          JL L1                           #Jump if AX < [BX+2] the goto L1
          XCHG [BX+02],AX                 #excahnge the values of [BX],AX
          XCHG [BX],AX                    #excahnge the values of [BX],AX
L1        Add BX,02h                      #increment the value BX value
Loop L2                          #goto L2
         Dec DX                           #Decrement by the value Dx
         JNZ L3                           #if DX is No Zere, goto L3
         Mov AH,4Ch                       #interrupt signal
         Int 21h                          # interrupt signal
         Code ends                        #end the code segment
End start                                 #end of start



Descending order:
Algorithm:

     1. Start the program
     2. Declare the set of elements in list and initialize the count value in the data segment.
     3. In code segment(CS), move the data segment values to data segment register.
     4. Initialize the starting address of list to BX and count values to CX register.
     5. Get the succesive elements in source index(BX) and sort the elements in descending
         order.
     6. Termination interrupt is performed to terminate the program.
     7. Stop the program.



Program:
          Assume CS:code,DS:Data
          Data Segment                    #Open the data segment
          List dw 05h,07h,06h,02h         #Declare the set of values to list
          Count equ 04h                   #Assign the control values
          Data ends                       #end of data segment
          Code segment                    #Open code segment
Start:    Mov AX,data                     #Assign the value of data to DS through an
                                          accumulator
          Mov DS,AX                       #Iniatilize AX value to DS
          Mov DX,count-1                  #Initialize the count register
L3        Mov CX,DX                       #Initialize the DX value to CX
          Mov BX,offset list              #Assign the first address of list to bx
L2        Mov AX,[BX]                     #Move the first value to AX
          Cmp AX,[BX+2]                   #Compare AX with successive element
          JG L1                           #Jump if AX > [BX+2] the goto L1
          XCHG [BX+02],AX                 #excahnge the values of [BX],AX
XCHG [BX],AX                   #excahnge the values of [BX],AX
L1       Add BX,02h                     #increment the value BX value
         Loop L2                        #goto L2
         Dec DX                         #Decrement by the value Dx
         JNZ L3                         #if DX is No Zere, goto L3
         Mov AH,4Ch                     #interrupt signal
         Int 21h                        # interrupt signal
         Code ends                      #end the code segment
End start                               #end of start



Result:
   Thus , the Assembly language program for sort the elements in ascending and descending
order was written , executed successfully and the output was verified.
Exp no:4
                                     Program for String copy.
Aim:
         To write an Assembly Language Program for String Copy in 8086 using MASM
software.


Apparatus Required:
         MASM Software


Algorithm:

    1. Start the program
    2. In the data segment initialize the elements in array (source), initialize the destination
         address to des and counter value.
    3. In code segment(CS), move the data segment value to data segment register.
    4. Initialize the starting address of source to SI and move the des, count value to DI,CX.
    5. Swap the elements to specified address with the use of cld rep MOVSW command.
    6. Use interrupt to terminate the program.
    7. Stop the program.



Program:
          Assume CS:code,DS:Data
          Data segment
          Source dw 01h,05h,06h
          Des equ 3000h
          Count equ 03h
          Data ends
          Cod segment
Start:    Mov AX, data
          Mov ds, AX
          Mov SI, offset source
          Mov d1,des
          CLD
          Rep movsw
          Mov ab,4ch
Int 21h
End:        Code ends
            End start

Result:
          Thus, the ALP for string copy using 8086 was executed successfully and the output was
verified.
Exp no: 5
                                   Program for Reverse the String.
Aim:
         To write an Assembly Language Program for Reverse the String in 8086 using MASM
software.
Apparatus Required:
         MASM Software
Algorithm:

    1. Start the program
    2. In the data segment, initialize the elements in array named as src, initialize the empty
         array size as ds and the count value.
    3. In code segment (CS), move the data segment value to data segment register.
    4. Move the count value (count +1) to count register and define the offset address of des to
         di and move the 06h to dx.
    5. Define the offset address of src to s1 then move the s1 to bx then bx to dx.
    6. Decrement the destination index then subtract the source index value.
    7. Decrement the CX if nonzero goto step 5.
    8. Stop the program.

Program:
         Assume cs: code, ds: data
         Data segment
         src dw 09h,08h,07h
         des dw 10h
         count equ 03h
         data ends

         code segment
start:   mov ax, data
         mov ds, ax
         mov cx,count+1
         mov di, offset des
         mov dx, 06h
         mov si, offset src
         add si, dx
loop: mov bx, [si]
      mov [di], bx
      add di, 02h
      dec cx
      jnz loop
      mov ah, 4ch
      int 21h
      code ends
      end start.

RESULT:
       Thus the ALP for reverse the string in 8086 was written and executed successfully and
the output was verified.
Exp no:6
                                    Program for Searching an Element.
   Aim:
           To write an Assembly Language Program for Searching the given element in 8086 using
   MASM software.
   Apparatus Required:
           MASM Software
   Algorithm:

       1. Start the program.
       2. Initialize all the elements of array and named them.
       3. Define the messages in disp1 and disp2.
       4. Initialize the counter value in data segment.
       5. If counter reaches 0, goto step6, else do the following steps

 Load the list to accumulator and then load the counter value to counter register
 Compare the accumulator with given element, if it is present display the message as “data is
   present” else jump to loop.
 If it is not present , display the message as “Data is not present”

       6. Stop the program.

   Program:
           Assume cs: code, ds: data
           Data segment
           List dw 05h, 06h, 07h, 08h, 09h
           Disp1 db “Data is present”,”&”
           Disp2 db “Data is not present”,”&”
           Count equ 05h
           Data ends

          Code segment
          Org 1000h
   Start: mov ax, data
          mov ds, dx
          mov si, offset list
          mov cx, count
loop: mov ax, [si]
        cmp ax, 05h
        jz loop1
        add si, 02h
        dec cx
        jnz loop
        jmp loop2
loop1: mov dx, offset disp1
        jmp loop3
loop2: mov dx, offset disp2
        jmp loop3
loop3: mov ah, 09h
        int 21h
        mov ah, 4ch
        int 21h
        code ends
end
Result:
        Thus, the ALP for searching an element was written and executed successfully and the
output was verified.
Exp no:7
                              Program for File Manipulation in 8086.
Aim:
          To write an Assembly Language Program for File Manipulation in 8086 using MASM
software.
Apparatus Required:
          MASM Software
Algorithm:

   1. Start the program
   2. In the data segment define byte for filename and named as FN
   3. In code segment, move the data segment values to ds register
   4. Initialize the address of FN to DX register.
   5. Interrupt command (3ch) is used to pen a file.
   6. Perform the termination using terminate interrupt for program.
   7. Stop the program.

Program:
          Assume cs: code, ds: data
          Data segment
          FN DB “siva.txt”,”$”
          Data ends
          Code segment

Start: mov ax, data
        mov ds, ax
        mov dx, offset FN
        mov cx, 00h
        mov ah,3ch
        int 21h
        code ends
end start

Result:
       Thus the ALP for file manipulation in 8086 using MASM software was written and
executed successfully and the output was verified.
Exp no: 8
             Interfacing of Stepper Motor controller using 8086 Microprocessor kit.
Aim:
       To write an Assembly Language Program for run Stepper Motor in clockwise and
anticlockwise direction using 8086 Microprocessor kit.
Apparatus Required:
       Microprocessor kit, Power cable, stepper motor kit and Data cable.
Algorithm:

   1. Start the program
   2. Initialize a memory location to DI
   3. Initialize the counter value as 04
   4. Move the content of DI to AL
   5. Write the AL value as 00h to port
   6. Move the content of memory location to DX.
   7. Decrement the DX value and if it is no zero call delay program.
   8. Increment the DI value and goto step 4
   9. Goto step 2.
   10. Stop the program

Clockwise direction values: - 09h, 05h, 06h , 0Ah, 09h
Anticlockwise direction values: - 09h , 0Ah, 06h, 05h, 09h


Program:
       L2:            MOV DI, [1018h]
                      MOV CL, 04
       L1:            MOV AL, [DI]
                      OUT 00, AL
                      MOV DX, [1010h]
       delay:         DEC DX
                      JNZ delay
                      INC DI
LOOP L1
                        JUMP L2
                        HLT
Clockwise direction values: - 09h, 05h, 06h, 0Ah, 09h
          Anticlockwise direction values: - 09h, 0Ah, 06h, 05h, 09h


Result:
          Thus, the assembly language program in 8086 for stepper motor in clockwise and
anticlockwise was written and executed successfully and the output was verified.
Exp no:9
               Interfacing of Keyboard / Display (8279) using Microprocessor kit.
Aim:
       To write an Assembly Language Program for Interfacing of Keyboard / Display (8279) in
8086 Microprocessor kit for displaying character „A‟ and rolling display.


Apparatus Required:
       Microprocessor kit, Power cable, 8279 keyboard/display kit and Data cable.
Algorithm for Character Display of „A‟:


   1. Start the program
   2. Initialize the AL as 00h and write the AL value to port.
   3. Enter the value for Character “A” as 88h
   4. Write the value to output port
   5. Goto step 4.
   6. Stop the program.



Program for Character Display of „A‟

MOV AL,00h
OUT C2,AL
MOV AL, CCh
OUT C2,AL
MOV AL,90h
OUT    C2,AL
MOV AL,88h
OUT C0,AL
MOV AL,FFh
OUT C2,AL
MOV CX,0006h
L1: OUT C0,AL
LOOP L1
     HLT



Algorithm for Rolling Display:


   1. Start the program
   2. Set the counter value for number of characters to roll and write the value port.
   3. Move the 10h, CCh, 90h value for number of characters to roll and write the value port.
   4. Move the roll character values to source index(SI) and write into port.
   5. Move the value 0A0Fh to the register DX
   6. Decrement it till reach 00h.
   7. If DX is no zero goto step 6 and increment Source index to accept next value
   8. Goto step 4.
   9. Stop the program.



Program for Rolling Display:

START: MOV SI,[2000h]
       MOV CX, 000Fh
MOV AL, 10h
OUT C2, AL
MOV AL, CCh
OUT C2,AL
MOV AL,90h
OUT C2,AL
   L1: MOV AL,[SI]
OUT C0,AL
MOV DX,0A0Fh
   L2: DEC DX
 JNZ L2
       INC SI
       LOOP L1
 JMP START

Result:               Thus, the assembly language program in 8086 to display the character „A‟
and roll the display was written and executed successfully and the output was verified.
Exp no:10
                            Interfacing of ADC with 8086 Microprocessor kit.
     Aim :
             To write an Assembly Language Program for Interfacing ADC in 8086 Microprocessor
     kit.


     Apparatus Required:
             Microprocessor kit, Power cable, ADC kit and Data cable
     Algorithm for ADC:

1. Start the program.
2. Move the control register values to AL register and write those values to ports.
3. Move the initial value 00yh to AL and write the value to port.
4. Accept the analog value from ADC kit and store it in AL.
5. Compare the AL with 01h, if it true and no zero goto step 4.
6.    Accept the analog value from port and store it in AL.
7. Move the value in AL to a memory Location [1500h].
8. Stop the program.

     Program for ADC:

     MOV AL,10h
     OUT     C8,AL
     MOV AL,18h
     OUT     C8,AL
     MOV AL,01h
     OUT D0,AL
     MOV AL,00h
     MOV AL,00h
     MOV AL,00h
     MOV AL,00h
     OUT D0,AL
L1:        IN    AL,D8
   AND          AL,01h
   CMP          AL,01h
  JNZ L1
       IN       AL,C0
       MOV BX,1500h
       MOV [BX],AL
       HLT



Result :
                Thus, the assembly language program in 8086 to convert the analog value to
digital using ADC convertor was written and executed successfully and the output was verified.
Exp no:11
                        Interfacing of DAC with 8086 Microprocessor kit.
Aim :
        To write an Assembly Language Program for Interfacing of DAC with 8086
Microprocessor kit for generating waveforms such as sine wave, triangular wave, saw tooth
wave and square wave.


Apparatus Required:
              Microprocessor kit, Power cable, DAC kit and Data cable.
Algorithm:
SAW TOOTH WAVE:

   1. Start the program
   2. Initialize the register AL as 00h
   3. Write the initial value in port
   4. Increment the AL value and check if no zero goto step 3.
   5. Stop the program



TRIANGULAR WAVE:

   1. Start the program
   2. Initialize the BL register as 00h
   3. Move the contents of BL to AL
   4. Write the AL value in Port
   5. Increment the BL value and check if it is no zero goto step 2
   6. Initialize the BL register as FFh
   7. Move the contents of BL to AL
   8. Write the AL value in Port
   9. Decrement the BL register and check if it is zero goto step 6
   10. Goto step 1
   11. Stop the program
SQUARE WAVE:

   1. Start the program
   2. Initialize the AL as 00h
   3. Write the port value of AL register and goto step
   4. Initialize as AL as highest value and write the AL value to port and call step 6.
   5. Goto step 2
   6. Move the contents of 05FFh to CX and goto step 5
   7. Stop the program



SINE WAVE :

   1. Start the program
   2. Initialize the look up table in a memory location
   3. Initialize the value 46h
   4. Move the contents of BX to AL
   5. Increment the BX value
   6. Write the AL value to ports goto step 4
   7. Goto step 2
   8. Stop the program



Program:
 SAW TOOTH WAVE:

 START : MOV AL,00h
    L1 : OUT C0,AL
INC AL
JNZ L1
JMP START

TRIANGULAR WAVE:

L3: MOV BL,00h
L1: MOV AL,BL
OUT C8,AL
INC BL
JNZ L1
MOV BL,FFh
L2: MOV AL,BL
OUT C8,AL
DEC BL
JNZ L2
JMP L3

SQUARE WAVE:
  START: MOV AL,00h
OUT C8,AL
CALL ROUTINE
MOV AL,FFh
OUT C8,AL
CALL ROUTINE
JMP START
ROUTINE : MOV CX,05FFh
      L3 : LOOP L3
           RET

SINE WAVE GENERATION:

START: MOV BX,1100h
        MOV CL,46h
   L1: MOV AL,[BX]
       OUT C0,AL
       INC   BX
       LOOP L1
       JMP START

Result :
              Thus, the assembly language program in 8086 to convert the digital values to
analog using DAC convertor for generating waveforms such as sine wave, triangular wave, saw
tooth wave and square wave was written and executed successfully and the output was verified.
Exp no:12
                              Interfacing of Timer with 8086 Microprocessor kit.
     Aim:
               To write an Assembly Language Program for Interfacing of Timer with 8086
     Microprocessor kit.


     Apparatus Required:
               Microprocessor kit, Power cable, Timer kit and Data cable.


     Algorithm:
1. Start the program.
2. Move the counter value to AL either it may be even or odd and write the AL value to output
     port.
3.   Move the highest value (10h) to AL either it may be even or odd and write the AL value to
     output port.
4. Move the initial value (00h) to AL either it may be even or odd and write the AL value to output
     port.
5. Stop the program.


     Program:
               Mov AL, 36h
               Out C8, AL
               Mov AL, 10h
               Out C8, AL
               Mov AL, 00h
               Out C8, AL
               HLT.


     Result:
                      Thus, the assembly language program in 8086 microprocessor interface with
     timer was written and executed successfully and the output was verified.

More Related Content

PPTX
object oriented programming(oops)
PPTX
2 d viewing computer graphics
PPTX
Kohonen self organizing maps
PDF
C++ chapter 1
PPT
Boundary fill algm
PPTX
2D viewing & clipping
PPTX
Intro to assembly language
object oriented programming(oops)
2 d viewing computer graphics
Kohonen self organizing maps
C++ chapter 1
Boundary fill algm
2D viewing & clipping
Intro to assembly language

What's hot (20)

PPTX
Interconnection Network
PPTX
Pipelining and vector processing
PPT
Fetch-execute Cycle
PPTX
instruction format.pptx
PPTX
Visual Programming
PPTX
Stack and subroutine
PPTX
Assembly Language
PDF
8086 memory segmentation
PPTX
Object Oriented Programming Languages
PPTX
8255 Programmable parallel I/O
PPTX
Memory Segmentation of 8086
PPTX
Computer graphics basic transformation
PPSX
Framing Protocols
PPTX
I/O Management
PPTX
Chess board problem(divide and conquer)
PPTX
Addressing modes of 8086
PPTX
Protection Domain and Access Matrix Model -Operating System
PPTX
Linker and Loader
PDF
CPU Scheduling
Interconnection Network
Pipelining and vector processing
Fetch-execute Cycle
instruction format.pptx
Visual Programming
Stack and subroutine
Assembly Language
8086 memory segmentation
Object Oriented Programming Languages
8255 Programmable parallel I/O
Memory Segmentation of 8086
Computer graphics basic transformation
Framing Protocols
I/O Management
Chess board problem(divide and conquer)
Addressing modes of 8086
Protection Domain and Access Matrix Model -Operating System
Linker and Loader
CPU Scheduling
Ad

Viewers also liked (12)

PPTX
Telesurgery
PDF
Microprocessor and Interfacing Notes
PDF
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
PPTX
Chapter5
PPT
1.microprocessor
PPTX
Microprocessor Architecture
PPT
Introduction to-microprocessors
PPT
Lecture 1
PDF
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
PPT
Microprocessor and-interfacing-techbymak
PDF
Microprocessor & Assembly language by team blackhole
PPTX
Microprocessor chapter 9 - assembly language programming
Telesurgery
Microprocessor and Interfacing Notes
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Chapter5
1.microprocessor
Microprocessor Architecture
Introduction to-microprocessors
Lecture 1
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor and-interfacing-techbymak
Microprocessor & Assembly language by team blackhole
Microprocessor chapter 9 - assembly language programming
Ad

Similar to Mpmc lab (20)

PDF
Assembly language 8086
PDF
Assembly language 8086 intermediate
PPTX
L12_ COA_COmputer architecurte and organization
PDF
Microprocessor 8086-lab-mannual
PPTX
Assembly language programs
PPT
8051assembly language
PDF
8086 labmanual
PDF
8086 labmanual
PDF
Exp 03
PDF
instruction set of 8086
PPT
1344 Alp Of 8086
PDF
8085 Assembly language programs.pdf
PPTX
Assembly language programs 2
DOCX
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
PPTX
Assembly Language Instructions & Programming.pptx
PPTX
Microprocessor and Microcontrollers LAB-PP.pptx
PPT
Stack and subroutine
PPTX
PPT
instruction-set-of-8086-mr-binu-joy3.ppt
PDF
8086 instructions
Assembly language 8086
Assembly language 8086 intermediate
L12_ COA_COmputer architecurte and organization
Microprocessor 8086-lab-mannual
Assembly language programs
8051assembly language
8086 labmanual
8086 labmanual
Exp 03
instruction set of 8086
1344 Alp Of 8086
8085 Assembly language programs.pdf
Assembly language programs 2
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
Assembly Language Instructions & Programming.pptx
Microprocessor and Microcontrollers LAB-PP.pptx
Stack and subroutine
instruction-set-of-8086-mr-binu-joy3.ppt
8086 instructions

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Institutional Correction lecture only . . .
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Basic Mud Logging Guide for educational purpose
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
VCE English Exam - Section C Student Revision Booklet
Week 4 Term 3 Study Techniques revisited.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Renaissance Architecture: A Journey from Faith to Humanism
PPH.pptx obstetrics and gynecology in nursing
01-Introduction-to-Information-Management.pdf
Pharma ospi slides which help in ospi learning
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Institutional Correction lecture only . . .
human mycosis Human fungal infections are called human mycosis..pptx
TR - Agricultural Crops Production NC III.pdf
Cell Types and Its function , kingdom of life
Basic Mud Logging Guide for educational purpose
2.FourierTransform-ShortQuestionswithAnswers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems
Supply Chain Operations Speaking Notes -ICLT Program
Abdominal Access Techniques with Prof. Dr. R K Mishra

Mpmc lab

  • 1. Exp no: 1 Program for 16-bit Addition & Subtraction in 8086 Microprocessor kit Aim: To write an Assembly Language Program for 16-bit Addition & Subtraction in 8086 Microprocessor kit Apparatus Required: 8086 Microprocessor Trainer Kit with Power Supply. Addition: Algorithm: 1. Start the Program 2. Initialize the contents of memory locations in AX & BX registers 3. Initialize the value 00 for CL register. 4. Add the value of AX and BX by using ADD Mnemonics and store the result in a memory location. 5. If there is carry Increment the value of CL register by 1, else move the content of AX to a location for result. 6. Move the value of CL to a location for output. 7. Stop the Program Program: Start: Mov AX,[2000H] Mov BX,[2002H] Mov CL,00 ADD AX,BX JNC L1 INC CL L1: Mov [2006H],AX Mov [2008H],CL End: HLT
  • 2. Subtraction: Algorithm: 1. Start the Program 2. Initialize the contents of memory locations in AX & BX registers 3. Initialize the value 00 for CL register. 4. Subtract the value of AX and BX by using SUB Mnemonics and store the result in a memory location. 5. If there is carry Increment the value of CL register by 1, else move the content of AX to a location for result. 6. Move the value of CL to a location for output. 7. Stop the Program Program: Strat: Mov AX,[2000H] Mov BX,[2002H] Mov CL,00H SUB AX,BX JNC L1 INC CL L1: Mov [2006H],AX Mov [2008H],CL End: HLT Result: Thus the ALP to add and subtract 16 bit number using 8086 Microprocessor Kit was written and executed successfully.
  • 3. Exp no: 2 Program for 16-bit Division & Multiplication in 8086 Microprocessor kit. Aim: To write an Assembly Language Program for 16-bit Division & Multiplication in 8086 Microprocessor kit. Apparatus Required: 8086 Microprocessor Trainer Kit with Power Supply. Multiplication: Algorithm: 1. start the program 2. initialize the contents for AX and BX from memory locations 3. Multiple the AX and BX value using MUL Mnemonics and store the result in a memory location. 4. move the content of AX and DX to memory locations to check the result. 5. stop the program Program: Start: mov AX,[2000H] mov BX,[2002H] MUL BX mov [2006H],AX mov [2008H],DX end: HLT Division: Algorithm: 1. start the program 2. initialize the contents for AX and BX from memory locations 3. Multiple the AX and BX value using MUL Mnemonics and store the result in a memory location.
  • 4. 4. move the content of AX and DX to memory locations to check the result. 5. stop the program Program: Start: mov AX,[2000H] mov BX,[2002H] DIV BX mov [2006H],AX mov [2008H],DX end: HLT Result: Thus the ALP to multiple and divide 16 bit number using 8086 Microprocessor Kit was written and executed successfully.
  • 5. Exp no: 3 Program for Ascending order and Descending order in 8086 Microprocessor kit. Aim: To write an Assembly Language Program for Ascending order and Descending order in 8086 using MASM software. Apparatus Required: MASM Software Ascending order: Algorithm: 1. Start the program 2. Declare the set of elements in list and initialize the count value in the data segment. 3. In code segment(CS), move the data segment values to data segment register. 4. Initialize the starting address of list to BX and count values to CX register. 5. Get the succesive elements in source index(BX) and sort the elements in ascending order. 6. Termination interrupt is performed to terminate the program. 7. Stop the program. Program: Assume CS:code,DS:Data Data Segment #Open the data segment List dw 05h,07h,06h,02h #Declare the set of values to list Count equ 04h #Assign the control values Data ends #end of data segment Code segment #Open code segment Start: Mov AX,data #Assign the value of data to DS through an accumulator Mov DS,AX #Iniatilize AX value to DS Mov DX,count-1 #Initialize the count register L3 Mov CX,DX #Initialize the DX value to CX Mov BX,offset list #Assign the first address of list to bx L2 Mov AX,[BX] #Move the first value to AX Cmp AX,[BX+2] #Compare AX with successive element JL L1 #Jump if AX < [BX+2] the goto L1 XCHG [BX+02],AX #excahnge the values of [BX],AX XCHG [BX],AX #excahnge the values of [BX],AX L1 Add BX,02h #increment the value BX value
  • 6. Loop L2 #goto L2 Dec DX #Decrement by the value Dx JNZ L3 #if DX is No Zere, goto L3 Mov AH,4Ch #interrupt signal Int 21h # interrupt signal Code ends #end the code segment End start #end of start Descending order: Algorithm: 1. Start the program 2. Declare the set of elements in list and initialize the count value in the data segment. 3. In code segment(CS), move the data segment values to data segment register. 4. Initialize the starting address of list to BX and count values to CX register. 5. Get the succesive elements in source index(BX) and sort the elements in descending order. 6. Termination interrupt is performed to terminate the program. 7. Stop the program. Program: Assume CS:code,DS:Data Data Segment #Open the data segment List dw 05h,07h,06h,02h #Declare the set of values to list Count equ 04h #Assign the control values Data ends #end of data segment Code segment #Open code segment Start: Mov AX,data #Assign the value of data to DS through an accumulator Mov DS,AX #Iniatilize AX value to DS Mov DX,count-1 #Initialize the count register L3 Mov CX,DX #Initialize the DX value to CX Mov BX,offset list #Assign the first address of list to bx L2 Mov AX,[BX] #Move the first value to AX Cmp AX,[BX+2] #Compare AX with successive element JG L1 #Jump if AX > [BX+2] the goto L1 XCHG [BX+02],AX #excahnge the values of [BX],AX
  • 7. XCHG [BX],AX #excahnge the values of [BX],AX L1 Add BX,02h #increment the value BX value Loop L2 #goto L2 Dec DX #Decrement by the value Dx JNZ L3 #if DX is No Zere, goto L3 Mov AH,4Ch #interrupt signal Int 21h # interrupt signal Code ends #end the code segment End start #end of start Result: Thus , the Assembly language program for sort the elements in ascending and descending order was written , executed successfully and the output was verified.
  • 8. Exp no:4 Program for String copy. Aim: To write an Assembly Language Program for String Copy in 8086 using MASM software. Apparatus Required: MASM Software Algorithm: 1. Start the program 2. In the data segment initialize the elements in array (source), initialize the destination address to des and counter value. 3. In code segment(CS), move the data segment value to data segment register. 4. Initialize the starting address of source to SI and move the des, count value to DI,CX. 5. Swap the elements to specified address with the use of cld rep MOVSW command. 6. Use interrupt to terminate the program. 7. Stop the program. Program: Assume CS:code,DS:Data Data segment Source dw 01h,05h,06h Des equ 3000h Count equ 03h Data ends Cod segment Start: Mov AX, data Mov ds, AX Mov SI, offset source Mov d1,des CLD Rep movsw Mov ab,4ch
  • 9. Int 21h End: Code ends End start Result: Thus, the ALP for string copy using 8086 was executed successfully and the output was verified.
  • 10. Exp no: 5 Program for Reverse the String. Aim: To write an Assembly Language Program for Reverse the String in 8086 using MASM software. Apparatus Required: MASM Software Algorithm: 1. Start the program 2. In the data segment, initialize the elements in array named as src, initialize the empty array size as ds and the count value. 3. In code segment (CS), move the data segment value to data segment register. 4. Move the count value (count +1) to count register and define the offset address of des to di and move the 06h to dx. 5. Define the offset address of src to s1 then move the s1 to bx then bx to dx. 6. Decrement the destination index then subtract the source index value. 7. Decrement the CX if nonzero goto step 5. 8. Stop the program. Program: Assume cs: code, ds: data Data segment src dw 09h,08h,07h des dw 10h count equ 03h data ends code segment start: mov ax, data mov ds, ax mov cx,count+1 mov di, offset des mov dx, 06h mov si, offset src add si, dx
  • 11. loop: mov bx, [si] mov [di], bx add di, 02h dec cx jnz loop mov ah, 4ch int 21h code ends end start. RESULT: Thus the ALP for reverse the string in 8086 was written and executed successfully and the output was verified.
  • 12. Exp no:6 Program for Searching an Element. Aim: To write an Assembly Language Program for Searching the given element in 8086 using MASM software. Apparatus Required: MASM Software Algorithm: 1. Start the program. 2. Initialize all the elements of array and named them. 3. Define the messages in disp1 and disp2. 4. Initialize the counter value in data segment. 5. If counter reaches 0, goto step6, else do the following steps  Load the list to accumulator and then load the counter value to counter register  Compare the accumulator with given element, if it is present display the message as “data is present” else jump to loop.  If it is not present , display the message as “Data is not present” 6. Stop the program. Program: Assume cs: code, ds: data Data segment List dw 05h, 06h, 07h, 08h, 09h Disp1 db “Data is present”,”&” Disp2 db “Data is not present”,”&” Count equ 05h Data ends Code segment Org 1000h Start: mov ax, data mov ds, dx mov si, offset list mov cx, count
  • 13. loop: mov ax, [si] cmp ax, 05h jz loop1 add si, 02h dec cx jnz loop jmp loop2 loop1: mov dx, offset disp1 jmp loop3 loop2: mov dx, offset disp2 jmp loop3 loop3: mov ah, 09h int 21h mov ah, 4ch int 21h code ends end Result: Thus, the ALP for searching an element was written and executed successfully and the output was verified.
  • 14. Exp no:7 Program for File Manipulation in 8086. Aim: To write an Assembly Language Program for File Manipulation in 8086 using MASM software. Apparatus Required: MASM Software Algorithm: 1. Start the program 2. In the data segment define byte for filename and named as FN 3. In code segment, move the data segment values to ds register 4. Initialize the address of FN to DX register. 5. Interrupt command (3ch) is used to pen a file. 6. Perform the termination using terminate interrupt for program. 7. Stop the program. Program: Assume cs: code, ds: data Data segment FN DB “siva.txt”,”$” Data ends Code segment Start: mov ax, data mov ds, ax mov dx, offset FN mov cx, 00h mov ah,3ch int 21h code ends end start Result: Thus the ALP for file manipulation in 8086 using MASM software was written and executed successfully and the output was verified.
  • 15. Exp no: 8 Interfacing of Stepper Motor controller using 8086 Microprocessor kit. Aim: To write an Assembly Language Program for run Stepper Motor in clockwise and anticlockwise direction using 8086 Microprocessor kit. Apparatus Required: Microprocessor kit, Power cable, stepper motor kit and Data cable. Algorithm: 1. Start the program 2. Initialize a memory location to DI 3. Initialize the counter value as 04 4. Move the content of DI to AL 5. Write the AL value as 00h to port 6. Move the content of memory location to DX. 7. Decrement the DX value and if it is no zero call delay program. 8. Increment the DI value and goto step 4 9. Goto step 2. 10. Stop the program Clockwise direction values: - 09h, 05h, 06h , 0Ah, 09h Anticlockwise direction values: - 09h , 0Ah, 06h, 05h, 09h Program: L2: MOV DI, [1018h] MOV CL, 04 L1: MOV AL, [DI] OUT 00, AL MOV DX, [1010h] delay: DEC DX JNZ delay INC DI
  • 16. LOOP L1 JUMP L2 HLT Clockwise direction values: - 09h, 05h, 06h, 0Ah, 09h Anticlockwise direction values: - 09h, 0Ah, 06h, 05h, 09h Result: Thus, the assembly language program in 8086 for stepper motor in clockwise and anticlockwise was written and executed successfully and the output was verified.
  • 17. Exp no:9 Interfacing of Keyboard / Display (8279) using Microprocessor kit. Aim: To write an Assembly Language Program for Interfacing of Keyboard / Display (8279) in 8086 Microprocessor kit for displaying character „A‟ and rolling display. Apparatus Required: Microprocessor kit, Power cable, 8279 keyboard/display kit and Data cable. Algorithm for Character Display of „A‟: 1. Start the program 2. Initialize the AL as 00h and write the AL value to port. 3. Enter the value for Character “A” as 88h 4. Write the value to output port 5. Goto step 4. 6. Stop the program. Program for Character Display of „A‟ MOV AL,00h OUT C2,AL MOV AL, CCh OUT C2,AL MOV AL,90h OUT C2,AL MOV AL,88h OUT C0,AL MOV AL,FFh OUT C2,AL MOV CX,0006h L1: OUT C0,AL
  • 18. LOOP L1 HLT Algorithm for Rolling Display: 1. Start the program 2. Set the counter value for number of characters to roll and write the value port. 3. Move the 10h, CCh, 90h value for number of characters to roll and write the value port. 4. Move the roll character values to source index(SI) and write into port. 5. Move the value 0A0Fh to the register DX 6. Decrement it till reach 00h. 7. If DX is no zero goto step 6 and increment Source index to accept next value 8. Goto step 4. 9. Stop the program. Program for Rolling Display: START: MOV SI,[2000h] MOV CX, 000Fh MOV AL, 10h OUT C2, AL MOV AL, CCh OUT C2,AL MOV AL,90h OUT C2,AL L1: MOV AL,[SI] OUT C0,AL MOV DX,0A0Fh L2: DEC DX JNZ L2 INC SI LOOP L1 JMP START Result: Thus, the assembly language program in 8086 to display the character „A‟ and roll the display was written and executed successfully and the output was verified.
  • 19. Exp no:10 Interfacing of ADC with 8086 Microprocessor kit. Aim : To write an Assembly Language Program for Interfacing ADC in 8086 Microprocessor kit. Apparatus Required: Microprocessor kit, Power cable, ADC kit and Data cable Algorithm for ADC: 1. Start the program. 2. Move the control register values to AL register and write those values to ports. 3. Move the initial value 00yh to AL and write the value to port. 4. Accept the analog value from ADC kit and store it in AL. 5. Compare the AL with 01h, if it true and no zero goto step 4. 6. Accept the analog value from port and store it in AL. 7. Move the value in AL to a memory Location [1500h]. 8. Stop the program. Program for ADC: MOV AL,10h OUT C8,AL MOV AL,18h OUT C8,AL MOV AL,01h OUT D0,AL MOV AL,00h MOV AL,00h MOV AL,00h MOV AL,00h OUT D0,AL
  • 20. L1: IN AL,D8 AND AL,01h CMP AL,01h JNZ L1 IN AL,C0 MOV BX,1500h MOV [BX],AL HLT Result : Thus, the assembly language program in 8086 to convert the analog value to digital using ADC convertor was written and executed successfully and the output was verified.
  • 21. Exp no:11 Interfacing of DAC with 8086 Microprocessor kit. Aim : To write an Assembly Language Program for Interfacing of DAC with 8086 Microprocessor kit for generating waveforms such as sine wave, triangular wave, saw tooth wave and square wave. Apparatus Required: Microprocessor kit, Power cable, DAC kit and Data cable. Algorithm: SAW TOOTH WAVE: 1. Start the program 2. Initialize the register AL as 00h 3. Write the initial value in port 4. Increment the AL value and check if no zero goto step 3. 5. Stop the program TRIANGULAR WAVE: 1. Start the program 2. Initialize the BL register as 00h 3. Move the contents of BL to AL 4. Write the AL value in Port 5. Increment the BL value and check if it is no zero goto step 2 6. Initialize the BL register as FFh 7. Move the contents of BL to AL 8. Write the AL value in Port 9. Decrement the BL register and check if it is zero goto step 6 10. Goto step 1 11. Stop the program
  • 22. SQUARE WAVE: 1. Start the program 2. Initialize the AL as 00h 3. Write the port value of AL register and goto step 4. Initialize as AL as highest value and write the AL value to port and call step 6. 5. Goto step 2 6. Move the contents of 05FFh to CX and goto step 5 7. Stop the program SINE WAVE : 1. Start the program 2. Initialize the look up table in a memory location 3. Initialize the value 46h 4. Move the contents of BX to AL 5. Increment the BX value 6. Write the AL value to ports goto step 4 7. Goto step 2 8. Stop the program Program: SAW TOOTH WAVE: START : MOV AL,00h L1 : OUT C0,AL INC AL JNZ L1 JMP START TRIANGULAR WAVE: L3: MOV BL,00h L1: MOV AL,BL
  • 23. OUT C8,AL INC BL JNZ L1 MOV BL,FFh L2: MOV AL,BL OUT C8,AL DEC BL JNZ L2 JMP L3 SQUARE WAVE: START: MOV AL,00h OUT C8,AL CALL ROUTINE MOV AL,FFh OUT C8,AL CALL ROUTINE JMP START ROUTINE : MOV CX,05FFh L3 : LOOP L3 RET SINE WAVE GENERATION: START: MOV BX,1100h MOV CL,46h L1: MOV AL,[BX] OUT C0,AL INC BX LOOP L1 JMP START Result : Thus, the assembly language program in 8086 to convert the digital values to analog using DAC convertor for generating waveforms such as sine wave, triangular wave, saw tooth wave and square wave was written and executed successfully and the output was verified.
  • 24. Exp no:12 Interfacing of Timer with 8086 Microprocessor kit. Aim: To write an Assembly Language Program for Interfacing of Timer with 8086 Microprocessor kit. Apparatus Required: Microprocessor kit, Power cable, Timer kit and Data cable. Algorithm: 1. Start the program. 2. Move the counter value to AL either it may be even or odd and write the AL value to output port. 3. Move the highest value (10h) to AL either it may be even or odd and write the AL value to output port. 4. Move the initial value (00h) to AL either it may be even or odd and write the AL value to output port. 5. Stop the program. Program: Mov AL, 36h Out C8, AL Mov AL, 10h Out C8, AL Mov AL, 00h Out C8, AL HLT. Result: Thus, the assembly language program in 8086 microprocessor interface with timer was written and executed successfully and the output was verified.