8086 Microprocessor Lab Final.
8086 Microprocessor Lab Final.
Introduction
The module unit is intended to provide the
trainees with theoretical and practical skills c) Describe data transfer instructions in
for programming
Selection, installation and maintenance of d) Describe the instructions in data
microelectronics, micro-computers and manipulation group
micro e) Describe the input and output instructions
processor based systems. Trainees f) Describe the machine control instructions
undertaking this course will be expected to g) Describe transfer of control instructions
have covered in programming
digital electronics. h) Explain the need and use of assembly
General Objectives directives
By the end of the module unit, the trainee i) Explain various addressing modes
should be able to; j) Write application programs
a) Understand the concepts of a a) Describe the organization of data registers
microprocessor system. b) Explain the operation of machine cycle
b) Program a microprocessor system. Explanation of operation of machine cycle
c) Write and implement microprocessor Description of organization of data registers
programs. Machine Cycle
d) Diagnose faults in microprocessor i. Definition
systems. ii. Fetch
Specific Objectives iii. Decode
By the end of the sub-module unit, the iv. Execute
trainee should be able to: v. Time diagram
a) Describe a machine cycle Instruction format
b) Explain instruction format i. Label
ii. Opcode
iii. Operand
iv. Comment
Writing machine code programs
iii. Running the program i. Machine coding
ii. Inputting a machine code program
LAB1
Ex. NO: 01
DATE:…………………………………
16 BIT ADDITIONS USING ARITHMETIC OPERATION OF 8086 MICROPROCESSOR
AIM:
To write an assembly language program to perform addition of two 16 bit numbers
Using 8086.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 2
3. Key board - 1
; PROGRAM FOR ADDITION
; Procedure: Enter the two data in locations 9000 and 9001
; Execute the following and check the result in
; Locations 9002 (LSD) and 9003 (MSD)
EXERCISE
Ex. NO: 02
DATE:…………………………………
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 2
3. Key board - 1
; Procedure:
; Enter the known data in 16 locations
; From 9000 and execute the program
; Enter 9400 to see the result LSD
; Use INC key to access 9401 which is result MSD
; IF YOU WANT TO ADD 4 OR 5 LOCATIONS ONLY CHANGE BYTE COUNT
8400 BB 00 90 MOV BX, 9000H ; start address of mem block
8403 B1 10 MOV CL,10H ; byte count
8405 B8 00 00 MOV AX,0 ; RESULT = 0 TO START WITH
8408 B6 00 MOV DH,0
840A ADDLOOP1:
840A 8A 17 MOV DL,[BX]
840C 43 INC BX
840D 03 C2 ADD AX,DX
840F FE C9 DEC CL
8411 75 F7 JNZ ADDLOOP1
8413 BB 00 94 MOV BX,9400H ; RESULT LOCATION
8416 89 07 MOV [BX],AX
8418 CD 23 INT RSTINT
Ex. NO: 03
DATE:…………………………………
16 BIT SUBTRACTIONS
AIM:
To write an assembly language program to perform subtraction of two 16 bit
numbers using 8086.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 1
; Procedure:
; Enter the two data in locations 9000 and 9001
; Execute the following and check the result in
; Locations 9002 (LSD) and 9003 (MSD)
Ex. NO: 04
DATE:…………………………………
AIM:
To write an assembly language program to perform Multiplication of two 16
bit numbers using 8086 trainer kit.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 1
; Procedure: Enter the two data in locations 900
0 and 9001
; Execute the following and check the result in
; Locations 9002 (LSD) and 9003 (MSD)
Ex. NO: 05
DATE:…………………………………
16 BIT DIVISIONS USING ARITHMETIC OPERATION OF 8086 MICROPROCESSOR
AIM:
To write an assembly language program to perform division of two 16 bit
numbers using 8086.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 1
; PROGRAM FOR DIVISION (by repeated subtraction)
; INPUT: Dividend in loc. 9000 (1 byte)
; Divisor in loc. 9001 (1 byte)
; OUTPUT: Quotient in loc 9002
; Reminder in loc 9003
; Procedure: Enter the two data in locations 9000 and 9001
; Execute the following and check the result in
locations 9002 and 9003
LAB2
Ex. NO: 06
DATE:…………………………………
Largest & Smallest numbers in an Array
AIM:
To write an assembly language program to finding the max value
Using 8086 trainer kit.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 2
3. Key board - 1
8400 BB 00 90 MOV BX,9000H ; ST. ADD. OF MEMORY BLOCK
8403 B1 05 MOV CL,05H ; BYTE COUNT
8405 B4 00 MOV AH,00 ; MAX VALUE = 00 TO START WITH
8407 CHEKLOOP:
8407 8A 07 MOV AL,[BX]
8409 3A C4 CMP AL,AH
840B 72 02 JC OKAY1
840D 8A E0 MOV AH,AL
840F OKAY1:
840F 43 INC BX
8410 FE C9 DEC CL
8412 75 F3 JNZ CHEKLOOP
8414 BB 00 94 MOV BX,9400H
8417 88 27 MOV [BX],AH
8419 CD 23 INT RSTIN
Ex. NO: 07
DATE:…………………………………
PROGRAM FOR FINDING THE MIN VALUE
AIM:
To write an assembly language program for finding the min value
Using 8086 trainer kit.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 2
3. Key board - 1
; for Minmax 8086 kit
; Program name : EMM6.LST
; INPUT: 5 locations from 9000
; OUTPUT : Min value of locations 9000 to 9004
; stored at 9400
DATE:…………………………………
PROGRAM FOR COMPARING TWO STRINGS
AIM:
To write an assembly language program for comparing two strings and storing 00 if
strings are not the same and 01 if strings are the same
Using 8086 trainer kit.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 kit 1
2. Power supply + 5 v dc 2
3. Key board - 1
; For Minmax 8086 kit
; INPUT: Load 9000H
Load 9100H
; OUTPUT: Store 00 or 01 at 9400H
8444 DELAY:
8444 B9 FF 04 MOV CX,04FFH
8447 49 LP: DEC CX
8448 74 05 JZ LP1
844A EB FB JMP LP
844C B9 FF 04 MOV CX,04FFH
844F 49 LP1: DEC CX
8450 74 02 JZ EXT
8452 EB FB JMP LP1
8454 C3 EXT: RET
EX. NO: 09
DATE:…………………………………
Ex. NO: 11
DATE:…………………………………
Triangular waveform:
AIM:
To write an assembly language program in 8086 to generate triangular waveform as seen
using a CRO.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 1
2. Power Supply +5 V, dc, +12 V dc 1
3. DAC Interface board - 1
; THIS PROGRAM OUTPUTS 00 OR FF INFINITELY TO DAC0800
Ex. NO: 12
DATE:…………………………………
RAMP waveform:
AIM:
To write an assembly language program in 8086 to generate RAMP waveform as seen
using a CRO.
APPARATUS REQUIRED:
1. Microprocessor kit 8086 1
2. Power Supply +5 V, dc, +12 V dc 1
3. DAC Interface board - 1
840A FE C0 IN0C AL
840C 3C FF CMP AL,0FFH
840E 75 F6 JNZ LP2
8410 LP3:
8410 E6 40 OUT PAB8255,AL
8412 E6 44 OUT PCB8255,AL
8414 FE C8 DEC AL
8416 3C 00 CMP AL,0
8418 75 F6 JNZ LP3
841A EB E8 JMP LP1
841C CODE ENDS
Ex. NO: 13
DATE:…………………………………
PROGRAM READS ADC, DISPLAYS THE HEX VALUE OF THE INPUT.
AIM:
To write an assembly language program in 8086 displays the hex value of the input
APPARATUS REQUIRED:
1. Microprocessor kit 8086 1
2. Power Supply +5 V, dc, +12 V dc 1
3. ADC Interface board - 1
EX. NO: 14
DATE:…………………………………
INTERFACING PRGRAMMABLE KEYBOARD AND
DISPLAY CONTROLLER 8279
AIM:
To display the message “2” using Keyboard and Display Controller-8279
APPARATUS REQUIRED:
SL.NO ITEM SPECIFICATION QUANTITY
1. Microprocessor kit 8086 1
2. Power Supply +5 V, dc, +12 V dc 1
3. 8279- Interface board - 1
0000 CODE SEGMENT
ASSUME CS: CODE, DS: CODE, ES: CODE, SS:
CODE
= 0046 CMDB8255 EQU 46H
= 0040 PAB8255 EQU 40H
= 0042 PBB8255 EQU 42H
= 0044 PCB8255 EQU 44H