Académique Documents
Professionnel Documents
Culture Documents
2. PROGRAM FOR SORTING OF AN ARRAY FOR 8086. A. ASCENDING ORDER: AIM: To keep the bytes of given string in ascending order. APPARATUS REQUIRED: 1. 8086 trainer kit 2. Power supply 3. Key board PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0 (set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save ) Enter EX (exit) Enter GO (run) - give the starting address Enter Press E (exam byte)- give the input address
1 1
Press comma(,) -give the input values Enter GO-give the starting address Enter Press E (exam byte) - give the output address Press comma (,) -to see the output values
PROGRAM: MOV CH, 04H Again: MOV CL, 04H MOV BX, 5000H MOV SI, 5000H Back: MOV AL, [SI] INC SI CMP AL, [SI] JC No Change XCHG AL, [SI] MOV [BX], AL No Change: INC BX DEC CL JNZ BACK DEC CH JNZ Again INT 3
1 1
INPUT: BX: 5000: 04 5001: 03 5002: 05 5003: 02 OUTPUT: SI: 5000: 02 5001: 03 5002: 04 5003: 05 B. DESCENDING ORDER: AIM: To keep the bytes of given string in descending order. APPARATUS REQUIRED: 1. 8086 trainer kit 2. Power supply 3. Key board PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter
1 1
Press N (next) Program @! (Save) Enter EX (exit) Enter GO (run) - give the starting address Enter Press E (exam byte)- give the input address Press comma(,) -give the input values Enter GO-give the starting address Press E (exam byte) - give the output address Press comma( ,) -to see the output values
PROGRAM: MOV CH,04H Again: MOV CL,04H MOV BX,5000H MOV SI,5000H Back : MOV AL,[SI] INC SI CMP AL,[SI]
1 1
RESULT:
INPUT: BX: 5000: 04 5001: 03 5002: 05 5003: 02 OUTPUT: SI: 5000: 05 5001: 04 5002: 03 5003: 0 2 3. PROGRAM FOR SEARCHING FOR A NUMBER IN A STRING FOR 8086. AIM: To find whether the given byte is present in the string or not. APPARATUS REQUIRED: 1. 8086 trainer kit 2. Power supply
1 1
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (Save) Enter EX (exit) Enter GO (run) - give starting address Enter Press E (exam byte)- give the input address Press , (give input values) Enter GO-give the starting address Press E (exam byte) give the output address Press comma( ,)- to see the output values
1 1
PROGRAM: MOV SI,5000H MOV BL,00H MOV CL,04H MOV AL,33H Back: CMP AL,[SI] JZ Next INC BL INC SI DEC CL JNZ Back Next: MOV[ 6000] , BL INT 3
RESULT:
INPUT:
SI:
OUTPUT: BL:
02
1 1
4. PROGRAM FOR STRING MANIPULATION FOR 8086. A. COPY A STRING FROM ONE LOCATION TO ANOTHER LOCATION. AIM: To copy string bytes from one location to another location. APPARATUS REQUIRED: 1. 8086 trainer kit 2. Power supply 3. keyboard PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save ) Enter EX (exit)
1 1
Enter GO (run) give the starting address Enter Press E (exam byte)- give the input address Press comma( ,)- give input values Enter GO-give the starting address Press E (exam byte) - give the output address Press comma( ,) -to see output values
PROGRAM: MOV SI, 5000H MOV DI, 6000H MOV CL, 04H CLD REP MOVSB INT 3
RESULT:
INPUT:
SI:
1 1
B. REVERSE A STRING: AIM: To Keep string bytes in reverse order. APPARATUS REQUIRED:
1. 8086 Trainer kit 2. Power Supply 3. Keyboard
PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it Press A (assembler) Enter SG 0(set the segment 0)
1 1
Enter DA 4000(starting address) Enter Press N (next) Program @! (save ) Enter EX (exit) Enter GO (run) - give the starting address Enter Press E (exam byte)- give the input address Press comma(,)-give input values Enter GO-give the starting address Press E (exam byte) - give the output address Press comma( ,)- to see output values
PROGRAM: MOV SI,5000H MOV DI,6000H MOV CL,04H Back: MOV AL,[SI]
1 1
RESULT:
INPUT:
SI:
DI:
1 1
SWARNA BHARATHI COLLEGE OF ENGINEERING MICROPROCESSOR AND MICROCNTROLLER LAB PROGRAMS APPARATUS REQUIRED:
1.
2. Power supply
3.
Keyboard
PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save ) Enter EX (exit) Enter GO (run) - give the starting address
Enter Press E (exam byte)- give the input address Press comma( ,)- give the input values
1 1
Enter GO-give the starting address Press E (exam byte) - give the output address Press comma(,)-to see the output values
PROGRAM: MOV SI,5000H MOV DI,6000H MOV BL,00H MOV CL,04H CLD REPE COMSB JZ L1 JMP L2 L1: MOV BL,11H L2: INT 3 RESULT:
INPUT:
SI:
DI:
6000: 20
1 1
OUTPUT: BL:
11
5. INTERFACING ADC AND DAC TO 8086. A. INTERFACING ADC TO 8086. AIM: To convert given analog input to digital output.
APPARATUS REQUIRED:
1.
2. Power supply
3.
Keyboard
1 1
Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter GO (run) - give the starting address
PROGRAM: MOV AL, 98H MOV DX, 0FFC6 OUT DX, AL MOV AL, 02H MOV DX, 0FFC2 OUT DX, AL MOV AL, 00H MOV DX, 0FFC4 OUT DX, AL MOV AL, 01H
1 1
INPUT:
5V
OUTPUT: AL:
FF
B.INTERFACING DAC TO 8086. SAWTOOTH WAVE: AIM: To generate Saw tooth wave using DAC.
APPARATUS REQUIRED:
1.
Keyboard
PROCEDURE:
1 1
Switch on the power supply Connect the keyboard to the kit place provided on it Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter GO (run) give the starting address
1 1
1 1
1 1
APPARATUS REQUIRED:
1.
Keyboard
PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter GO (run) - give the starting address
1 1
PROGRAM: MOV AL, 80H MOV DX, 0FFC6 OUT DX, AL Again: MOV BL, 0FFH MOV AL, 0FFH MOV DX, 0FFC2 Back: OUT DX, AL DEC BL JNZ Back MOV AL, 00 MOV BL, 0FF Back1: OUT DX, AL DEC BL JNZ Back1 JMP Again INT 3
1 1
OUTPUT:
1 1
APPARATUS REQUIRED:
1.
Keyboard
PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it Press A (assembler) Enter SG 0(set the segment 0) Enter
1 1
DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter GO (run) give the starting address
PROGRAM: MOV AL, 80H MOV DX, 0FFC6 OUT DX, AL Back: MOV AL, 00H MOV DX, 0FFC2 Back1: OUT DX, AL INC AL CMP AL, 0FFH
1 1
OUTPUT:
1 1
1 1
APPARATUS REQUIRED:
1.
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter Press A
1 1
PROGRAM: MOV DX, 0FFC6 MOV AL, 80H OUT DX, AL MOV CL, 0FF MOV DX, 0FFC4 MOV AL, 0EE L1: OUT DX, AL CALL DELAY ROR AL, 01 DEC CL JNZ L1 INT 3 CALL DELAY: MOV BX, 8000 L2: DEC BX JNZ L2 RET
1 1
B.ANTI CLOCK WISE DIRECTION: AIM: To rotate Stepper motor in anti clockwise direction.
APPARATUS REQUIRED:
1.
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program
1 1
@! (save) Enter EX (exit) Enter Press A SG 0 DA 5000 Enter delay program @! Ex GO (run) - give the starting address
PROGRAM: MOV DX,0FFC6 MOV AL,80H OUT DX,AL MOV CL,0FF MOV DX,0FFC4 MOV AL,0EE OUT DX,AL CALL DELAY ROL AL,01 DEC CL JNZ L1 INT 3
1 1
7. PROGRAMMING USING ARITHMETIC AND LOGICAL INSTRUCTIONS OF 8051. A. ARITHMETIC OPERATIONS: AIM: To perform addition of two 8-bit numbers
APPARATUS REQUIRED:
1.
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A(assembler) Enter starting address
1 1
OUTPUT: A=33H
1 1
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=11H
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=08H
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=02H
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=02H
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=03H
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=FDH
APPARATUS REQUIRED:
1.
1 1
OUTPUT: A=06H
8. LED DISPLAY. A.CONTINUOUSLY ON OFF LEDS OF PORT A: AIM: To make successive LEDs of port A to glow.
APPARATUS REQUIRED:
1.
1 1
SWARNA BHARATHI COLLEGE OF ENGINEERING MICROPROCESSOR AND MICROCNTROLLER LAB PROGRAMS 2. Power supply 3. LED Interfacing card 4. Bus cable
5.
Keyboard
PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter Press A SG 0 DA 5000(Delay program address) Enter delay program @!
1 1
PROGRAM: MOV DX, 3006H MOV AL, 80H OUT DX, AL MOV CL, 0A MOV DX, 3000H Back: MOV AL, OFFH OUT DX, AL CALL DELAY MOV AL, 00H OUT DX, AL CALL DELAY DEC CL JNZ Back INT 3
CALL DELAY: MOV BX, 0FFFF L1: DEC CL JNZ L1 RET OUTPUT: Glowing of successive LEDs is verified. B.BLINK ALTERNATE LEDS OF PORT A:
1 1
APPARATUS REQUIRED:
1.
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save) Enter EX (exit) Enter Press A SG 0
1 1
DA 5000(Delay program address) Enter delay program @! Ex GO (run) - give the starting address
PROGRAM: MOV AL, 80H MOV DX, 3006 OUT DX, AL MOV CL, 08H MOV DX, 3000H MOV AL, O55H Back: OUT DX, AL CALL DELAY DEC CL JNZ Back INT 3 CALL DELAY: MOV BX, 0FFFF L1: DEC CL JNZ L1 RET
1 1
9. PARALLEL COMMUNICATION BETWEEN TWO MICRO PROCESSORS. AIM: To provide Communication between two micro processors APPARATUS REQUIRED: 1. Two 8086 Trainer kits 2. Two power supplies 3. Bus cable
4.
Keyboard
PROCEDURE:
Switch on the power supply Connect the keyboard to the kit place provided on it. Press A (assembler) Enter SG 0(set the segment 0) Enter DA 4000(starting address) Enter Press N (next) Program @! (save ) Enter
1 1
EX (exit) Enter GO (run) - give starting address Enter Press E (exam byte)- give the input address Press comma(,) -give the input values Enter GO-give the starting address Press E (exam byte) - give the output address Press comma( ,) -to see output values Enter the receiver program in receiver kit Check the output in receiver
PROGRAM: Transmitter: MOV AL, 80H MOV DX, 0FFC6 OUT DX, AL MOV AL, 77H MOV DX, 0FFC0 OUT DX, AL INT 3 Receiver: MOV AL, 90H MOV DX, 0FFC6
1 1
1 1