Professional Documents
Culture Documents
3 4
6 7
9 10 11
13 14 15
16 17
12
w .k in in
Einstein College of Engineering Page 2 of 76
di
a.
co m
PROGRAM
ADDRESS LABEL
w .k in in
START L1 MVI A, 35 MVI B, 12 ADD B STA 4200 MVI C, 00 JNC L1 INR C MOV A, C STA 4201 HLT
MNEMONICS
4100 4102 4104 4105 4108 410A 410D 410E 410F 4112
di
a.
co m
OPCODE 3E,35 06,12 80 32,00,42 0E,00 D2,0E,41 0C 79 32,01,42 76
Sub Code: EC 58 Microprocessors and Microcontrollers Lab INPUT: 4101-35 4103-12 OUTPUT: 4200-47 4201-00 MANUAL CALCULATION:
w .k in in
Einstein College of Engineering Page 4 of 76
di
a.
co m
8-BIT SUBTRACTION AIM To write an ALP to perform 8-bit subtraction using 8085 microprocessor trainer kit.
APPARATUS REQUIRED 1. 8085 microprocessor trainer kit. 2. Power supply ALGORITHM 1. Start the program 2. Get the first data to the accumulator. 3. The second data is given to B register. 4. The content of B register is then subtracted with accumulator contents. 5. The addition for carry is checked and the result is stored in the specified memory location. 6. The program is terminated.
PROGRAM
ADDRESS LABEL 4100 4102 4104 4105 4108 410A 410D 410E 410F 4112 START
w .k in in
L1 MVI A, 35 MVI B, 12 SUB B STA 4200 MVI C, 00 JNC L1 INR C MOV A, C STA 4201 HLT
MNEMONICS
di
OPCODE
a.
co m
Sub Code: EC 58 Microprocessors and Microcontrollers Lab 4101-35 4103-12 OUTPUT: 4200-23 4201-00 MANUAL CALCULATION:
w .k in in
Einstein College of Engineering Page 6 of 76
di
a.
co m
8-BIT MULTIPLICATION AIM To write an ALP to perform 8-bit multiplication using 8085 microprocessor trainer kit. APPARATUS REQUIRED 1. 8085 microprocessor trainer kit. 2. Power supply ALGORITHM 1. Start the program 2. Clear the accumulator 3. Get the first data to the register B. 4. Get the second data to the register C. 5. Add the contents of register B is added with the accumulator and stored in accumulator. 6. After performing the addition operation the register C would decremented by 1 7. When the zero flag is set, the result was stored in the specified memory location. 8. Otherwise the loop of addition operation was continued.
PROGRAM
w .k in in
L1 MVI A, 00 MVI B, 12 MVI C, 45 ADD B DCR C JNZ L1 STA 4200 HLT
MNEMONICS
di
a.
co m
OPCODE
w .k in in
Einstein College of Engineering Page 8 of 76
di
a.
co m
8-BIT DIVISION AIM To write an ALP to perform 8-bit division using 8085 microprocessor trainer kit. APPARATUS REQUIRED 1. 8085 microprocessor trainer kit. 2. Power supply ALGORITHM 1. Start the program 2. Clear the accumulator and load the accumulator by divisor value to the specified memory location. 3. Move the content of A to B register. 4. Load accumulator with dividend value. 5. Initialize 00 to C register. 6. Compare B register with accumulator. 7. If carry is generated move to the 11th step. 8. Subtract the B register content from the accumulator. 9. Increment the content of C register. 10. Jump control to step 6. 11. Store the remainder in accumulator in specified memory location. 12. Move the C register content to accumulator. 13. Store the quotient value in accumulator. 14. End the program. PROGRAM
w .k in in
L1 L2
MNEMONICS SUB A LDA 4200 MOV B,A LDA 4201 MVI C,00 CMP B JC L2 SUB B INR C JMP L1 STA 4250 MOV A,C STA 4251 HLT
di
a.
co m
OPCODE
OUTPUT:
MANUAL CALCULATION:
RESULT: Thus the ALP was written and the 8 bit arithmetic operations were performed successfully using 8085 microprocessor trainer kit.
EX.NO. :2
Einstein College of Engineering Page 10 of 76
w .k in in
di
a.
co m
DATE
16-BIT ADDITION AIM To write an ALP to perform 16-bit addition using 8086 microprocessor trainer kit. APPARATUS REQUIRED 1. 8085 microprocessor trainer kit. 2.Power supply ALGORITHM
w .k in in
Einstein College of Engineering Page 11 of 76
PROGRAM
di
a.
co m
INPUT:
OUTPUT:
MANUAL CALCULATION:
w .k in in
Einstein College of Engineering Page 12 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 13 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 14 of 76
di
a.
co m
RESULT: Thus the ALP was written and the 16-bit arithmetic operations was performed successfully by using the 8086 microprocessor trainer
w .k in in
di
Einstein College of Engineering Page 15 of 76
a.
co m
w
1. 2. 3. 4. 5. 6.
w .k in in
Load the input data. Move the count value to B register. Send data to the output device through port. Call the delay program After the delay time load the next data and repeat the same. By changing the delay time we can change the speed.
di
a.
co m
w .k in in
Einstein College of Engineering Page 17 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 18 of 76
di
a.
co m
STEP 1 1
0 1
09 1 05 2 1 0 0 1 1 1 0 0 A 06
3 4
0 1
1 0
1 1
0 0
06 0A
3 4
0 1
1 0
0 0
1 1
05 09
MNEMONICS
1018
w .k in in
LOOKUP Einstein College of Engineering Page 19 of 76
di
a.
OPCODE
co m
ADDRESS
LABEL
MNEMONICS
OPCODE
RESULT: Thus a program to run a stepper motor at different speeds in two directions was written and executed using 8086 p
w .k in in
Einstein College of Engineering Page 20 of 76
di
a.
co m
AIM: To write an assembly language program to convert analog to digital output APPARATUS REQUIRED: 8085 p kit, ADC board, Interface chord, Power chord. ALGORITHM: 1. Load the data 10 H to make the ALE signal low. 2. Load the data 18 H to make the ALE signal low. 3. Place jumper J2 in B position. 4. Place jumper J5 in A position. 5. Enter & execute the program. 6. Vary the analog input (using prompt) and give the SOC (by pressing the SOC switch). 7. Set the corresponding digital value in the LED display.
THEORY:
The device contains an 8 channel single ended analog signal multiplexer. A particular input channel is selected by using the address decoding. I/O decoding
A 3:8 decoder 74LS138 is employed to generate I/O decoding logic. The address lines A3, A4, and A5 are tied to pin 1, 2, 3 of 74LS138 respectively. The address lines A6 and A7 are NANDed together and the NAND gate o/p is connected to pin 5 of 74LS 138.similarly IOW and IOR signals NANDed together and the NAND gate o/p is connected to pin 6 of 74LS 138. Pin 4 is grounded. The buffer 74LS244 which transfers the converted data output to data bus is selected when
A7 1
A6 1
w
A5 0
w .k in in
A4 0 A3 0
di
a.
A2 X
co m
A1 X =C0 H
A0 X
w .k in in
Einstein College of Engineering Page 22 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 23 of 76
di
a.
co m
The I/O address for the latch 74LS174 which latches the data bus to address A,B,C and ALE1 and ALE 2. A7 1 A6 1 A5 0 A4 0 A3 1 A2 X =C8 Data to be outputted to port address C8 for channels 0 to 7 S.No Channel No EOC address in Hexa Data in Hex Channel No Channel No ALE High ALE Low OE Low OE High 18 10 19 11 1A 12 1B 13 1C 14 1D 15 1E 16 1F 17 A1 X A0 X
PROGRAM:
ADDRESS
w
LABEL MNEMONICS MVI A,10 OUT 0C8 H MVI A,18 OUT 0C8 H HLT
w .k in in
OPCODE Einstein College of Engineering Page 24 of 76
di
a.
1 2 3 4 5 6 7 8
D8 D8 D8 D8 D8 D8 D8 D8
co m
MANUAL CALCULATION
RESULT: Thus the assembly language program to convert analog to digital output digital output was executed successfully.
w .k in in
Einstein College of Engineering Page 25 of 76
di
a.
co m
I/O decoding
w .k in in
A5 0 A4 0 A3 0
A 3:8 decoder 74LS138 is employed to generate I/O decoding logic. The address lines A3, A4, and A5 are tied to pin 1, 2, 3 of 74LS138 respectively. The address lines A6 and A7 are NANDed together and the NAND gate o/p is connected to pin 5 of 74LS 138.similarly IOW and IOR signals NANDed together and the NAND gate o/p is connected to pin 6 of 74LS 138. Pin 4 is grounded.
di
A3 1
a.
A7 1
co m
A2 X A1 X A2 X =C8 A1 X
CIRCUIT IMPLEMENTATION: The basic DAC interface board incorporates two 8 bit digital to analog converters, DAC0800.The DAC interface section comprises of I/O decoding and D/A conversion circuit.
A6 1
A0 X
A5 0
A4 0
A0 X
DAC2 is selected
The o/p voltage between -5V and 5V.the o/p voltage varies in steps of 10/256=.04 i/p data in hexa o/p voltage 00 01 02 .. .. .. 7F .. FD FE FF -5.00 -4.96 -4.92 .. .. .. 0.00 .. 4.92 4.96 5.00
PROGRAM:
ADDRESS
w .k in in
LABEL
ALGORITHM: 1. Clear the accumulator to Display low level of square wave 2. Send the data to o/p device through port 3. Call the delay program. 4. Load the accumulator with FF to Display high level of square wave 5. Send the data to o/p device through port 6. Call the delay program 7. Continue from step1
MNEMONICS
di
a.
co m
OPCODE
OUTPUT:
PROGRAM:
OUTPUT:
TRIANGULAR WAVEFORM AT DAC2OUTPUT: ALGORITHM: 1. Clear the accumulator through L register. 2. Send the data to o/p device through port 3. Incrment the L register 4. Do the above process until zero flag is set 5. Load the accumulator with FF through L register. Einstein College of Engineering Page 28 of 76
w .k in in
ADDRESS
LABEL
MNEMONICS
di
a.
OPCODE
co m
ALGORITHM : 1. Clear the accumulator 2. Send the data to o/p device through port 3. Incrment the accumulator to display next o/p voltage. 4. Do the above process until zero flag is set 5. Continue from step1
Sub Code: EC 58 Microprocessors and Microcontrollers Lab 6. Send the data to o/p device through port 7. Incrment the L register 8. Do the above process until zero flag is set 9. Continue from step1
PROGRAM:
OPCODE MOV BL,00 MOV AL,BL OUT C8,AL INC BL JNZ 1003 MOV BL,FF MOV AL,BL OUT C8,AL DEC BL JNZ 100E JMP 1000
OUTPUT:
SINE WAVEFORM GENERATION AT DAC1 OUTPUT: ALGORITHM: 1. Load 49 input datas to generate sine wave in lookup table 2. Load the count as 49 in C register 3. Send the data to o/p device through port 4. Load the next data 5. Decrement the count and check if it is zero 6. If zero go to the loop or else go to step 1
w .k in in
Einstein College of Engineering Page 29 of 76
di
a.
co m
FORMULA USED: 128+128 SINX WHERE X=0 to 360 with step 5 EXAMPLE:
DEGREES
DECIMAL
HEXA
128
80
PROGRAM:
ADDRESS LABEL
MNEMONICS
1100
LOOKUP
MOV BX,1100 MOV CL,49 MOV AL,[BX] OUT C0,AL INC BX LOOP 1007 JMP 1000 80,8B,96,A1,AB,B6, C0,C9,D2,DA,E2,E8, EF,F4,F8,FB,FE,FF, FF,FF,FF,FE,FB,F8, F4,EF,E8,E2,DA,D2, C9,C0,B6,AB,A1,96 ,8B,80,74,6A,5F,54, 4A,40,36,2E,25,1E, 17,11,0C,08,04,02,00, 00,00,02,04,08,0C,11, 17,1E,25,2E,36,40, 4A,54,5F,6A,74,80
w .k in in
di
a.
Einstein College of Engineering Page 30 of 76
co m
OPCODE
RESULT: Thus the square, saw tooth, triangular and sine waveforms were generated using 8086 p.
w .k in in
Einstein College of Engineering Page 31 of 76
di
a.
co m
THEORY:
A7 A6 A5 A4 A3 A2 A1 A0 Hexa Control register 1 1 0 0 1 1 1 0 CE Channal 0 1 1 0 0 1 0 0 0 C8 Channal 1 1 1 0 0 1 0 1 0 CA Channal 2 1 1 0 0 1 1 0 0 CC The chip 8253 has a control register which stores the operational mode of each counter. This register can only be within into, no read operation of its contents are possible .Each counter of 8253 can be individually programmed by writing corresponding control words by simple I/O operation. CONTROL WORD FORMAT: D7 D6 D7 D5 D3 D0 D5 D4 D3 D2 D1 D0
w .k in in
di
Einstein College of Engineering Page 32 of 76
a.
A 3:8 decoder 74LS138 is employed to generate I/O decoding logic. The address lines A3, A4, and A5 are tied to pin 1, 2, 3 of 74LS138 respectively. The address lines A6 and A7 are NANDed together and the NAND gate o/p is connected to pin 5 of 74LS 138.similarly IOW and IOR signals NANDed together and the NAND gate o/p is connected to pin 6 of 74LS 138. Pin 4 is grounded.
co m
RD/WR D5 0 0 1 1 MODE 0 1 2 3 4 5
D4 0 1 0 1
D7 D6 0 0 -------------Channel 0
ALGORITHM: 1. Load the accumulator with control word for channel 0and mode 0 selection. 2. Move the data to control register. 3. Load the MSB and LSB of count 4. Move the data to data register
w .k in in
D5 D4 1 1 -------------LSB/MSB
di
D7 D6 0 0 -------------Channel 0
D5 D4 1 1 -------------LSB/MSB
a.
co m
OUTPUT:
MANUAL CALCULATION:
OUTPUT:
w .k in in
Einstein College of Engineering Page 34 of 76
di
a.
EXAMPLE:
co m
ADDRESS
LABEL START
MNEMONICS MOV AL,30 0UT CE,AL MOV AL,05 OUT C8,AL MOV AL,00 OUT C8,AL HLT
OPCODE
PROGRAM: MODE 3- SQUARE WAVE GENERATOR ADDRESS LABEL START MNEMONICS MOV AL,36 0UT CE,AL MOV AL, OUT C8,AL MOV AL. OUT C8,AL HLT OPCODE
w .k in in
ALGORITHM: MODE 3- SQUARE WAVE GENERATOR 1 Load the accumulator with control word for channel 0and mode 3 selection. 2 Move the data to control register. 3 Load the MSB and LSB of count 4 Move the data to data register
di
a.
co m
RESULT: Thus the program for 8253 interfacing with 8086 microprocessor was written successfully.
w .k in in
Einstein College of Engineering Page 36 of 76
di
a.
co m
a b c
w
Segment Definition
w .k in in
I/O Decoding
di
Address C2 C0
A 3:8 decoder 74LS138 is employed to generate I/O decoding logic. The address lines A3, A4, and A5 are tied to pin 1, 2, 3 of 74LS138 respectively. The address lines A6 and A7 are NANDed together and the NAND gate o/p is connected to pin 5 of 74LS 138.similarly IOW and IOR signals NANDed together and the NAND gate o/p is connected to pin 6 of 74LS 138. Pin 4 is grounded.
a.
co m
DD (Display Mode) 00- 8 bit character display left entry 01- 16 bit character display left entry 10- 8 bit character display right entry 11- 16 bit character display right entry KKK (Keyboard Mode) 000-2 Key lockout 0 0
0 =00
co m
0 0 CD CF 1 0 A A 0 0 A A 0 0
w .k in in
di
1 A 0 X 0 =40
Clear Display(110) 1 1
CD
CD
a.
CA
=CC H
w
0
w
0 1 =90 H
DU
1 =07
1 =FF
(A) KEYBOARD INTERFACE ALGORITHM: 1. Load the data count in B register 2. Set display mode 3. Move the data to control register. 4. Clear display. 5. Move the data to control register. 6. Write display RAM 7. Move the data to control register 8. Clear the display RAM 9. Move the data to data register. 10. Decrement the count 11. Repeat the step5 for all the data display 12. Check whether the key is pressed or not 13. If the key is pressed go to next step otherwise repeat step 12. 14. Set to read FIFO RAM. 15. Move the data to control register 16. Get the data from the pressed key & display it
w .k in in
di
a.
co m
Einstein College of Engineering Page 39 of 76
ADDRESS
LABEL
MNEMONICS OPCODE
LOOKUP TABLE
w
4200 4204 4208 420C 0C 99 08 6C
w .k in in
9F 29 09 1A 4A 28 88 68
di
0B 8F 38 E8 Einstein College of Engineering Page 40 of 76
a.
co m
(B) (ROLLING DISPLAY) ALGORITHM: 1. Initialise the counter 2. Set Display mode. 3. Move the data to control register 4. Clear display 5. Move the data to control register 6. set the write display RAM 7. Move the data to control register 8. Get the first data to be displayed 9. Display the data 10. Call the delay subroutine 11. Get the next data & repeat the steps 9,10until the count is zero
w .k in in
Einstein College of Engineering Page 41 of 76
di
a.
co m
FF FF 68 29
w
FF FF 7C FF FF FF C8 FF
w .k in in
Einstein College of Engineering Page 42 of 76
di
a.
co m
RESULT: Thus keyboard & Display were interfaced with 8279 by using 8086microprocessor.
w .k in in
Einstein College of Engineering Page 43 of 76
di
a.
co m
ADDRESS
w .k in in
LABEL START L2 L1
PROGRAM:
di
MNEMONICS OPCODE MOV DX,05 DEC DX MOV CX,DX MOV BX,1100 MOVAX,[BX] ADD BX,2 CMP AX,[BX] JB L1 MOV AX,[BX] LOOP L2 MOV [1500],AX HLT
a.
Einstein College of Engineering Page 44 of 76
co m
MAXIMUM NUMBER: ALGORITHM: 1. Get the COUNT in CX register and inputs in specified memory location. 2 .Compare the 1st two datas and load the small data in accumulator. 3. Compare the accumulator with the remaining datas and store the largest data in accumulator. 5. Stop the program.
INPUT:
OUTPUT:
INPUT:
OUTPUT:
w .k in in
Einstein College of Engineering Page 45 of 76
MANUAL CALCULATION:
di
a.
co m
PROGRAM:
ADDRESS
LABEL
MNEMONICS OPCODE
START
L2
L1
RESULT: Thus the ALP for searching largest and smallest numbers from an array of datas was executed using 8086p.
w .k in in
Einstein College of Engineering Page 46 of 76
di
a.
co m
MOV DX,05 DEC DX MOV CX,DX MOV BX,1100 MOVAX,[BX] ADD BX,2 CMP AX,[BX] JNB L1 MOV AX,[BX] LOOP L2 MOV [1500],AX HLT
ADDRESS
w .k in in
LABEL START L1 L2 L3
PROGRAM:
di
MNEMONICS OPCODE
MOV CX,05 MOV DX,CX MOV BX,1100 MOV AX,[BX] CMP AX,[BX+2] JB L3 XCHG [BX+2],AX MOV [BX],AX ADD BX,2 LOOP L2 MOV CX,DX LOOP L1 HLT
a.
co m
OUTPUT:
MANUAL CALCULATION:
w .k in in
Einstein College of Engineering Page 48 of 76
di
a.
co m
DESCENDING ORDER : ALGORITHM: 1. Get the number of inputs. 2. Load the inputs in memory location 1100. 3. Compare the 1st and 2nd data. 4. If there is no carry go to step 6. 5. If there is carry exchange two datas. 6. Compare 2nd and 3rd data and repeat the same up to last data. 7. Now, we get the smallest number in the last place. 8. Repeat the steps from 3. 9. Stop the program. PROGRAM:
a.
ADDRESS
LABEL
MNEMONICS
w .k in in
L2 L3
START L1
MOV CX,05 MOV DX,CX MOV BX,1100 MOV AX,[BX] CMP AX,[BX+2] JNB L3 XCHG [BX+2],AX MOV [BX],AX ADD BX,2 LOOP L2 MOV CX,DX LOOP L1 HLT
di
Einstein College of Engineering Page 49 of 76
co m
OPCODE
INPUT:
OUTPUT:
MANUAL CALCULATION:
RESULT: Thus an ALP for sorting an array in ascending and descending order were executed using 8086 p.
w .k in in
Einstein College of Engineering Page 50 of 76
di
a.
co m
ADDRESS
w .k in in
LABEL L1 MOV SI, 2000 MOV DI, 2100 MOV CX, 05 CLD MOV SB LOOP L1 HLT
PROGRAM:
di
MNEMONICS OPCODE
a.
co m
Einstein College of Engineering Page 51 of 76
b) STORING A DATA IN SET OF LOCATIONS: OBJECTIVE: To fill the locations in memory with the byte INPUT:
OUTPUT:
MANUAL CALCULATION:
ALGORITHM: 1. 2. 3. 4. 5. 6.
w
Load the number of inputs. Load the destination address. Load the data byte. Facilitate auto incrementing of index register. Store the data in the locations up to the last location. Stop the program.
w .k in in
Einstein College of Engineering Page 52 of 76
di
a.
co m
PROGRAM:
ADDRESS
LABEL
MNEMONICS OPCODE
L1
Load the source address. Clear the count register. Load the assumed last data. Increment the count. Compare the data in source register with last data. If both the datas are same, store the count in location 1100. If both the datas are not same, increment the source address and load the second data. 8. Repeat the steps from 4.
INPUT:
OUTPUT:
w .k in in
di
a.
Einstein College of Engineering Page 53 of 76
co m
MOV CX, 0006 MOV DI, 1100 MOV AX, 0034 CLD STO SB LOOP L1 HLT
MANUAL CALCULATION:
PROGRAM:
ADDRESS
LABEL
MNEMONICS
a.
L1
MOV SI, 1200 MOV DX, FFFF MOV AH, FF INC DX MOV AL,[SI] INC SI CMP AH, AL JNZ L1 MOV [1100], DX HLT
w .k in in
di
co m
OPCODE Einstein College of Engineering Page 54 of 76
RESULT: Thus the programs for string manipulation operations were performed by using 8086 p.
w .k in in
Einstein College of Engineering Page 55 of 76
di
a.
co m
PROGRAM:
ADDRESS
w .k in in
LABEL STOP
di
MNEMONICS OPCODE ORG 4100 CLR C MOV A,#09 ADD A,#05 MOV DPTR,#4150 MOVX @DPTR,A INC DPTR MOVX @DPTR,A SJMP STOP
a.
co m
INPUT:
OUTPUT:
MANUAL CALCULATION:
w .k in in
Einstein College of Engineering Page 57 of 76
di
a.
co m
8-BIT SUBRACTION: ALGORITHM: 1. 2. 3. 4. 5. 6. Clear C register for carry Load the minuend Subtact the subtrahend from minuend If there is no carry,store the result If there is carry, increment the C register and store results Stop the program
8-BIT MULTIPLICATION: ALGORITHM: 1. Load the two datas in A and B registers 2. Multiply the two datas 3. Store the result 4. Stop the program
w .k in in
STOP
ORG 4100 CLR C MOV A,#32 SUBB A,#30 MOV DPTR,#4150 MOVX @DPTR,A SJMP STOP
di
Einstein College of Engineering Page 58 of 76
a.
co m
OPCODE
INPUT:
OUTPUT:
MANUAL CALCULATION:
INPUT:
OUTPUT:
MANUAL CALCULATION:
w .k in in
Einstein College of Engineering Page 59 of 76
di
a.
co m
PROGRAM:
ADDRESS
LABEL
MNEMONICS OPCODE ORG 4100 MOV A,#12 MOV B,#12 MUL AB MOV DPTR,#4500 MOVX @DPTR,A INC DPTR MOV A,B MOVX @DPTR,A SJMP STOP
STOP
PROGRAM: ADDRESS
w .k in in
LABEL STOP
ALGORITHM: 1. Load the dividend and divisor 2. Divide the dividend by divisor 3. Store the quotient and reminder 4. Store the program
di
MNEMONICS OPCODE Einstein College of Engineering Page 60 of 76
w w
ORG 4100 MOV A,#12 MOV B,#12 DIV AB MOV DPTR,#4500 MOVX @DPTR,A INC DPTR MOV A,B MOVX @DPTR,A SJMP STOP
a.
8-BIT DIVISION:
co m
RESULT: Thus the 8-bit arithmetic operations like addition, subtraction, multiplication and division by using 8051 microcontroller and cross assembler were performed and executed
w .k in in
Einstein College of Engineering Page 61 of 76
di
a.
co m
ADDRESS
LABEL
MNEMONICS ORG 4100 MOV A,#32 ORL A,#F0 MOV DPTR,#4500 MOVX@DPTR,A SJMP STOP
a.
ALGORITHM: 1. Load the given data 2. Set the bit by ANDing that particular bit by 1 3. Store the result and stop the program. PROGRAM:
ADDRESS
w .k in in
STOP LABEL STOP
di
MNEMONICS
ORG 4100 MOV A,#32 ANL A,#0F MOV DPTR,#4500 MOVX@DPTR,A SJMP STOP
co m
OPCODE OPCODE Einstein College of Engineering Page 62 of 76
RESULT: Thus the program for masking and setting the higher order bits by using 8051 microcontroller and cross assembler were performed and executed .
w .k in in
Einstein College of Engineering Page 63 of 76
di
a.
co m
w .k in in
STOP
di
MNEMONICS OPCODE ORG 4100 MOV A,#12 CPL A MOV DPTR,#4200 MOVX@DPTR,A INC A INC DPTR MOVX@DPTR,A SJMP STOP
RESULT: Thus a program for performing logical operations using 8051 and cross assemler were executed
a.
Einstein College of Engineering Page 64 of 76
co m
w .k in in
Einstein College of Engineering Page 65 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 66 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 67 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 68 of 76
di
a.
co m
5.
7.
w .k in in
Einstein College of Engineering Page 69 of 76
di
a.
co m
w .k in in
di
Einstein College of Engineering Page 70 of 76
a.
co m
w .k in in
Einstein College of Engineering Page 71 of 76
di
a.
co m
w .k in in
di
Einstein College of Engineering Page 72 of 76
a.
co m
Sub Code: EC 58 Microprocessors and Microcontrollers Lab 37. What is the function of JNB instruction?
w .k in in
di
Einstein College of Engineering Page 73 of 76
a.
co m
w .k in in
di
Einstein College of Engineering Page 74 of 76
a.
co m
w .k in in
Einstein College of Engineering Page 75 of 76
di
a.
co m
w .k in in
Einstein College of Engineering Page 76 of 76
di
a.
co m