Professional Documents
Culture Documents
program to ADD two 16-BIT numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: MOV MOV MOV INC MOV INC MOV INC MOV ADD JNC INC LABEL: MOV MOV INC MOV INC MOV INT RESULT: WITHOUT CARRY AH
12
SI,@INPUT ADDRESS CL, 00H AL, [SI] SI AH, [SI] SI BL, [SI] SI BH, [SI] AX, BX LABEL (OFFSET ADDRESS) CL SI,@OUTPUT ADDRESS [SI], AL SI [SI], AH SI [SI], CL 03 WITH CARRY AH
AB
AL
34
AL
CD
BH 56 BL 70 -----------------------------------------AH 68 AL A4 CL=0
BH AB BL CD -----------------------------------AH 57 AL 9A CL=1
Department of Electronics and Communications Engineering Experiment No: 2 SUBSTRACTION OF TWO 16-BIT NUMBERS AIM : To write an assembly language program to SUBSTRACT two 16-BIT numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: MOV MOV MOV INC MOV INC MOV INC MOV SUB JNC INC LABEL: MOV MOV INC MOV INC MOV INT SI,@INPUT ADDRESS CL, 00H AL, [SI] SI AH, [SI] SI BL, [SI] SI BH, [SI] AX, BX LABEL (OFFSET ADDRESS) CL SI,@OUTPUT ADDRESS [SI], AL SI [SI], AH SI [SI], CL 03 WITH BORROW AH
34
AL
78
AL
12
BH 34 BL 12 -----------------------------------------AH 22 AL 66 CL=0
BH 56 BL 78 ------------------------------AH DD AL 9A CL=1
Department of Electronics and Communications Engineering Experiment No: 3 MULTIPLICATION OF TWO 16-BIT NUMBERS AIM : To write an assembly language program to MULTIPLY two 16-BIT numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: MOV MOV INC MOV INC MOV INC MOV MUL MOV MOV INC MOV INC MOV INC MOV INT RESULT: AH
12
SI,@INPUT ADDRESS AL, [SI] SI AH, [SI] SI BL, [SI] SI BH, [SI] BX SI,@OUTPUT ADDRESS [SI], AL SI [SI], AH SI [SI], DL SI [SI], DH 03
AL
34
BH 4B BL 4C ------------------------------------------------------------------------DH 05 DL 5A AH A3 AL 70
Department of Electronics and Communications Engineering Experiment No: 4 DIVISION OF 32-BIT NUMBER BY 16-BIT NUMBER AIM : To write an assembly language program to DIVIDE a 32-BIT number by 16-bit number using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: MOV MOV INC MOV INC MOV INC MOV INC MOV INC MOV DIV MOV MOV INC MOV INC MOV INC MOV INT RESULT: DH
4C
SI,@INPUT ADDRESS AL, [SI] SI AH, [SI] SI DL, [SI] SI DH, [SI] SI BL, [SI] SI BH, [SI] BX SI,@OUTPUT ADDRESS [SI], AL SI [SI], AH SI [SI], DL SI [SI], DH 03 DL
4B
AH
02
AL
01
BH 4C BL 4C -----------------------------------------------------------------------------DH 04 DL F5 AH AA AL 9C
Bheema Institute of Science and Technology Department of Electronics and Communications Engineering Experiment No: 5 SUM OF N NUMBERS AIM : To write an assembly language program to perform the addition of N numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR XOR MOV MOV BACK: INC MOV ADD JNC INC LABEL: LOOP MOV MOV INC MOV INC MOV INT
RESULT: CL 03 AL AA AL
BB CC
AX, AX BX, BX CX, CX DX, DX SI,@INPUT ADDRESS CL, [SI] SI AL, [SI] BX, AX LABEL (OFFSET ADDRESS) DL BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], BL SI [SI], BH SI [SI], DL 03
AL -------------------------------------------BH 02 BL 31 DL 00
Department of Electronics and Communications Engineering Experiment No: 6 SUM OF SQUARES OF N NUMBERS AIM : To write an assembly language program to perform the addition of squares of N numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR XOR MOV MOV BACK: INC MOV MUL ADD JNC INC LABEL: LOOP MOV MOV INC MOV INC MOV INT
RESULT: CL 03 AL AA AL
BB CC
AX, AX BX, BX CX, CX DX, DX SI,@INPUT ADDRESS CL, [SI] SI AL, [SI] AL BX, AX LABEL (OFFSET ADDRESS) DL BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], BL SI [SI], BH SI [SI], DL 03
AL -------------------------------------------BH 9C BL 0D DL 01
Department of Electronics and Communications Engineering Experiment No: 7 SUM OF CUBES OF N NUMBERS AIM : To write an assembly language program to perform the addition of cubes of N numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR XOR XOR MOV MOV BACK: INC MOV MOV MUL MUL ADD JNC INC LABEL: LOOP MOV MOV INC MOV INC MOV INT RESULT: CL 03 AL 0A AL
0B 0C
AX, AX BX, BX CX, CX DX, DX SI,@INPUT ADDRESS CL, [SI] SI AL, [SI] AL, DL DL AL BX, AX LABEL (OFFSET ADDRESS) DL BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], BL SI [SI], BH SI [SI], DL 03
AL -------------------------------------------BH 0F BL DB DL 00
Department of Electronics and Communications Engineering Experiment No:8 ARITHMETIC MEAN OF N NUMBERS AIM : To write an assembly language program to perform the arithmetic mean of N numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
Department of Electronics and Communications Engineering PROGRAM: XOR XOR XOR XOR MOV MOV MOV DEC INC MOV BACK: INC MOV ADD JNC INC LABEL: LOOP DIV MOV MOV INC MOV INT RESULT: DL=CL 03 AX, AX BX, BX CX, CX DX, DX SI,@INPUT ADDRESS CL, [SI] DL, CL CL SI AL, [SI] SI BL, [SI] AX, BX LABEL (OFFSET ADDRESS) AH BACK (OFFSET ADDRESS) DL SI,@OUTPUT ADDRESS [SI], AL SI [SI], AH 03
AL
01 02 03 06 AH 00
AL DL
06 03
AL
----------------------AL 02
AL ------------------------AH 00 AL
Department of Electronics and Communications Engineering Experiment No: 9 FINDING MINIMUM NUMBER AMONG 8-BIT DATA AIM : To write an assembly language program to find a minimum number from given 8-bit N numbers using 8086 microprocessor Apparatus Required : 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR MOV MOV DEC INC MOV BACK: INC MOV CMP JC MOV LABEL: LOOP MOV MOV INT RESULT: CL: DATA:
06 05
AX, AX BX, BX CX, CX SI,@INPUT ADDRESS CL, [SI] CL SI AL, [SI] SI BL, [SI] AL, BL LABEL (OFFSET ADDRESS) AL, BL BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], AL 03
02
01
09
08
----------------------------------------------------------------AL: 01
Department of Electronics and Communications Engineering Experiment No: 10 FINDING MAXIMUM NUMBER AMONG 8-BIT DATA AIM: To write an assembly language program to find a maximum number from given 8-bit N numbers using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR MOV MOV DEC INC MOV BACK: INC MOV CMP JNC MOV LABEL: LOOP MOV MOV INT RESULT: CL: DATA:
06 05
AX, AX BX, BX CX, CX SI,@INPUT ADDRESS CL, [SI] CL SI AL, [SI] SI BL, [SI] AL, BL LABEL (OFFSET ADDRESS) AL, BL BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], AL 03
02
01
09
08
----------------------------------------------------------------AL: 09
Department of Electronics and Communications Engineering Experiment No: 11 FINDING MINIMUM NUMBER AMONG 16-BIT DATA AIM: To write an assembly language program to find a minimum number from given 16-bit N numbers using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR MOV MOV DEC INC MOV INC MOV BACK: INC MOV INC MOV CMP JC MOV LABEL: LOOP MOV MOV INT AX, AX BX, BX CX, CX SI,@INPUT ADDRESS CL, [SI] CL SI AL, [SI] SI AH, [SI] SI BL, [SI] SI BH, [SI] AX, BX LABEL (OFFSET ADDRESS) AX, BX BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], AX 03
03
RESULT:
CL:
3 DATA:
06 02 01
2
09 08
1
06
----------------------------------------------------------------------AH: 01 AL: 09
Department of Electronics and Communications Engineering Experiment No: 12 FINDING MAXIMUM NUMBER AMONG 16-BIT DATA AIM: To write an assembly language program to find a maximum number from given 16-bit N numbers using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR MOV MOV DEC INC MOV INC MOV BACK: INC MOV INC MOV CMP JNC MOV LABEL: LOOP MOV MOV INT AX, AX BX, BX CX, CX SI,@INPUT ADDRESS CL, [SI] CL SI AL, [SI] SI AH, [SI] SI BL, [SI] SI BH, [SI] AX, BX LABEL (OFFSET ADDRESS) AX, BX BACK (OFFSET ADDRESS) SI,@OUTPUT ADDRESS [SI], AX 03
03
RESULT:
CL:
3 DATA:
06 02 01
2
09 08
1
06
----------------------------------------------------------------------AH: 08 AL: 06
Department of Electronics and Communications Engineering Experiment No: 13 ARRANGING GIVEN 8-BIT DATA IN ASCENDING ORDER AIM: To write an assembly language program to arrange given N numbers in ascending order using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR MOV MOV DEC MOV AGAIN: BACK: INC MOV INC CMP JC XCHG LABEL: LOOP SUB MOV MOV LOOP INT AX, AX BX, BX CX, CX SI,@INPUT ADDRESS CL, [SI] CL DX, CX SI AL, [SI] SI AL, [SI] LABEL (OFFSET ADDRESS) AL, [SI] BACK (OFFSET ADDRESS) SI, DX [SI], AL CX, DX AGAIN (OFFSET ADDRESS) 03
05
CL:
0E
0B
0C
0A
0D
Department of Electronics and Communications Engineering Experiment No: 14 ARRANGING GIVEN 16-BIT DATA IN DESCENDING ORDER AIM: To write an assembly language program to arrange given N numbers in ascending order using 8086 microprocessor
Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM: XOR XOR XOR MOV MOV DEC MOV AGAIN: BACK: INC MOV INC CMP JNC XCHG LABEL: LOOP SUB MOV MOV LOOP INT AX, AX BX, BX CX, CX SI,@INPUT ADDRESS CL, [SI] CL DX, CX SI AL, [SI] SI AL, [SI] LABEL (OFFSET ADDRESS) AL, [SI] BACK (OFFSET ADDRESS) SI, DX [SI], AL CX, DX AGAIN (OFFSET ADDRESS) 03
05
CL:
0E
0B
0C
0A
0D
Department of Electronics and Communications Engineering Experiment No: 15 CONVERSION OF CELSIUS TEMPARATURE INTO FAHRENHEIT TEMPARATURE AIM: To write an assembly language program to convert Celsius temperature into Fahrenheit temperature using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR MOV MOV MOV MUL MOV DIV MOV ADD MOV MOV INT RESULT:
AX, AX BX, BX SI,@INPUT ADDRESS AL, [SI] BL, 09 BL BL, 05 BL BL, 20 AX, BX SI,@OUTPUT ADDRESS [SI], AX 03
F= (9/5) C+32 AL
19
HEXA=19=>DECI=25
Department of Electronics and Communications Engineering Experiment No: 16 CONVERSION OF FAHRENHEIT TEMPARATURE INTO CELSIUS TEMPARATURE AIM: To write an assembly language program to convert Fahrenheit temperature into Celsius temperature using 8086 microprocessor
Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR MOV MOV MOV SUB MOV MOV MOV DIV MOV MOV INT RESULT:
AX, AX BX, BX SI,@INPUT ADDRESS AL, [SI] BL, 20 AL, BL BL, 05 BL BL, 09 BL SI,@OUTPUT ADDRESS [SI], AX 03
C= (F-32) *(5/9) AL
4D
HEXA=4D=>DECI=77
Department of Electronics and Communications Engineering Experiment No: 17 CONVERSION OF PACKED BCD INTO UNPACKED BCD NUMBER AIM: To write an assembly language program to convert a packed BCD number into unpacked BCD number using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR MOV MOV AND MOV MOV ROR AND MOV MOV INC MOV INT RESULT: CL
AX, AX BX, BX SI,@INPUT ADDRESS AL, [SI] AL, 0F BL, [SI] CL, 04 BL, CL BL, 0F SI,@OUTPUT ADDRESS [SI], AL SI [SI], BL 03 AL BL ROR BL,CL BL AND
19 91 91
04
PACKED BCD
AL
91
0F
0F
--------------------------------------------------------------BL 09 AL 01
UNPACKED BCD
Department of Electronics and Communications Engineering Experiment No: 18 CONVERSION OF UNPACKED BCD INTO PACKED BCD NUMBER AIM: To write an assembly language program to convert an unpacked BCD number into packed BCD number using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR MOV MOV INC MOV MOV ROR OR MOV MOV INT RESULT: CL BL BL
AX, AX BX, BX SI,@INPUT ADDRESS AL, [SI] SI BL, [SI] CL, 04 BL, CL AL, BL SI,@OUTPUT ADDRESS [SI], AL 03
04
02
AL
04
UNPACKED BCD
ROR BL, CL
20
AL BL
04 20
--------------------------------------------------------------AL 24
PACKED BCD
Experiment No: 19 CONVERSION OF DECIMAL INTO HEXADECIMAL NUMBER AIM: To write an assembly language program to convert a DECIMAL number into HEXADECIMAL number using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR MOV MOV MOV AND MOV MOV ROR AND MOV MUL ADD MOV MOV INT RESULT: CL BH
AX, AX BX, BX SI,@INPUT ADDRESS AL, [SI] BL, AL AL, 0F BH, AL CL, 04 BL, CL BL, 0F AL, 0A BL AL,BH SI,@OUTPUT ADDRESS [SI], AL 03 AL BL AL BH DECIMAL
04
19
01
09
12 01
--------------------------------------------------------------AL 13
HEXADEIMAL
Bheema Institute of Science and Technology
Department of Electronics and Communications Engineering Experiment No: 20 CONVERSION OF HEXADECIMAL INTO DECIMAL NUMBER AIM: To write an assembly language program to convert a HEXADECIMAL number into DECIMAL number using 8086 microprocessor Apparatus Required: 1. 8086 Micro processor kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS
PROGRAM:
XOR XOR XOR XOR MOV MOV MOV DIV MOV MOV MOV MOV DIV MOV MOV MOV MUL INC MOV MOV MUL ADD ADD MOV MOV INT AX, AX BX, BX CX, CX DX, DX SI,@INPUT ADDRESS AL, [SI] BL, 64 BL DL, AL AL, AH AH, 00 BL, 0A BL CL, AL BL, AH AX, 0100 DX SI [SI], AX AX, 0010 CX AX, BX AX, [SI] SI,@OUTPUT ADDRESS [SI], AX 03 DL 02
FF
RESULT:
AL
CL BL
05 05
HEXADECIMAL
DECIMAL
Department of Electronics and Communications Engineering Experiment No: 21 FINDING LARGEST NUMBER AMONG 8-BIT DATA USING 8051 AIM: To write an assembly language program to finding the largest number among given 8-BIT N numbers using 8051 microcontroller. Apparatus Required: 1. 8051 Micro Controller kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microcontroller Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET MD INPUT ADDRESS Then enter the input data and use enter ( ) to enter the next data. 6. To execute the program, syntax is RESET G STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET MD STARTING ADDRESS 8. To view the program for modifications the syntax is RESET Z STARTING ADDRESS
PROGRAM: MOV
DPTR, #STARTING ADDRESS A, @DPTR R1, A DPTR A, @DPTR R1 B, A DPTR A, @DPTR A, B, L1 (OFFSET ADDRESS) L2 (OFFSET ADDRESS) A, B R1, L3 (OFFSET ADDRESS) DPTR, #OUTPUT ADDRESS @DPTR, A L4 (OFFSET ADDRESS)
MOVX MOV INC MOVX DEC L3: MOV INC MOVX CJNE L1: L2: JNC XCH DJNZ MOV MOVX L4: RESULT: R1: DATA:
06
SJMP
05
02
01
09
08
----------------------------------------------------------------A: 09
Department of Electronics and Communications Engineering Experiment No: 22 FINDING SMALLEST NUMBER AMONG 8-BIT DATA USING 8051 AIM: To write an assembly language program to finding the SMALLEST number among given 8-BIT N numbers using 8051 microcontroller. Apparatus Required: 1. 8051 Micro Controller kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microcontroller Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET MD INPUT ADDRESS Then enter the input data and use enter ( ) to enter the next data. 6. To execute the program, syntax is RESET G STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET MD STARTING ADDRESS 8. To view the program for modifications the syntax is RESET Z STARTING ADDRESS Bheema Institute of Science and Technology
PROGRAM: MOV
DPTR, #STARTING ADDRESS A, @DPTR R1, A DPTR A, @DPTR R1 B, A DPTR A, @DPTR A, B, L1 (OFFSET ADDRESS) L2 (OFFSET ADDRESS) A, B R1, L3 (OFFSET ADDRESS) DPTR, #OUTPUT ADDRESS @DPTR, A L4 (OFFSET ADDRESS)
MOVX MOV INC MOVX DEC L3: MOV INC MOVX CJNE L1: L2: JC XCH DJNZ MOV MOVX L4: RESULT: R1: DATA:
06
SJMP
05
02
01
09
08
----------------------------------------------------------------A: 01
Department of Electronics and Communications Engineering Experiment No: 23 READING AND WRITING ON A PARALLEL PORT OF 8051 AIM: To write an assembly language program to perform the operations like reading and writing the data on a parallel port of 8051 microcontroller. Apparatus Required: 1. 8051 Micro Controller kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microcontroller Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET MD INPUT ADDRESS Then enter the input data and use enter ( ) to enter the next data. 6. To execute the program, syntax is RESET G STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET MD STARTING ADDRESS 8. To view the program for modifications the syntax is RESET Z STARTING ADDRESS Bheema Institute of Science and Technology
PROGRAM: MOV
DPTR, #STARTING ADDRESS A, 90 @DPTR, A DPTR A, @DPTR 90, A DPTR A, 90 @DPTR, A L4 (OFFSET ADDRESS)
MOV MOVX INC MOVX MOV INC MOV MOVX L4: RESULT: SJMP
00
FF
INPUT
DATA:
85
85
OUTPUT
00
85
Department of Electronics and Communications Engineering Experiment No: 24 BIT AND BYTE OPERATIONS BY USING 8051 AIM: To write an assembly language program to perform the BIT and BYTE operations like set, reset and swap by using 8051 microcontroller. Apparatus Required: 1. 8051 Micro Controller kit. 2. Key Board. 3. Adapter. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microcontroller Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET MD INPUT ADDRESS Then enter the input data and use enter ( ) to enter the next data. 6. To execute the program, syntax is RESET G STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET MD STARTING ADDRESS 8. To view the program for modifications the syntax is RESET Z STARTING ADDRESS
DPTR, #STARTING ADDRESS A, @DPTR 0E5 DPTR @DPTR, A L4 (OFFSET ADDRESS) DPTR, #STARTING ADDRESS A, @DPTR 0E5 DPTR @DPTR, A L4 (OFFSET ADDRESS) DPTR, #STARTING ADDRESS A, @DPTR 0E5 DPTR @DPTR, A L4 (OFFSET ADDRESS)
SJMP
SJMP
E5 C5 20 00
INPUT
00 20
OUTPUT
RESULT:
C5
SWAP A BYTE
5C
INPUT
00 FF
FF
OUTPUT
COMPLIMENT A BYTE
00
Department of Electronics and Communications Engineering Experiment No: 16 INTERFACING A STEPPER MOTOR WITH 8086 MICROPROPROCESSOR AIM: To write an assembly language program to interface a stepper motor by using 8086 microprocessor to control the speed and rotating direction i.e. clockwise and anticlockwise of a stepper motor. Apparatus Required: 1. 2. 3. 4. PROCEDURE: 1. Connect the power supply of +5v to the Kit. 2. Reset the Microprocessor Kit. 3. To Enter the program, the syntax is RESET A STARTING ADDRESS 4. Then Enter all the instructions of the program. 5. To give the input data, the syntax is RESET S STARTING ADDRESS Then enter the input data and use comma(,)to enter the next data. 6. To execute the program, syntax is RESET GO STARTING ADDRESS 7. To see the output which is present in output location the syntax is RESET S STARTING ADDRESS 8086 Micro processor kit. Key Board. Adapter. Stepper motor.
PROGRAM:
MOV MOV MOV MOV OUT CALLS JMP */DISPLAY MESSAGE STRING*/ 0A 0D 45 4E 54 45 52 20 44 49 52 45 43 54 49 4F 4E 0A 0D 41 2D 41 4E 54 49 43 4C 4F 43 4B 57 49 53 45 20 20 20 20 20 43 2D 43 4C 4F 43 4B 57 49 53 45 00 2E 8D 16 12 20 START: LEA MOV CALLS GET: CALLS CMP JE CMP JE JMP
Bheema Institute of Science and Technology
DX, MES1 AX, DX 0FE00:0013 0FE00:00A9 AL, 41 ANTI AL, 43 CLO GET
*/ROUTINE FOR CLOCKWISE ROTATION OF MOTOR*/ CLO: R1: CALL OUT CALL RCR JMP COMMON DX, AL DELAY AL, 1 R1
*/ROUTINE FOR CLOCKWISE ROTATION OF MOTOR*/ ANTI: R2: CALL OUT CALL RCL JMP COMMON: CALLS CALLS MOV MOV RET */ROUTINE TO CONTROL SPEED OF MOTOR*/ DELAY: SS: MOV LOOP RET CX, @VALUE SS COMMON DX, AL DELAY AL, 1 R2 0FE00:0031 0FE00:00 AL, 11 DX, 0FFE0