AARUPADAI VEEDU INSTITUTE OF TECHNOLOGY PAIYANOOR

LAB MANUAL
MICROPROCESSORS AND MICROCONTROLLER LABORATORY

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING AARUPADAI VEEDU INSTITUTE OF TECHNOLOGY OLD MAHABALIPURAM ROAD

LIST OF EXPERIMENTS 1. 2. 3. 4. 5. 6. 7. Programming 8085. Programming 8086. Programming 8051. Pc based control systems. Stepper Motor Controller. PC interfacing. AC & DC Motor Speed Control.

LIST OF EXPERIMENTS A.8085 Programming 1. Study of 8085 Microprocessor 2. 16 bit Addition, Subtraction, Multiplication and Division. 3. BCD to HEX and HEX to BCD code conversion. 4. Largest and smallest of a given set of numbers. 5. Square Root of 8-bit number. B.8086 Programming 1. 2. 3. 4. Study of 8086 Microprocessor 32 bit Addition and Addition of 3*3Matrices. Ascending Order and Descending Order. Reversal of a String.

C. Interfacing Experiments 1. 2. 3. 4. 5. Keyboard and Display Interface ADC Interface. DAC Interface. Stepper Motor Interface. Traffic Signal Modeling.

D.8051 Programming Study of 8051. 1. 8 Bit Arithmetic Operations. Addition, Subtraction, Multiplication and Division 2. Addition of two sixteen bit numbers. 3. Transferring a Block of data from (i). Internal to External memory. (ii). External to External memory. (iii). External to Internal memory. 4. 8-bit Conversion (i).ASCII to its equivalent Hexa decimal and (ii). Hexa decimal to its equivalent ASCII 5. Arrange the given numbers in ascending and descending order. 6. Filling External and Internal Memory. E. Interfacing Experiments 1. DAC Interfacing. 2. Stepper Motor Interfacing.

ALGORITHM: Step 1: Initialize register C to account for carry. . Step 6: Stop the process. Step 2: The addend is brought to the accumulator. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard (ii) Power cable. Step 3: Move the augend to any one of the register. Step 5: Store the 8 bit and carry in two memory locations.Experiment No: Date: ADDITION OF TWO 8-BIT NUMBERS AIM: Write a program to add two 8 bit numbers and store the result in memory location 4200 and 4201. Step 4: Perform the addition.

FLOWCHART Start Initialize C register to zero for carry Get first data in Accumulator Get second data in B register ADD two numbers Is carry Flag Set? NO YES Increment C register by one Store the Sum & Carry in the desired memory locations Stop .

Store carry to memory 4201. . Store 8 bit sum to memory location 4200. to store carry. Stop the process. Initialize HL reg. Move 2nd data to B reg.C STA 4201H HLT OPCODE OPERAND LOOP 410CH 410DH 4110H 4111H 4114H COMMENTS Initialize C reg. Increment HL reg.M ADD B JNC LOOP INR C STA 4200H MOV A. Move 1st data to accumulator. RESULT: Thus the program for addition of two 8-bit numbers has been written and executed and the sum is verified.4150H MOV A. Check whether Carry Flag is reset. Add two numbers in A & B.PROGRAM: LABEL START ADDRESS 4100H 4102H 4105H 4106H 4107H 4108H 4109H MNEMONIC MVI C.00H LXI H. Move carry to Accumulator. pair to point 1st data. Increment C register.M INX H MOV B. pair to point 2nd data.

What is Microprocessor ? What are the basic units of a microprocessor ? What is a bus? What is assembly language? Why data bus is bi-directional? .VOCE QUESTIONS 1. 5.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA. 3. 4. 2.

Step 3: Move the subtrahend to anyone register. . Step 7: Store the difference & borrow in memory location 4502 and 4503. Step 2: The Minuend is brought to the accumulator. Step 5: If the carry flag is reset go to step 7. else proceed to the next step. Step 8: Stop the process. Step 6: Take 2’s complement of the accumulator content and increment C register. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard (ii) Power cable ALGORITHM: Step 1: Initialize register C to account for Borrow. Step 4: Perform the subtraction.Experiment No: Date: SUBTRACTION OF TWO 8-BIT NUMBERS AIM: Write a program to subtract two 8 bit numbers and store the result in memory location 4502 and 4503.

Store the Results in the desired memory locations Stop .FLOWCHART Start Initialize C register to zero for Borrow Get Minuend in Accumulator Get Subtrahend in any other register Subtract Subtrahend from Accumulator Is carry Flag Set? NO YES Take 2’s Complement of Accumulator& increment C Reg.

Move 2nd to register B. Increment HL reg pair to point 2nd data.PROGRAM : LABEL START ADDRESS 4300H 4302H 4305H 4306H 4307H 4308H 4309H 430CH 430DH MNEMONIC MVI C.A INX H MOV M. Initialize HL reg pair to point 1st data.C HLT OPCODE OPERAND SKIP 430FH 4310H 4311H 4312H 4313H 4314H COMMENTS Initialize C reg to store carry. . Move 1st data to accumulator.M INX H MOV B. RESULT: Thus the subtraction program has been written & executed and the difference and borrow were verified. If Carry Flag reset. go to skip.00H LXI H. If the Subtraction result in borrow take 2’s complement of the accumulator Increment register C Store the result in the desired memory location Store the carry flag to indicate whether the result is positive or negative Stop the process.M SUB B JNC SKIP CMA ADI 01H INR C INX H MOV M.4500H MOV A. Subtract the subtrahend from minuend.

4. Define T-State 5. What is the data and address size in 8086? 3. What is the difference between CPU bus and system bus? . Define machine cycle.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA-VOCE QUESTIONS 1. Why address bus is unidirectional? 2.

Experiment No: Date: MULTIPLICATION OF TWO 8-BIT NUMBERS AIM: To write an Assembly Language Program for the multiplication of two 8-bit numbers. Step 7: Decrement the B register. Step 2: Clear C register. Step 8: If the content of B reg is not equal to zero go to step 5. Step 9: Store the content of accumulator in Next memory location. otherwise go to next step. Step 10: Store the higher order byte in next memory location. Step 6: Check the carry flag if CY=0 go to step 7 otherwise increment the C register. Stop the Process. Step 3: Get the multiplicand in accumulator and get the multiplier in B-reg. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard (ii) Power cable. ALGORITHM: Step 1: Initialize the HL registers pair with the address 4200H. Step 5: Add the content of A register with the content of D register. . Step 4: Move the Multiplicand to D register. Step 11.

FLOWCHART Start Initialize the HL register pair and get the multiplicand in A & D Get the multiplier in B-reg & decrement it by one ADD accumulator (multiplicand) to D reg. content NO Is carry flag Set? YES Increment carry register by one Decrement Multiplier by one Is multiplier Zero YES NO Store the result in desired location Stop .

pair. Decrement B reg. Move the Multiplicand to D reg. Increment C reg.A INX H MOV M. . Decrement B reg. Move the Multiplier to B reg. otherwise do next step Increment the HL reg.M INX H MOV B. If CY=0. program control goes to LOOP2. Store the least significant byte of the product to the memory location pointed by HL pair. If B is not equal to zero.00H MOV A.A ADD D JNC LOOP1 INR C DCR B JNC LOOP2 OPCODE OPERAND 4106H 4107H 4108H 4109H LOOP2 410AH 410BH LOOP1 410EH 410FH 4110H 4113H 4114H 4115H 4116H 4117H INX H MOV M. Add the content of A reg with D reg.C HLT COMMENTS Load the HL reg pair with the address 4200H Clear C reg Move the Multiplicand to the accumulator. Stop the Process RESULT: Thus the Assembly Language Program for the multiplication of two 8-bit data had been written and executed & the results were stored in desired memory locations. Increment the HL reg pair. Increment the HL reg. program control jumps to label LOOP1.M DCR B MOV D.4200H MVI C. content.PROGRAM : LABEL START ADDRESS 4100H 4103H 4105H MNEMONIC LXI H. Store the most significant byte of the product to the memory location pointed by HL pair.

What is the need for system clock and how it is generated in 8085? 5. Why EPROM is mapped at the beginning of memory space in 8085 system? 4. What does memory-mapping mean? 2. What is interrupt 1/0? 3. What is the need for Port? .OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1.

Step 9: store the quotient in 4502H.Experiment No: Date: DIVISION OF TWO 8-BIT NUMBERS AIM: To write an Assembly Language Program for dividing two 8-bit numbers and store the result in memory locations 4502 and 4503. . Otherwise go to next step. Step 4: Compare dividend and divisor. Step 10: Stop the Process. Step 3: Get dividend in accumulator & get divisor in B register. go to step 8. Step 7: Go to step 4. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard (ii) Power cable. Step 6: Subtract divisor from dividend and increment C register. Step 5: If carry occurs. Step 8: Store the remainder in 4503H. Step 2: Clear the C register. ALGORITHM: Step 1: Initialize the HL register pair with address 4500H.

Initialize C reg.FLOWCHART Start Get dividend & divisor. for Quotient Is Dividend > Divisor NO YES Subtract Divisor from Dividend Increment Quotient by one Store the Quotient and Store the dividend as remainder Stop .

jump to label SKIP. Stop the Process 4111H 4114H 4115H 4118H RESULT: Thus the Assembly Language Program for the Division of two 8-bit data had been written and executed & the results were stored in desired memory locations. If carry=1. Increment the HL reg pair.PROGRAM : LABEL START ADDRESS 4100H 4103H 4105H MNEMONIC LXI H. Store the remainder.00H MOV A. Move the Divisor to B reg. Subtract the divisor from dividend. Move the Dividend to the accumulator. Move the Quotient to Accumulator.4500H MVI C. . Jump to label REPEAT.C STA 4502H HLT OPCODE OPERAND 4106H 4107H REPEAT 4108H 4109H 410CH 410DH 410EH SKIP COMMENTS Load the HL reg pair with the address 4500H.M CMP B JC SKIP SUB B INR C JMP REPEAT STA 4503H MOV A. Clear C reg. Store the Quotient. Increment C reg. Compare B reg.M INX H MOV B.

Give some examples of port devices used in 8085 microprocessor based system? 3. What is the drawback in memory mapped I/0? 5.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. How DMA is initiated? . What is a port? 2. Write a short note on INTEL 8255 4.

go to step 4. Step 4: Compare the next data from the memory address pointed by HL pair to the accumulator. otherwise go to next step. Step 5: Check the Carry Flag. . Length of the array) in B register. Step 9: Store the content of accumulator in the address 5000H. Step 7: Decrement the count (content of B register) Step 8: If the content of B register is not equal to zero. If the CF is reset go to step 7 otherwise go to next step.e.Experiment No: LARGEST NUMBER IN GIVEN ARRAY Date: AIM: To write an Assembly Language Program to find the largest number in the given Array. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. Step 10: Stop the Process.. Step 2: Get the first Data in accumulator. (ii) Power cable. Step 3: Get the count (i. Step 6: Move the data from the memory address pointed by HL pair to the accumulator. ALGORITHM: Step 1: Initialize the HL register pair with the address 4700H.

FLOWCHART Start Get the length of the array as the count Move the first data to Accumulator Increment the memory pointer Compare the second data with content of Accumulator Is A content Large? NO Move M to A YES Decrement B reg NO Is Count=0? YES Store the Content of accumulator as largest number Stop .

M DCR B JNZ LOOP STA 5000H HLT 410D 411E 4111 4114 Initialize the memory pointer with the address 4700H Get the length of the array in B reg. If CF is reset.M DCR B INX H 4107 4108 CMP M 410B JNC SKIP 410C SKIP MOV A. content by one Increment the HL reg. 4700H 4103 4104 MOV B. content If ZF is reset go to LOOP. Get the first data in Accumulator. Move the data from memory to accumulator. the program control goes to label SKIP. Increment the HL reg. Compare the data in accumulator with data in memory. pair to point the next memory location. pair to point the next memory location. Store the largest number in 5000H Stop the process RESULT: Thus the Assembly Language Program to find the largest of the given data had been written and executed & the result was stored in the desired memory location .PROGRAM: LABEL START ADDRESS MNEMONICS OPCODE OPERAND COMMENTS 4100 LXI H. Decrement B reg.M INX H 4105 4106 LOOP MOV A. Decrement B reg.

3. 4. What is Instruction cycle? What is fetch and execute cycle? What is Block and Demand transfer mode DMA? What is the need for timing diagram? How many machine cycles constitute one instruction cycle in 8085? . 2. 5.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1.

Step 2: Get the first Data in accumulator. . APPARATUS REQUIRED: ((i) 8085 Microprocessor kit with keyboard. go to step 7 otherwise go to next step. otherwise go to next step. Length of the array) in B register. ALGORITHM: Step 1: Initialize the HL register pair with the address 4700H. Step 6: Move the data from the memory address pointed by HL pair to the accumulator. If the CF is set. Step 4: Compare the next data from the memory address pointed by HL pair to the accumulator. Step 5: Check the Carry Flag. Step 3: Get the count (i.e. (ii) Power cable. Step 9: Store the content of accumulator in the address 5000H. Step 10: Stop the Process.Experiment No: Date: SMALLEST NUMBER IN GIVEN ARRAY AIM: To write an Assembly Language Program to find the smallest number in the given Array. Step 7: Decrement the count (content of B register) Step 8: If the content of B register is not equal to zero. go to step 4..

NO Is Count=0? YES Store the Content of accumulator as smallest number Stop .FLOWCHART Start Get the length of the array as the count Move the first data to Accumulator Increment the memory pointer Compare the memory with content of Accumulator Is A content Small? NO Move M to A YES Decrement B reg.

Compare the data in accumulator with data in memory.M DCR B JNZ LOOP STA 5000H HLT 410D 411E 4111 4114 Initialize the memory pointer with the address 4700H Get the length of the array in B reg. content.PROGRAM: LABEL START ADDRESS MNEMONICS OPCODE OPERAND COMMENTS 4100 LXI H. content by one Increment the HL reg. OBSERVATION: . Move the data from memory to accumulator. Store the smallest number in 5000H Stop the process RESULT: Thus the Assembly Language Program to find the smallest of the given data had been written and executed & the result was stored in the desired memory location. If CF is set the program control goes to SKIP. Decrement B reg. Increment the HL reg.M INX H 4105 4106 LOOP MOV A. pair to point the next memory location.M DCR B INX H 4107 4108 CMP M 410B 410C SKIP JC SKIP MOV A. Decrement B reg. pair to point the next memory location. If ZF is reset go to LOOP. 4700H 4103 4104 MOV B. Get the first data in Accumulator.

Why status signals are provided in microprocessor? 5 . 2. What operation is performed during first T -state of every machine cycle in 8085 ? 4.ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. Define opcode and operand. How the 8085 processor differentiates a memory access and I/0 Access? Experiment No: Date: . What is opcode fetch cycle? 3.

Step 11: Store the smallest number to the previous memory location & greatest to the current memory location. Step 10: Check ZF. Step 4: Save the count 2 in E register. Step 3: Get the count 2. otherwise do next step. Step 9: Check CF. Step 7: Move the data from memory location pointed by HL pair to the Accumulator. Step 16: Stop the Process. Step 13: If the number of comparison is not equal to zero. If zero flag is set (accumulator content is equal to the other number). . Step 2: Get the count 1. go to step 5. otherwise do the next step. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. ALGORITHM: Step 1: Initialize the HL register pair with the address 4700H. Step 14: Decrement the number of repetitions (count 1). Step 6: Initialize the HL register pair with the address 4701H. go to step 12 otherwise do next step. If carry flag is set (accumulator content is smaller than the other number). go to step 12 otherwise do next step. go to step 7. (ii) Power cable. Step 15: If the number of repetitions is not equal to zero. Step 12: Decrement the number of comparisons (count 2).8085-ASCENDING ORDER AIM: To write an Assembly Language Program to arrange the given data in Ascending Order. number of repetitions (length of array . Step 5: Move the content of E to C register. number of comparisons (length of array -1) in C register. Step 8: Compare the data from next memory location with the content of Accumulator.1) in B register.

the length of series Initialize COUNT 1 for (N-1) repetitions Initialize COUNT 2 for (N-1) Comparisons Increment memory pointer and get the number from series IS pointer < NO (pointer+1)? YES Decrement COUNT 2 NO Is COUNT 2 = Zero? YES Decrement COUNT 1 NO Is COUNT 1 = zero? YES Stop Interchange Numbers .FLOWCHART Start Initialize memory pointer to get N.

C MOV C.B MOV E.D INX H DCR C JNZ REPEAT DCR B JNZ LOOP HLT Initialize HL reg. 4701H MOV A.A DCX H MOV M.M INX H CMP M JC SKIP JZ SKIP MOV D. . pair with 4700H B = COUNT 1 for (N-1)repetitions C = COUNT 2 for (N-1)Comparisons LOOP 4108 REPEAT 410B 410C 410D 411E 4111 4114 4115 4116 4117 4118 4119 411A 411D 411E 4121 Compare consecutive numbers Interchange numbers if not in order SKIP Decrement count 2 Decrement count 1 Stop the Process RESULT: Thus the Assembly Language Program to arrange the given data in ascending order had been written and executed. 4700H MOV B.M DCR B MOV C.E LXI H.M MOV M.PROGRAM : LABEL START ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100 4103 4104 4105 4106 4107 LXI H.

5. 3.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 4. 2. When the 8085 processor checks for an interrupt? What is interrupt acknowledge cycle? How the interrupts are affected by system reset? What is Software interrupts? What is Hardware interrupt? .

Step 6: Initialize the HL register pair with the address 4701H. Step 5: Move the content of E to C register. Step 4: Save the count 2 in E register. number of comparisons (length of array -1) in C register. Step 13: If the number of comparison is not equal to zero. Step 2: Get the count 1. otherwise do the next step. go to step 7. Step 3: Get the count 2. number of repetitions (length of array . go to step 5. ALGORITHM: Step 1: Initialize the HL register pair with the address 4700H. If zero flag is set (accumulator content is equal to the other number). Step 11: Store the largest number to the previous memory location & smallest to the current memory location.1) in B register. Step 14: Decrement the number of repetitions (count 1). APPARATUS REQUIRED: (i) 8085 Microprocessor kit with Keyboard. (ii) Power cable. Step 16: Stop the Process. go to step 12 otherwise do next step. Step 10: Check ZF. Step 8: Compare the data from next memory location with the content of Accumulator. Step 9: Check CF. . Step 12: Decrement the number of comparisons (count 2). go to step 12 otherwise do next step. If carry flag is reset (accumulator content is larger than the other number). Step 15: If the number of repetitions is not equal to zero. Step 7: Move the data from memory location pointed by HL pair to the Accumulator. otherwise do next step.Experiment No: Date: 8085-DESCENDING ORDER AIM: To write an Assembly Language Program to arrange the given data in Descending Order.

the length of series Initialize COUNT 1 for (N-1) repetitions Initialize COUNT 2 for (N-1) Comparisons Increment memory pointer and get the number from series IS pointer > NO (pointer+1)? YES Decrement COUNT 2 NO Is COUNT 2 = zero? YES Decrement COUNT 2 NO Is COUNT 1 = zero? YES Stop Interchange Numbers .FLOWCHART Start Initialize memory pointer to get N.

PROGRAM : LABEL START ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100 4103 4104 4105 4106 4107 LXI H. 4701H MOV A.M MOV M.D INX H DCR C JNZ REPEAT DCR B JNZ LOOP HLT B = COUNT 1 for (N-1)repetitions C = COUNT 2 for (N-1)Comparisons LOOP 4108 REPEAT 410B 410C 410D 411E 4111 4114 4115 4116 4117 4118 4119 411A 411D 411E 4121 Compare consecutive numbers Interchange numbers if not in order SKIP Decrement count 2 Decrement count 1 Stop the Process RESULT: Thus the Assembly Language Program to arrange the given data in ascending order had been written and executed.C MOV C.B MOV E.E LXI H. .A DCX H MOV M. 4700H MOV B.M INX H CMP M JNC SKIP JZ SKIP MOV D.M DCR B MOV C.

4.Vectored interrupt? List the Software and Hardware interrupts of 8085? Whether HOLD has higher priority than TRAP or not? What is masking and why it is required? . What is the difference between Hardware and Software interrupt? What is Vectored and Non.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 3. 2. 5.

. Step 7: Increment the destination block pointer. Step 8: Decrement the C register. Step 9: If ZF=0. Step 4: Get byte from source memory block.otherwise go to next step. Step 5: Store the first data to the destination address. Step 6: Increment the source block pointer. Step 10: Stop the Process. Step 2: Move the total number of data to the C register. APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard (ii) Power cord. The total number of data (length of block) is stored at 46FFH.Experiment No: BLOCK OF DATA TRANSFER Date: AIM: To write an Assembly Language Program to transfer the block of data starting from memory location 4700H to the memory location 4800H. go to step 4. ALGORITHM: Step 1: Initialize the HL register pair with the address 46FFH. Step 3: Initialize the DE register pair with the address 4800H.

NO Is ZF=1? YES Stop .FLOWCHART Start Initialize HL reg. pair as a source Load the total number of input data In C reg. Get the Data from source Block to Accumulator Store data to destination block Increment the source & destination block pointer Decrement C reg.

Increment destination block pointer. program control jump to label REPEAT. Store the data byte to the destination block.M STAX D INX H INX D DCR C JNZ REPEAT HLT COMMENTS Initialize the source pointer with the address 4200H.PROGRAM: LABEL START ADDRESS 4100H 4103H 4104H 4105H MNEMONIC LXI H. Initialize the destination pointer with the address 4200H.46FFH MVI C. If ZF=0. Stop the Process RESULT: Thus the assembly language program to transfer the block of data from memory location 4700H to 4800H had been written and verified .4800H OPCODE OPERAND REPEAT 4108H 4109H 410AH 410BH 410CH 410DH 4110H MOV A. Increment source block pointer. Decrement C register.M INX H LXI D. Get count of total number of data bytes in C reg. Get the data byte from source block. Point to first source block byte.

3. 4. 2. 5.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. When the 8085 processor accept hardware interrupt? When the 8085 processor will disable the interrupt system? What is the function performed by Dl instruction? What is the function performed by El instruction? How the vector address is generated for the INTR interrupt of 8085? .

and save in E reg. (ii) Power cable.). APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. I f ZF=1 go to next step. ALGORITHM: Step 1: Get the Decimal data in A reg. Step 9: Get the decimal in A reg. Step 11: Stop the Process. Step 4: Clear the Accumulator.) to product (B reg.Experiment No: Date: DECIMAL TO HEXADECIMAL CONVERSION AIM: To write an Assembly Language Program to convert a Decimal number to a Hexadecimal number. . and mask the upper nibble(units). Step 10: Add the units (A reg. Step 6: Add B reg. The Decimal data is stored in 4200H and Hexadecimal data is store in 4250H. Step 8: Save the product in B reg. content to the A reg. Content. from E reg. Step 5: Move the 0AH to C reg. If ZF=0 go to step 6. Step 3: Rotate the upper nibble to the lower position. Step 2: Mask the lower nibble of the decimal data in A reg. Step 7: Decrement the C reg.

Clear A reg.FLOWCHART: Start Get the Decimal data in A reg. to A reg. and mask the upper nibble ADD the content of B reg. Mask the lower nibble of the Decimal data in A reg. four times right & save it in B reg. to A reg. to memory Stop . Store the Hexadecimal value from A reg. and save it in E reg. to B reg. Rotate the content of A reg. and move 0AH to C reg. ADD the content of B reg. Move the decimal data from E reg. Decrement C reg. NO Check if ZF=1? YES Move the content of A reg. to A reg.

Mask the lower nibble Rotate the upper nibble to lower Nibble position save in B reg.E ANI 0FH ADD B STA 4250H HLT Get the data in A reg.A ANI F0H RLC RLC RLC RLC MOV B.PROGRAM: LABEL START ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100 4103 4104 4106 4107 4108 4109 410A 410B 410C REPEAT 410E 410F 4110 4113 4114 4115 4117 4118 411B LDA 4200H MOV E. Save the product in B reg. Get the Decimal data in A reg. OBSERVATION: . Clear accumulator Get the product of units digit multiplied by 0AH in A reg.A XRA A MVI C.0AH ADD B DCR C JNZ REPEAT MOV B.A MOVA. Store the Hexadecimal value in memory Stop the Process RESULT: Thus the Assembly Language Program for Decimal to Hexadecimal conversion had been written and executed & the results were stored in desired memory location. Save in E reg. Mask the upper nibble Get the sum of units digit and product in B reg.

3. 4. How clock signals are generated in 8085 and what is the frequency of the 2. 5.ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. internal clock? What happens to the 8085 processor when it is resetted? What are the operations performed by ALU of 8085? What is a flag? List the flags of 8085 .

(ii) Power cable. ALGORITHM: Step 1: Get the first data in DE pair Step 2: Get the second data in HL pair Step 3: Add the data in DE & HL pair Step 4: Store the result in 4204. Step 5: Stop the Process. .Experiment No: Date: ADDITION OF TWO 16 BIT NUMBERS AIM: To write an Assembly Language Program to add two 16 bit numbers & store the result APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard.

FLOWCHART: Start Get the 1st data in DE register pair Get the 2nd data in HLregister pair Add DE & HL pair contents Store the result in 4204 &4205 Stop .

PROGRAM: LABEL ADDRESS MNEMONIC OPCODE OPERAND COMMENTS START 4100H LHLD 4200H Get first I6-bit number 4103H XCHG Save first I6-bit number in DE 4104H LHLD 4202H Get second I6-bit number in HL 4105H DAD D Add DE and HL 4106H SHLD 4204H Store I6-bit result in memory locations 4004H and 4005H. 4109H HLT Stop the program RESULT: Thus the Assembly Language Program for 16 bit addition had been written and executed & the results were stored in desired memory location. .

interrupts? What is an ALE? Explain the function of IO/M in 8085. 4. 3.OBSERVATION: ADDRESS INPUT DATA COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 5. Where is the READY signal used? What is HOLD and HLDA and how it is used? . Which interrupt has highest priority in 8085? What is the priority of other 2.

in memory locations 4204H and 4205H. ALGORITHM: Step 1: Get the first data in DE pair Step 2: Get the second data in HL pair Step 3: Subtract the lower order byte of the 1st & 2nd number Step 4: Subtract the higher order byte of the 1st & 2nd number Step 5: Store the result in .Experiment No: SUBTRACTION OF TWO 16 BIT NUMBERS AIM: Date: To write an Assembly Language Program to subtract two 16 bit numbers & store the result APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. (ii) Power cable. Step6: Stop the process .

FLOWCHART: Start Get the 1st & 2nd data in DE & HL register pair Subtract the lower order byte of the 1st & 2nd number Subtract the higher order byte of the 1st & 2nd number Store the result in 4204& 4205 Stop .

D 410DH SBB H Subtract higher byte of second number with borrow 410EH MOV H. 410FH 4112H SHLD 4204H HLT Store l6-bit result in memory locations 4004H and 4005H Stop the Process RESULT: Thus the Assembly Language Program for 16 bit subtraction had been written and executed & the results were stored in desired memory location. Get higher byte of the first number 410CH MOV A.A Subtract lower byte of the second number Store the result in L register . .PROGRAM: LABEL START ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100H 4103H 4104H LHLD 4200H XCHG LHLD 4202H Get the 1st data in HL reg pair Save in DE reg. pair Get second 16-bit number in HL 4107H MOV A.A Store l6-bit result in memory locations 4204H and 4205H.E Get lower byte of the first number 4108H 410BH SUB L MOV L.

List some of the features of INTEL 8259 (Programmable Interrupt Controller 5. What is Polling? 2. What are the different types of Polling? 3.OBSERVATION: ADDRESS INPUT DATA COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. What is a programmable peripheral device ? . What is the need for interrupt controller? 4.

If the result is not zero. ALGORITHM: Step 1: Get the first data in HL pair Step 2: Exchange the data with DE pair Step 3:Get the second data in HL pair Step 4: Copy the data in Stack Pointer(SP) Step 5: DAD with SP Step6: If there is carry. else goto step8 Step7: Increment BC pair Step8: Decrement DE pair Step9: Move E-reg content to accumulator Step10: OR DE pair content with accumulator. goto step5 Step10: Move BC register pair content to HL pair Step11: Store the accumulator content Step12: Stop the process .Experiment No: MULTIPLICATION OF TWO 16 BIT NUMBERS Date: AIM: To write an Assembly Language Program to multiply two 16 bit numbers & store the result APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. goto step7. (ii) Power cable.

Exchange HL pair content with DE pair Perform double addition Is there carry? NO YES Increment BC-reg content by 1 Decrement DE register pair by one Move E-reg content to accumulator DE reg pair. OR accumulator content With DE pair content NO Is the result zero? YES Store the result Stop . Exchange the data with DE pair Get the second data in HL pair. .FLOWCHART: Start Load the HL pair with 1st data.

.E ORA D JNZ L2 SHLD 4504H MOV A.PROGRAM: LABEL START: ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100H 4103H 4104H LHLD 4500H SPHL LHLD 4502 Load the HL pair with 1st data Exchange the data with DE pair Get the second data in HL pair Exchange HL pair content with DE pair Initialise HL pair & DE pair with00H Perform double addition If there is no carry. goto L1 Increment the content of BC reg pair by one Decrement the content of DE reg pair by one Move E-reg content to accumulator OR accumulator content with DE reg pair Jump to L2 if not zero Store HL pair content in 4504H Move C-reg content to accumulator Store HL pair content in 4506H Move B-reg content to accumulator Store accumulator content in 4507H Stop the process 4107H 4108H 410BH 410EH 410FH 4112H 4113H 4114H 4115H 4116H 4119H 411CH 411DH 4120H 4121H 4124H XCHG LXI H. 0000H LXI B. 0000H DAD SP JNC L1 INX B DCX D MOV A.C STA 4506H MOV A.B STA 4507H HLT L2: L1: RESULT: Thus the Assembly Language Program for 16 bit multiplication had been written and executed & the results were stored in desired memory location.

OBSERVATION: ADDRESS INPUT DATA COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. .

Experiment No: DIVISION OF TWO 16 BIT NUMBERS AIM: Date: To write an Assembly Language Program to divide two 16 bit numbers & store the quotient & remainder APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. ALGORITHM: Step 1: Get the first data in DE pair Step 2: Get the second data in HL pair Step 3: Subtract the lower order byte of the 1st & 2nd number Step 4: Subtract the higher order byte of the 1st & 2nd number Step 5: Store the result in . (ii) Power cable. Step6: Stop the process . in memory locations 4204H and 4205H.

Divisor NO Count = Count-1 NO Is count = 0? YES Store the quotient & remainder Stop . Count=8.FLOWCHART: Start Dividend (2200H) & (2201H) . Quotient = Quotient*2 YES Is divisor <= dividend ? Dividend = Dividend. Quotient =0 Dividend = Dividend*2. Divisor(2300H).

. E 410DH 410EH 410FH 4110H 4111H 4114H RLC MOV E.PROGRAM: LABEL START: ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100H 4102H 4105H 4108H 4109H MVI E.H SUB B JC SKIP MOV H.A MOV A.A Quotient = Quotient x 2 Is most significant byte of Dividend > divisor No. 00H LHLD 4200H LDA 4204H MOV B. E 411BH 411EH 411FH 4122H STA 4301H MOV A. 08 Initialise Quotient = 0 Get dividend Get divisor Store divisor Initialise Count = 8 NEXT: 410BH DAD H Dividend = Dividend x 2 410CH MOV A.H STA 4303H HLT Store Quotient Store Remainder Stop the process RESULT: Thus the Assembly Language Program for 16 bit division had been written and executed & the results were stored in desired memory location. A MVI C. go to Next step Subtract divisor 4115H INR E Quotient = Quotient + 1 SKIP: 4116H 4117H DCR C JNZ NEXT Count = Count .1 If count =0 repeat 411AH MOV A.

4. 5. What is synchronous data transfer scheme? What is asynchronous data transfer scheme? What are the operating modes of 8212? Explain the working of a handshake output port What are the internal devices of 8255 ? .OBSERVATION: ADDRESS INPUT DATA COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 3. 2.

else goto step5 Step 5: Increment C-reg content by two Step6: Increment E-reg content by one & return to label Step7: Move E. goto step7.Experiment No: Date: SQUARE ROOT OF 8 BIT NUMBER AIM: To write an Assembly Language Program to find square root of a 8 bit number using 8085 APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. ALGORITHM: Step 1: Move 01H to both C-reg & E-reg Step 2: Load the accumulator with the content of 4200H Step 3: Subtract accumulator content & C-reg content Step 4: If accumulator content is zero.reg content to accumulator Step8: Store the accumulator value in 4201H Step9: Stop the process . (ii) Power cable.

reg content to accumulator Store accumulator value in 4201H Stop . Load the accumulator with the content of 4200H : Subtract accumulator content & C-reg content Is Accumulator content zero? YES NO Increment C-reg content by two Increment E-reg content by one & return to label Move E.FLOWCHART: Start Move 01H to both C-reg & E-reg.

E STA 4201H HLT LABEL: Move 01 to C.01 LDA 4200H SUB C JZ LABEL1 INR C INR C INR E JMP LABEL MOV A. goto label1 Increment C-reg content by two Increment E-reg content by one Return to label Move E.PROGRAM: LABEL START: ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100H 4102H 4104H 4107H 4108H 410BH 410CH 410DH 410EH 4111H 4112H 4115H MVI C. .01 MVI E.reg content to accumulator Store the accumulator value in 4201 Stop the process LABEL1: RESULT: Thus the Assembly Language Program for square root of a 8 bit number had been written and executed & the results were stored in desired memory location.reg Move 01 to E.reg Load the accumulator with the content of 4200 Subtract accumulator content & C-reg content If accumulator content is zero.

2. What are the tasks involved in keyboard interface? 1.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS What is baud rate? What is USART? What are the control words of 8251A and what are its functions ? Give some examples of input devices to microprocessor-based system 5. 3. . 4.

ALGORITHM Step 1: Initialize memory pointer with 4300H Step 2 Get the MSB & multiply it by 10 using repeated addition Step 3: Add the LSB to the obtained result Step4: Store the hexadecimal value in 4201H Step5: Stop the process .Experiment No: BCD TO HEX CONVERSION AIM: Date: To write an Assembly Language Program to convert a BCD number to a hexadecimal number using 8085 APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. (ii) Power cable.

FLOWCHART Start Initialize memory pointer with 4300H Get the MSB & multiply it by 10 using repeated addition Add the LSB to the obtained result Store the hexadecimal result in the memory location Stop .

PROGRAM: LABEL START: ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100H 4103H 4104H 4105H 4106H 4107H 4108H 4109H 410AH 410BH 410CH 410DH LXI H.4300H MOV A. .A ADD A ADD A ADD B INX H ADD M INX H MOV M.M ADD A MOV B. had been written and executed & the results were stored in desired memory location.A HLT Initialize memory pointer MSD *2 Store MSB *2 MSB *4 MSB *8 MSB *10 Point to LSB Add to form hex Store the result Stop the process RESULT: Thus the Assembly Language Program to convert BCD number to hexadecimal.

5. 4. 2. How a keyboard matrix is formed in keyboard interface using 8279? What is scanning in keyboard and what is scan time? What are the internal devices of a typical DAC? What is settling or conversion time in DAC? What are the different types of ADC? . 3.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1.

ALGORITHM Step 1: Initialize memory pointer with 4300H Step 2 Get the hexadecimal number in C-reg Step 3: Perform repeated addition for C number of times Step4: Adjust for BCD in each step Step5: Store the BCD number in the memory location Step6: Stop the process . (ii) Power cable.Experiment No: Date: HEX TO BCD CONVERSION AIM: To write an Assembly Language Program to convert a hexadecimal number to BCD using 8085 APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard.

FLOWCHART Start Initialize memory pointer with 4300H Get the hexadecimal number in C-reg Adjust for BCD in each step & Perform repeated addition for C number of times Store the BCD number in the memory location Stop .

M ADD A MOV B.4300H MOV A. OBSERVATION: .PROGRAM: LABEL START: ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100H 4103H 4104H 4105H 4106H 4107H 4108H 4109H 410AH 410BH 410CH 410DH LXI H.A ADD A ADD A ADD B INX H ADD M INX H MOV M. had been written and executed & the results were stored in desired memory location.A HLT Initialize memory pointer MSD *2 Store MSB *2 MSB *4 MSB *8 MSB *10 Point to LSB Add to form hex Store the result Stop the process RESULT: Thus the Assembly Language Program to convert hexadecimal number to BCD.

Define stack What is program counter? How is it useful in program execution? How the microprocessor is synchronized with peripherals? What is a minimum system and how it is formed in 8085? Define bit. 5.ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. 4. 2. . 3. byte and word.

Experiment No: FACTORIAL OF A GIVEN NUMBER Date: AIM: To write an Assembly Language Program to find factorial of a given hexadecimal number APPARATUS REQUIRED: (i) 8085 Microprocessor kit with keyboard. Clear accumulator contents Step5: Add the contents of accumulator & D-reg. ALGORITHM Step 1: Initialize memory pointer with 4200H Step2: Get the multiplicand in E-reg & move it to the next memory location. (ii) Power cable. goto step7. else goto step3 Step10: Stop the process . Decrement E-reg by 1 Step3: Move the multiplicand to accumulator Step 4: Get the multiplier in B reg& move to the multiplicand to D-reg. else goto step5 Step7: Move accumulator contents to memory Step8: Decrement E reg & move E-reg contents to C-reg & : Decrement C reg Step9: If C-reg content is zero goto step10. Step6: Decrement B-reg by 1& if B-reg content is zero.

reg =0 ? YES Stop NO . Is C. . Move to the multiplicand D-reg& clear accumulator contents Add the contents of accumulator & D-reg. Decrement B-reg by one NO Is B-reg Content zero? YES Move accumulator toMemory Decrement E reg & move E-reg contents To C-reg Decrement C-reg .FLOWCHART Start Initialise the HL pair with the address 4200H Get the multiplicand in E-reg & move it to the next memory location. Decrement E-reg by 1 Move the multiplicand to accumulator. Get the multiplier in Breg.

M MOV B.reg content is zero Stop the process LOOP2: 430BH 430CH 430DH 4310H 4311H 4312H ADD D DCR B JNZ LOOP2 MOV M.A XRA A LOOP1: Initialize memory pointer with 4200H Get the multiplicand in E-reg & move it to the next memory location.A DCR E MOV C. Decrement E-reg by 1 Move the multiplicand to accumulator Get the multiplier in B reg& move to the multiplicand to D-reg Clear accumulator contents Add the contents of accumulator & D-reg.PROGRAM: LABEL START: ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4300H 4303H 4304H 4305H 4306H 4307H 4308H 4309H 430AH LXI H.reg content is zero Move accumulator contents to memory Decrement E-reg by 1 move E-reg contents to Creg Decrement C reg by 1 Check whether C.E 4313H 4314H 4317H DCR C JNZ LOOP1 HLT RESULT: Thus the Assembly Language Program to convert to find factorial of a given hexadecimal number had been written and executed & the results were stored in desired memory location.E DCR E MOV A.M INX H MOV M.4200H MOV E. . Decrement B-reg by 1 Check whether B.E MOV D.

What is the need for interrupt controller? 4. What is PSW? 2.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. What is the purpose of ALE? 3. Give some examples of input devices to microprocessor-based system 5 Give some examples of port devices used in 8085 microprocessor based system? .

Experiment No: Date: 8086-ADDITION OF TWO 16-BIT NUMBERS AIM: To write an assembly language program to add two 16 bit numbers and store the sum in the memory location 1200H and carry in 1202H. Step 9: Stop the Process . ALGORITHM: Step 1: Initialize the BL reg. Jump to step 7 if no carry occurs. with 00H to account for carry. Step 7: Move the sum to 1200H. Step 6: Increment BL reg. Step 8: Move the carry to 1202H. APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard. Otherwise go to next step. Step 3: Move next data to CX reg. Step 2: Move one of the data to AX reg. (ii) Power Cable. content with the AX reg. Step 5: ADD the CX reg. Step 4: Clear Carry Flag.

FLOWCHART: Start Initialize BL reg. Clear Carry Flag Add CX and AX reg. with 00H Move Data into AX and CX reg. Is Carry Set? ` YES NO Increment BL reg Store Sum and Carry to Memory Stop .

Move the AX content (sum)to 1200H & 1201H. to account for carry.001FH CLC ADD AX. If no carry occurs. Move the data 001FH to CX reg. Move the BL content to 1202H.PROGRAM: LABEL START ADDRESS 1000H 1003H 1007H 100BH 100CH 100EH MNEMONICS MOV BL. RESULT: Thus the Assembly Language Program for Addition of two 16-bit numbers had been written and executed & the results were stored in desired memory locations.FFFFH MOV CX.AX MOV[1202H]. jump to LOOP.00H MOV AX. Stop the Process. . Move the data FFFFH to AX reg. CX JNC LOOP INC BL MOV[1200H].BL HLT OPCODE OPERAND LOOP 1010H 1012H 1016H 101AH COMMENTS Move 00H to BL reg. Add the content of CX to AX. Clear Carry Flag. Increment BL reg.

3.OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. Write the flags of 8086 . What is the name given to the register combination DX:AX? What are the modes in which 8086 can operate? What is the data and address size in 8086? Explain the function of M/IO in 8086. 4. 5. 2.

content from the AX reg. Step 6: Increment BL reg. Step 2: Move Minuend to AX reg. Jump to step 7 if no carry occurs. Step 9: Stop the Process . Step 7: Move the difference to 1200H. Step 3: Move Subtrahend to CX reg. (ii) Power Cable. Otherwise go to next step. APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard. Step 5: Subtract the CX reg. Step 8: Move the borrow to 1202H. Step 4: Clear Carry Flag. ALGORITHM: Step 1: Initialize the BL reg with 00H to account for borrow.Experiment No: Date: 8086-SUBTRACTION OF TWO 16-BIT NUMBERS AIM: To write an assembly language program to Subtract two 16 bit numbers and store the difference in the memory location 1200H and borrow in 1202H.

NO Is Carry Set? YES Increment BL reg Store Difference and Borrow in memory Stop . Clear Carry Flag Subtract CX from AX reg. with 00H Move Data into AX and CX reg.FLOWCHART: Start Initialize BL reg.

jump to LOOP. CX JNC LOOP INC BL MOV[1200H].FFFFH MOV CX. Move the BL content to 1202H. to account for carry. Move the data FFFFH to AX reg. Subtract the content of CX from AX. .AX MOV[1202H]. If no carry occurs.BL HLT OPCODE OPERAND LOOP 1010H 1012H 1016H 101AH COMMENTS Move 00H to BL reg. Move the data 001FH to CX reg. Clear Carry Flag.PROGRAM: LABEL START ADDRESS 1000H 1003H 1007H 100BH 100CH 100EH MNEMONICS MOV BL. Increment BL reg. Stop the Process.OO1FH CLC SUB AX. RESULT: Thus the Assembly Language Program for Subtraction of two 16-bit numbers had been written and executed & the results were stored in desired memory locations.00H MOV AX. Move the AX content (difference) to 1200H.

OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS What are the interrupts of 8086? How clock signal is generated in 8086? What is the maximum internal clock frequency of 8086? Write the special functions carried by the general purpose registers of 8086 5. 3. . 4. What is pipelined architecture? 1. 2.

with 00H to account for carry. Step 5: Multiply the CX reg. ALGORITHM: Step 1: Initialize the BL reg. Otherwise go to next step. APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard.Experiment No: Date: 8086-MULTIPLICATION OF TWO 16-BIT NUMBERS AIM: To write an assembly language program for Multiplication of two 16 bit numbers using 8086 instruction set. with the AX reg. Step 3: Move Multiplier to CX reg. Step 2: Move Multiplicand to AX reg. (ii) Power Cable. Step 4: Clear Carry Flag. Step 9: Stop the Process . Step 7: Move the content of AX & BL to the specified memory locations. Step 6: Increment BL reg. Jump to step 7 if no carry occurs.

with 00H Move Data into AX and CX reg. content Is Carry Set? YES NO Increment BL reg Store the result in memory location Stop . Clear Carry Flag Multiply CX and AX reg.FLOWCHART: Start Initialize BL reg.

Stop the Process. Move the data 11A2H to AX reg. Move the BL content to 1204H. Multiply the content of CX to AX reg.11A2H MOV CX.AX MOV[1202]. Move the data 11B3H to CX reg. to account for carry.PROGRAM: LABEL START ADDRESS 1000H 1003H 1007H 100BH 100DH MNEMONICS MOV BL. RESULT: Thus the Assembly Language Program for Multiplication of two 16-bit numbers had been written and executed & the results were stored in desired memory locations OBSERVATION: . jump to LOOP. Move the DX content to 1202H & 1203H. Increment BL reg.11B3H MUL CX JNC LOOP INC BL MOV[1200H].BL HLT OPCODE OPERAND LOOP 100FH 1011H 1015H 1019H 101DH COMMENTS Move 00H to BL reg.DX MOV[1204H].00H MOV AX. Move the AX content to 1200H & 1201H. If no carry occurs.

List the segment registers of 8086 2. and Place the result in CL? 4. LDS. and LES instruction 3. What instructions are needed to add AL. What is purpose served by CX register? 5. Which are pointers present in this 8086? . 3L and DL together.ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. Illustrate the use of LEA.

(ii) Power Cable. APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard. and higher order byte of dividend to DX reg. Step 4: Move the content of AX & DX in the specified memory locations. Step 3: Divide the content of AX&DX by CX reg. ALGORITHM: Step 1: Move the lower order byte of dividend to AX reg.Experiment No: Date: 8086-DIVISION OF 32 BIT NUMBER BY 16-BIT NUMBER AIM: To write an assembly language program for Division of 32 bit number by 16 bit number using 8086 microprocessor kit. Step 2: Move Divisor to CX reg. . Step 5: Stop the Process.

FLOWCHART: Start Move the Dividend into AX and DX reg Move the Divisor Value to CX reg Divide DX & AX by CX contents Store the Quotient value in desired memory Store the remainder in desired memory Stop .

01A1H DIV CX MOV[1200H]. Move the DX content to 1202H.AX MOV[1202H]. Stop the Process 1000H 1004H 1008H 100CH 100EH 1012H 1016H RESULT: Thus the Assembly Language Program for the Division of 32 –bit number by 16-bit number had been written and executed & the results were stored in desired memory location .FFFFH MOV DX.DX HLT OPCODE OPERAND COMMENTS Move the data FFFFH to AX reg Move the data 0012H to DX reg Move the Divisor 01A1 to CX reg Divide the content of AX&DX BY CX Move the AX content to 1200H. 0012H MOV CX.PROGRAM: LABEL START ADDRESS MNEMONICS MOV AX.

. 3. 2. 4. 5. How is register AL is used during execution of XLAT? What is the use of PUSH and POP instruction? What is the purpose of XCHG instruction? What do square brackets means when they appear in an operand? Write a routine to swap nibbles in AL.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1.

Add SI with 04 Step 4: Move SI to AL Step 5: Decrement SI & Increment DI.Experiment No: Date: 8086 -REVERSAL OF A STRING AIM: To write an assembly language program to reverse a given string using 8086 microprocessor kit APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard. ALGORITHM: Step 1: AX is initialized with data & AX is moved into DS Step 2: Initialize CX to 5 Step 3: Load the effective address in SI & DI. . (ii) Power Cable. Repeat this until an interrupt is raised Step 6: Stop the Process. .

Add SI with 04 SI is moved to AL Decrement SI & Increment DI Repeat this until an interrupt is raised Stop .FLOWCHART: Start AX is initialized with data & AX is moved into DS CX is initialized to 5 Load the effective address in SI & DI.

@ DATA MOV DS. AX MOV CX.[SI] MOV [DI].AL DEC SI INC DI LOOP AGAIN INT 3 END Interrupt Stop the Process RESULT: Thus the Assembly Language Program for string reversal has been written and executed & the results were stored in desired memory location . A1 LEA DI. 0005H LEA SI. 0004 OPCODE OPERAND COMMENTS AX is initialized with data AX is moved into DS CX is initialized to 5 Load the effective address in SI & DI Add SI content with 04 SI is moved to AL AL is moved into DI Decrement SI Increment DI AGAIN: MOV AL.PROGRAM: LABEL START: ADDRESS MNEMONICS MOV AX . A2 ADD SI.

4. What is stack and Subroutine? Difference between Microprocessor & Microcontroller What is the maximum memory addressing and I/O addresing capabilities of 8086? . Mention the features of 8086? Explain how physical address is formed in 8086.OBSERVATION: ADDRESS DATA INPUT OUTPUT COMMENTS VIVA VOCE QUESTIONS 1. 5. 2. 3.

. Repeat this until an interrupt is raised Step 6: Stop the Process.8086 –ADDITION OF TWO 32 BIT NUMBERS AIM: To write an assembly language program to add two 32 bit numbers using 8086 APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard. (ii) Power Cable. . ALGORITHM: Step 1: AX is initialized with data & AX is moved into DS Step 2: Initialize CX to 5 Step 3: Load the effective address in SI & DI. Add SI with 04 Step 4: Move SI to AL Step 5: Decrement SI & Increment DI.

FLOWCHART: Start AX is initialized with data & AX is moved to DS Data2 is moved to BX & added with Data4 Data3 is moved toCX &added with carry with data4 Data 4C is moved to AH & AL content is moved to DI Interrupt is raised Stop .

Data1 ADC CX. Data4 MOV CX.PROGRAM: LABEL START: ADDRESS MNEMONICS MOV AX . AX OPCODE OPERAND COMMENTS AX is initialized with data AX is moved into DS Move data2 to BX Data4 is added with BX content Move data1 to CX Data3 is added with CX content Data 4C is moved to AH AL content is moved to DI Interrupt Stop the Process MOV BX.AL INT 21H END RESULT: Thus the Assembly Language Program for 32 –bit addition has been written and executed & the results were stored in desired memory location .@ DATA MOV DS.4CH MOV [DI]. Data2 ADD BX. Data3 MOV AH.

5. 3. What do square brackets means when they appear in an operand? What is the difference between MOV AX. 2.MODEL SMALL: DATA: Data1 Data2 Data3 Data4 DW DW DW DW VIVA VOCE QUESTIONS 1. Which are pointers present in this 8086? What is meant by Maskable interrupts? . 4. AX? Write a routine to swap nibbles in AL. 0 and SUB AX.

number of repetitions (length of array . Step 3: Move the data from memory location pointed to the Accumulator. number of comparisons (length of array -1) in C register. If carry flag is set (accumulator content is smaller than the other number).1) in B register. Step 7: Store the smallest number to the previous memory location & greatest to the current memory location. (ii) Power Cable. ALGORITHM: Step 1: Get the count 1. Step5: Check CF. . If zero flag is set (accumulator content is equal to the other number). . decrement comparison count. Step 2: Get the count 2. Step 4: Compare the data from next memory location with the content of Accumulator. Step 8: Stop the Process. otherwise do next step. decrement the repitition count Step 6: Check ZF. APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard.Experiment No: Date: 8086-ASCENDING ORDER AIM: To write an assembly language program to arrange the given data in ascending Order using 8086 microprocessor kit.

FLOWCHART: Start Initialize memory pointer to get N. the length of series Initialize COUNT 1 for (N-1) repetitions Initialize COUNT 2 for (N-1) Comparisons Increment memory pointer and get the number from series IS pointer < (pointer+1)? YES NO Interchange Numbers Decrement COUNT 2 NO Is COUNT 2 = Zero? YES Decrement COUNT 1 NO Is COUNT 1 = zero? YES Stop .

AL L3: INC BX LOOP L2 MOV DL. A[BX] CMP AL.05H DEC CL MOV BX. goto L1 Stop the process L1: L2: MOV A[BX].00H MOV AL.CL DEC DL LOOP L1 END RESULT: Thus the Assembly Language Program to arrange the given data in ascending Order had been written and executed & the results were stored in desired memory location .DATA SEGMENT: A DB 5 DUP(0) DATA ENDS CODE SEGMENT: ASSUME CS: CODE. A[BX+1] OPCODE OPERAND COMMENTS Move 05 to CL Move 05 to DL Decrement CL register Move 00H to BX Move the 1st data to AL Compare the 1st & 2nd data If 1st data is lesser than 2nd.05H MOV DL. DS: DATA PROGRAM: LABEL START: ADDRESS MNEMONICS MOV CL. goto L3 If 1st data is greater than 2nd. exchange the data Move AL content to BX Increment BX by 1 Goto L2 Move CL content to DL Decrement DL content If the count is not zero. A[BX+1] JB L3 XCHG AL.

OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 5. 3. 2. From which address the 8086 starts execution after reset? What are the modes in which 8086 can operate? What is the data and address size in 8086? What is purpose served by CX register? Which are pointers present in this 8086 . 4.

If zero flag is set (accumulator content is equal to the other number). Step 3: Move the data from memory location pointed to the Accumulator. decrement the repitition count Step 6: Check ZF. Step 4: Compare the data from next memory location with the content of Accumulator. otherwise do next step.1) in B register. If carry flag is set (accumulator content is smaller than the other number). Step 8: Stop the Process. . number of repetitions (length of array . number of comparisons (length of array -1) in C register. Step 7: Store the smallest number to the previous memory location & greatest to the current memory location.Experiment No: Date: 8086-DESCENDING ORDER AIM: To write an assembly language program to arrange the given data in descending Order using 8086 microprocessor kit. . Step 2: Get the count 2. Step5: Check CF. ALGORITHM: Step 1: Get the count 1. APPARATUS REQUIRED: (i) 8086 Microprocessor kit with keyboard. (ii) Power Cable. decrement comparison count.

the length of series Initialize COUNT 1 for (N-1) repetitions Initialize COUNT 2 for (N-1) Comparisons Increment memory pointer and get the number from series IS pointer < (pointer+1)? YES NO Interchange Numbers Decrement COUNT 2 NO Is COUNT 2 = Zero? YES Decrement COUNT 1 NO Is COUNT 1 = zero? YES Stop .FLOWCHART: Start Initialize memory pointer to get N.

A[BX] CMP AL.CL DEC DL LOOP L1 END RESULT: Thus the Assembly Language Program to arrange the given data in desscending Order had been written and executed & the results were stored in desired memory location . A[BX+1] JA L3 XCHG AL. AL L3: INC BX LOOP L2 MOV DL.00H MOV AL. exchange the data Move AL content to BX Increment BX by 1 Goto L2 Move CL content to DL Decrement DL content If the count is not zero. goto L1 Stop the process L1: L2: MOV A[BX]. A[BX+1] OPCODE OPERAND COMMENTS Move 05 to CL Move 05 to DL Decrement CL register Move 00H to BX Move the 1st data to AL Compare the 1st & 2nd data If 1st data is lesser than 2nd.DATA SEGMENT: A DB 5 DUP(0) DATA ENDS CODE SEGMENT: ASSUME CS: CODE. DS: DATA PROGRAM: LABEL START: ADDRESS MNEMONICS MOV CL.05H DEC CL MOV BX. goto L3 If 1st data is greater than 2nd.05H MOV DL.

SS=2000h. What conditional jump instruction should be used after CMP AL. What is the difference between JUMP and LOOP instructions? 4.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. Determine the memory address accessed by each of the following instruction. MOV AL. 30H to jump when AL equals 30H? . What is the instruction needed to count the number of 1’s found in AL? 5. BP=1000h and DI=0100h. [BP + DI] 2. Form a jump instruction that jumps to the address pointed by the BX register? 3. Suppose that DS=1000h.

If no carry occur. Step 3: Add the second data with the first data. Step 7: Store the sum (content of accumulator)to the address pointed by the data pointer. Step 8: Make the data pointer to point the next address by increment the DPTR. Step 9: Store the carry to that address. ALGORITHM: Step 1: Clear register Ro Step 2: Get the data in accumulator.Experiment No: Date: 8051-ADDITION OF TWO 8-BIT NUMBERS AIM: To perform the addition of two 8 bit numbers using immediate addressing and store the result in memory. Step 6: Increment the register Ro. Step 10: Stop the process. go to step 7. APPARATUS REQUIRED: (i) 8051 Microprocessor. . Step 5: Check the carry flag. (ii) Power Cable. otherwise do next step. Step 4: Make the data pointer to point the address 4500H.

FLOWCHART: Start Get first data in accumulator & clear Ro reg Make DP to point 4500H ADD second data with accumulator Is Carry Set YES Increment Ro reg NO Store Sum and Carry in memory using DP Stop .

#4500H JNC LOOP INC Ro MOV X@DPTR.#data2 OPCODE OPERAND COMMENTS 4106H 4109H 410BH LOOP MOV DPTR. Ro 410FH MOV @ DPTR.#data1 ADD A.PROGRAM: LABEL START ADDRESS 4100H 4102H 4104H MNEMONICS MOV Ro. . Move the address 4500H to DPTR. If no carry occurs go to address 410C.A 410CH 410DH 410EH INC DPTR MOV A. Increment the DPTR. A 4110H NOP Move the data 00H to reg Ro.#00H MOV A. Move the first data in accumulator Add the second data with the accumulator. Move the data from accumulator to the address pointed by DPTR Increment the DPTR Move the content from reg Ro to the accumulator. Move the data from accumulator to the address denoted by DPTR No operation. RESULT: Thus the addition of two 8-bit data using immediate addressing is performed and executed.

OBSERVATION:

ADDRESS INPUT OUTPUT

DATA

COMMENTS

VIVA VOCE QUESTIONS

1. What is called microcontroller? 2. What is the difference between microprocessor and microcontroller? 3. How many flags are there in 8051 4. How many addressing modes are in 8051 5. What is called Datapointer?

Experiment No:

Date:

8051-SUBTRACTION OF TWO 8-BIT NUMBERS

AIM: To perform the subtraction of two 8 bit numbers using immediate addressing and store the result in memory.

APPARATUS REQUIRED: (i) 8051 Microprocessor. (ii) Power Cable. ALGORITHM: Step 1: Clear register Ro Step 2: Get the data in accumulator. Step 3: Subtract the second data with the first data. Step 4: Make the data pointer to point the address 4500H. Step 5: Check the carry flag. If no carry occur, go to step 7, otherwise do next step. Step 6: Increment the register Ro. Step 7: Store the difference (content of accumulator)to the address pointed by the data pointer. Step 8: Make the data pointer to point the next address by increment the DPTR. Step 9: Store the borrow to that address. Step 10: Stop the process.

FLOWCHART:

Start

Get first data in accumulator & clear Ro reg

Make DP to point 4500H

Subtract second data with accumulator

Is Borrow Obtained YES Increment Ro reg

NO

Store Difference and Borrow in memory using DP

Stop

Increment the DPTR. Ro 430FH MOV @ DPTR.PROGRAM: LABEL START ADDRESS 4300H 4302H 4304H MNEMONICS MOV Ro. Move the data from accumulator to the address denoted by DPTR No operation.#00H MOV A. Move the address 4500H to DPTR. #4500H JNC LOOP INC Ro MOV X@DPTR. A 4310H NOP Move the data 00H to reg Ro.#data2 OPCODE OPERAND COMMENTS 4306H 4309H 430BH LOOP MOV DPTR. Move the data from accumulator to the address pointed by DPTR Increment the DPTR Move the content from reg Ro to the accumulator.A 430CH 430DH 430EH INC DPTR MOV A. If no carry occurs go to address 410C. .#data1 SUB A. Move the first data in accumulator Subtract the second data with the accumulator. RESULT: Thus the subtraction of two 8-bit data using immediate addressing is performed and executed.

OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1 . What is called Indirect addressing mode? 4. What is called Immediate addressing mode? 3. How many flags are affected in SUB instructions 5. How many registers are in 8051 2. How many bytes is used for the instruction MOV DPTR. #4500H instruction .

ALGORITHM: Step 1: Get the first data in accumulator. Step 3: Multiply two 8-bit data. Step 2: Get the second data in reg B.Experiment No: Date: 8051-MULTIPICATION OF TWO 8-BIT NUMBERS AIM: To write an 8051 assembly language program to multiply two 8-bit numbers and store the result in memory. (ii) Power Cable. . Step 5: Store the LSB of the result from the accumulator to the address pointed by DPTR. APPARATUS REQUIRED: (i) 8051 Microprocessor. Step 6: Increment the data pointer. Step 8: Stop the process. Step 7: Store the MSB of the result in the address pointed by DPTR. Step 4: Get the data pointer to point the address 4500H.

FLOWCHART: Start

Clear carry flag

Get multiplicand in accumulator

Get multiplier in B reg

Multiply accumulator with B

Store the result in memory

Stop

PROGRAM:

LABEL START

ADDRESS

4300H 4302H 4305H 4306H 4309H

MNEMONICS MOV A,#data1 MOV F0,#data2 MUL B MOV DPTR, #4500H MOV X@DPTR,A

OPCODE

OPERAND

COMMENTS

430AH 430BH

INC DPTR MOV A,B

430DH

MOV X@DPTR,A

430EH

NOP

Move the data 1 to accumulator. Move the data 2 the reg B. Multiply A & B. Move the address 4500H to DPTR. Move the data from accumulator to the address pointed by DPTR Increment the DPTR. Move the content of B reg to the accumulator. Move the data from accumulator to the address denoted by DPTR. No operation.

RESULT: Thus the Assembly Language Program for the multiplication of two 8-bit data has been written and executed & the results are stored in desired memory location.

OBSERVATION:

ADDRESS INPUT OUTPUT

DATA

COMMENTS

VIVA VOCE QUESTIONS

1. What is F0 in this instruction MOV F0,#data? 2. What is called Stack pointer? 3. Define Flag register 4. What is the use of this instruction MOVX@ DPTR, A? 5. What type of addressing mode is used for the instruction MUL AB?

(ii) Power Cable. Step 2: Get the second data in reg B. Step 3: Divide two 8-bit data.Experiment No: Date: 8051-DIVISION OF TWO 8-BIT NUMBERS AIM: To write an 8051 assembly language program to divide two 8-bit numbers and store the result in memory. Step 8: Stop the process. Step 5: Store the Quotient of the result from the accumulator to the address pointed by DPTR. APPARATUS REQUIRED: (i) 8051 Microprocessor. ALGORITHM: Step 1: Get the first data in accumulator. Step 7: Store the remainder of the result in the address pointed by DPTR. Step 6: Increment the data pointer. Step 4: Get the data pointer to point the address 4500H. .

FLOWCHART: Start Clear carry flag Get dividend in accumulator Get divisor in B reg Divide accumulator with B Store the result in memory Stop .

Move the data 2 the reg B. Move the data from accumulator to the address denoted by DPTR. #4500H MOV X@DPTR.A OPCODE OPERAND COMMENTS 430AH 430BH INC DPTR MOV A.#data1 MOV F0. Move the data from accumulator to the address pointed by DPTR Increment the DPTR. Move the address 4500H to DPTR.B 430DH MOV X@DPTR.PROGRAM: LABEL START ADDRESS 4300H 4302H 4305H 4306H 4309H MNEMONICS MOV A. Move the content of B reg to the accumulator.#data2 DIV B MOV DPTR.A 430EH NOP Move the data 1 to accumulator. No operation. RESULT: Thus the Assembly Language Program for the division of two 8-bit data has been written and executed & the results are stored in desired memory location . Divide A by B.

What is called Fetch Cycle? 3. What is called Implied addressing mode? 5. What is the use of POP instruction? .OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS VIVA VOCE QUESTIONS 1. What is called Direct addressing mode? 4. The mnemonics used in writing a program is called _______________________ 2.

ALGORITHM: Step 1: Clear register Ro Step 2: Make the datapointer to point the address 4500 and move first data LB to R1 register. Step 10: Store the carry to that address. Step 8: Store the sum (content of accumulator)to the address pointed by the data pointer. Step 4: Increment the datapointer and add the LB of 1st data with LB of 2nd data and store in R1 register. . go to step8 . If no carry occur. Step 5: Increment the datapointer and add with carry HB of 2nd data with HB of 1st data. Step 3: Increment the datapointer and move the firtdata HB to R2 register. (ii) Power Cable. Step 11: Stop the process. Step 7: Increment the register Ro. Step 9: Make the data pointer to point the next address by increment the DPTR. APPARATUS REQUIRED: (i) 8051 Microprocessor.Experiment No: Date: 8051-ADDITION OF TWO 16-BIT NUMBERS AIM: To perform the addition of two 16 bit numbers using immediate addressing and store the result in memory. Step 6 :Check the carry flag. otherwise do next step.

FLOWCHART: Start Clear R0 reg. Make DP to point 4500H Move 1st data LB to R1 reg .Increment DPTR move 1st data HB to R2 reg.Increment DPTR Add LB of 1st and 2nd data Increment DPTR ADD with carry HB of2nd data with 1st Is Carry Set YES Increment Ro reg NO Store Sum and Carry in memory using DP Stop .

RI 410D MOV R1.A 4107 4108 INC DPTR MOV X A.PROGRAM: LABEL START ADDRESS 4100H 4102 4105 MNEMONICS MOV Ro.A .A 410E 410F INC DPTR MOV X A.@DPTR OPCODE OPERAND COMMENTS 4106 MOV R1.R2 4111 MOV R2. #4500H MOV X A. Move the address 4500H to DPTR Move the data from address pointed by DPTR to the accumulator Move the content of LB of 1st data from accumulator to reg R1 Increment Data pointer Move the data from address pointed by DPTR to the accumulator Move the content of LB of 1st data from accumulator to reg R2 Increment Data pointer Move the data from address pointed by DPTR to the accumulator Add the content of LB of 2nd data from reg R1with accumulator Move the content of accumulator to reg R1 Increment Data pointer Move the data from address pointed by DPTR to the accumulator Add with carry the content of HB of 2nd data from reg R2 with accumulator Move the content of 4110 ADDC A.@DPTR 410C ADD A.@DPTR Move the data 00H to reg Ro.#00H MOV DPTR.@DPTR 4109 MOV R2.A 410A 410B INC DPTR MOV X A.

A 4118 MOV A. Move the data from accumulator to the address pointed by DPTR Move the content of reg R2 to accumulator Increment the DPTR Move the data from accumulator to the address pointed by DPTR Move the content of reg R0 to accumulator Increment the DPTR Move the data from accumulator to the address pointed by DPTR No operation.4112 4114 4115 JNC LOOP INC Ro MOV A. A 411E NOP accumulator to the reg R2. A 411B MOV A.R2 4119 411A INC DPTR MOVX @ DPTR. .Increment the DPTR. If no carry occurs go to address 4115 Increment reg R0 Move the content of reg R1 to accumulator .R1 LOOP 4116 4117 INC DPTR MOV X@DPTR. RESULT: Thus the addition of two 8-bit data using immediate addressing is performed and executed.R0 411C 411D INC DPTR MOVX @ DPTR.

OBSERVATION: ADDRESS INPUT OUTPUT DATA COMMENTS

VIVA VOCE QUESTIONS

1. 2. 3. 4. 5.

What is the use of POP instruction? What is called Vector Location? Define Interrupt? What is the length of Stack pointer? What is the length of Instruction Register?

Experiment No:

Date:

TRANSFERING A BLOCK OF DATA FROM INTERNAL TO EXTERNAL MEMORY

AIM: To write an Assembly Language Program to transfer the block of data starting from Internal memory location 31 to the memory location 4401H. The total number of data is stored at 4400H. APPARATUS REQUIRED: (i) 8051 Microprocessor. (ii) Power Cable. ALGORITHM: Step 1: Make the data pointer to point the address 4400H. Step 2: Move the total number of data to the R0 register. Step 3: Move the internal RAM Memory location 31 to the register R1. Step 4: Increment the destination block pointer. Step 5: Move the indirect Ram to the accumulator. Step 6: Store the first data to the destination address. Step 7: Increment the source block pointer. Step 8: Decrement the R0 register. Step 9: If ZF=0, go to step 4.otherwise go to next step. Step 10: Stop the Process.

FLOWCHART: Start

Move DPTR to point to 4400

Load the total number of input data In R0 reg

Move direct byte 31 to R1 reg.

Store data byte to destination block

Increment the source & destination block pointer

Decrement R0 reg

NO If ZF=1 YES Stop

@DPTR OPCODE OPERAND COMMENTS 4204 MOV R0. #4400H MOV X A. . Move immediate data to the reg R1 Increment datapointer Movev indirect RAM to accumulator Move the data from accumulator to the address pointed by DPTR Increment the register R1 Decrement the register R0 If ZF=0.@R1 MOV X @DPTR.#31 INC DPTR MOV A. No operation RESULT: Thus the assembly language program to transfer the block of data from Internal memory location 31 to 4401H has been written and verified.A 4205 LOOP MOV R1.program control jump to label.A 4207 4208 4209 420A 420B 420C INC R1 DEC R0 JNZ LOOP 420E NOP Move the address 4400H to DPTR Move the data from address pointed by DPTR to the accumulator Get count of total number of data bytes in R0 reg.PROGRAM: LABEL START ADDRESS 4200H 4203 MNEMONICS MOV DPTR.

OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 2. 4. 3. 5. What is the length of Memory Address Register? What is the length of Data buffer Register? What is the length of Program Counter? What is the length of Temporary Register? What is the length of Accumulator? .

The total number of data is stored at 4500H. ALGORITHM: Step 1: Make the data pointer to point the address 4500H. Step 9: If ZF=0. Step 2: Move the total number of data to the R0 register. . (ii) Power Cable.Experiment No: Date: TRANSFERING A BLOCK OF DATA FROM EXTERNAL TO EXTERNAL MEMORY AIM: To write an Assembly Language Program to transfer the block of data starting from memory location 4501H to 4800H. Step 3: Move the Higher order byte of source to R1 register Step 4: Move the Higher order byte of destination to R2 register Step 5: Move the content of register R1 to datapointer. Step 8: Decrement the R0 register. Step 10: Stop the Process. go to step 5. Step 6: Increment the destination block pointer. Step 7: Store the first data to the destination address.otherwise go to next step. APPARATUS REQUIRED: (i) 8051 Microprocessor.

FLOWCHART: Start Move DPTR to point 4500 Move 45 to R1 and 48 to R2 reg Move count to R0 and R1 reg content to DPH Store data byte to destination block Increment the source & destination block pointer Decrement R0 reg NO If ZF=1 YES Stop .

program control jump to label.#48H MOV X A. #4500H MOV R1. .PROGRAM: LABEL START ADDRESS 4300H 4303H MNEMONICS MOV DPTR.@DPTR 4308H MOV R0.A 4310 4311 DEC R0 JNZ LOOP 4313 NOP Move the address 4300H to DPTR Move the higher order byte of Data pointer to R1 register. No operation RESULT: Thus the assembly language program to transfer the block of data from memory location 4501H to 4800H has been written and verified. Move the direct data to R2 register.A LOOP 4309H MOV DPH.@DPTR 430D MOV DPH.#45H OPCODE OPERAND COMMENTS 4305H 4307H MOV R2.R2 430F MOV X @DPTR.R1 430B 430C INC DPTR MOV X A. Move the data from address pointed by DPTR to the accumulator Get count of total number of data bytes in R0 reg. Move the content of the reg R1 to higher order byte of thev Datapointer. Increment datapointer Move the data from address pointed by DPTR to the accumulator Move the content of the register R2 to the destination Move the data from accumulator to the address pointed by DPTR Decrement the register R0 If ZF=0.

How many I/O ports can be accessed in Direct Method? How many lines are there in address bus What is called Program Counter? What is called Instruction Register ? What is the direction of databus? . 5. 4.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 3. 2.

Step 3: Move the direct byte 30 to the register R1. Step 2: Move the ASCIIl number to accumulator. Step 7: Stop the Process.Experiment No: Date: ASCII TO ITS EQUIVALENT HEXADECIMAL CONVERSION AIM: To write an Assembly Language Program to convert a ASCII number to Hexadecimal number. (ii) Power Cable. . Step 6: Store the equivalent hexa decimal number to the datapointer. The ASCII data is stored in 4600H and Hexadecimal data is store in 4601H. Step 4: Subtract with borrow the content of the register R1 with the accumulator. APPARATUS REQUIRED: (i) 8051 Microprocessor. Step 5:Increment the Data pointer. ALGORITHM: Step 1: Make the data pointer to point the address 4600H.

FLOWCHART: START Move DPTR to point 4600 Move Hexadecimal num to Acc Mov 30 to R1 reg and Sub with Acc Increment DPTR Move the result to DPTR STOP .

A 4309 NOP Move the address 4600H to DPTR Move the data from address pointed by DPTR to the accumulator Move the direct byte to the register R1 Subtract with borrow the content of register R1 with accumulator Increment datapointer Move the data from accumulator to the address pointed by DPTR No operation RESULT: Thus the assembly language program to convert a ASCII number to equivalent Hexadecimal number has been written and verified.R1 4307 4308 INC DPTR MOV X @DPTR. .@DPTR OPCODE OPERAND COMMENTS 4304 4306 MOV R1.PROGRAM: LABEL START ADDRESS 4300H 4303 MNEMONICS MOV DPTR.#30 SUBB A. #4600H MOV X A.

OBSERVATION: ADDRESS DATA INPUT OUTPUT COMMENTS VIVA VOCE QUESTIONS 1. 3. 4. Which byte of an instruction is loaded into IR register What is the length of Stackpointer? What is the length of Status word? How many interrupts are there in 8051 What is PSW? . 2. 5.

Step 2: Move the content of datapointer to accumulator. Step 7: Stop the Process. Step 6: Store the equivalent ASCII number to the datapointer. ALGORITHM: Step 1: Make the data pointer to point the address 4600H. (ii) Power Cable. APPARATUS REQUIRED: (i) 8051 Microprocessor. Step 4: Add the content of the register R1 with the accumulator. . Step 3: Move the direct byte 30 to the register R1. Step 5:Increment the Data pointer.Experiment No: Date: HEXADECIMAL TO ITS EQUIVALENT ASCII CONVERSION AIM: To write an Assembly Language Program to convert a Hexadecimal number to its equivalent ASCII number The Hexadecimal data is stored in 4600H and ASCII data is stored in 4601H.

FLOWCHART: START Move DPTR to point 4600 Move Hexadecimal num to Acc Mov 30 to R1 reg and add with Acc Increment DPTR Move the result to DPTR STOP .

#30 ADD A.R1 4307H 4308H INC DPTR MOV X @DPTR.A 4309H NOP Move the address 4600H to DPTR Move the data from address pointed by DPTR to the accumulator Move the direct byte to the register R1 Add the content of register R1 with accumulator Increment datapointer Move the data from accumulator to the address pointed by DPTR No operation RESULT: Thus the assembly language program to convert a ASCII number to equivalent Hexadecimal number has been written and verified .@DPTR OPCODE OPERAND COMMENTS 4304H 4306H MOV R1.PROGRAM: LABEL START ADDRESS 4300H 4303H MNEMONICS MOV DPTR. #4600H MOV X A.

5. How many I/o ports can be accessed by direct method How many I/o ports can be accessed by Memory mapped method What is called Vectored Interrupt? What is called Maskable interrupt? When interrupt service request is serviced . 2.OBSERVATION: ADDRESS DATA INPUT OUTPUT COMMENTS VIVA VOCE QUESTIONS 1. 3. 4. .

number of repetitions (i. (ii) Power Cable. Step 15: Decrement the number of repetitions (count 1). If carry flag is not set (accumulator content is smaller than the other number). Step 10: Check ZF. number of comparisons (i. total number of data-1) in A register. Step 5: Move the datapointer to point to 4501H Step 6: Move DPL to R2 Step 7: Move the 1st data to B register and increment DPTR and move the 2nd data to the accumulator. Step 8: Compare the data from next memory location with the content of accumulator. . Step 16: If the number of repetitions is not completed go to step 3.. Step 4: Save the count 2 in R1 register. total number of data-1) in R0 register.Experiment No: Date: 8085-ASCENDING ORDER AIM: To write an Assembly Language Program to arrange the given data in Ascending Order. ALGORITHM: Step 1: Move the datapointer to point to 4500H Step 2: Get the count 1. Step 12: Store the smallest number to the previous memory location & greatest to the current memory location. Step 9: Compare and jump if not equal goto step11 else do next step. If zero flag is set goto step else do next step Step 11: check CF. Step 14: If the number of comparison is not equal to zero. go to step 6. go to step 13 otherwise do next step.e. otherwise do next step. Step 13: Decrement the number of comparisons (count 2).. Step 3: Get the count 2. Step 17: Stop the Process.e. APPARATUS REQUIRED: (i) 8051 Microprocessor. otherwise do the next step.

FLOWCHART 8051-ASCENDING ORDER Start Initialize Datapointer to get N the length of series Initialize COUNT 1 for (N-1) repetitions Initialize COUNT 2 for (N-1) Comparisons Increment memory pointer and get the number from series IS pointer < (pointer+1)? YES NO Interchange Numbers Decrement COUNT 2 NO Is COUNT 2 Zero? YES Decrement COUNT 1 NO Is COUNT 1 zero? YES Store sum as result Stop .

R0 MOV R1.B Interchange numbers if not in order Decrement count2 Decrement count 1 Stop the Process SKIP 411F 4120 4122 4124 MOVX @DPTR.#4500 MOVX A.BACK DJNZ R0.@DPTR MOV B.A R0 = COUNT 1 for (N1)repetitions R1= COUNT 2 for (N1)Comparisons AGAIN 4106 4107 MOV A.AGAIN NOP RESULT: Thus the Assembly Language Program to arrange the given data in ascending order has been written and executed & the results are stored in desired memory location.@DPTR DEC A MOV R0.B LOOP1 Compare consecutive numbers LOOP1 4115 4117 4119 411B 411C 411D JZ SKIP JNC SKIP MOV DPL. .R2 MOVX @DPTR.PROGRAM FOR SORTING A SERIES IN ASCENDING ORDER LABEL START ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100 4103 4104 4105 MOV DPTR.#4501 MOV R2.A BACK 4108 410B 410D 410E 4110 4111 4112 MOV DPTR.DPL MOVX A.A INC DPTR MOV A.@DPTR CJNE A.A INC DPTR MOVX A.A DJNZ R1.

3. Which interrupt remains enabled even after a reset operation What instruction is used to enable the interrupt? What instruction is used to enable the TRAP interrupt? What is the use of RIM instruction? What is the purpose of READY signal? . 4. 2.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. 5.

number of repetitions (i. Step 5: Move the datapointer to point to 4501H Step 6: Move DPL to R2 Step 7: Move the 1st data to B register and increment DPTR and move the 2nd data to the accumulator. Step 12: Store the smallest number to the previous memory location & greatest to the current memory location. Step 16: If the number of repetitions is not completed go to step 3. Step 8: Compare the data from next memory location with the content of accumulator. APPARATUS REQUIRED: (i) 8051 Microprocessor. Step 3: Get the count 2. If carry flag is set (accumulator content is smaller than the other number)..Experiment No: 8051-DESCENDING ORDER Date: AIM: To write an Assembly Language Program to arrange the given data in Descending Order. number of comparisons (i. total number of data-1) in R0 register.e. Step 9: Compare and jump if not equal goto step11 else do next step. Step 4: Save the count 2 in R1 register. ALGORITHM: Step 1: Move the datapointer to point to 4500H Step 2: Get the count 1. (ii) Power Cable. .e. Step 13: Decrement the number of comparisons (count 2). otherwise do the next step. otherwise do next step. Step 15: Decrement the number of repetitions (count 1). go to step 6. total number of data-1) in A register. Step 10: Check ZF. Step 17: Stop the Process. If zero flag is set goto step else do next step Step 11: check CF. Step 14: If the number of comparison is not equal to zero.. go to step 13 otherwise do next step.

FLOWCHART 8051-DESCENDING ORDER Start Initialize Data pointer to get N the length of series Initialize COUNT 1 for (N-1) repetitions Initialize COUNT 2 for (N-1) Comparisons Increment memory pointer and get the number from series IS pointer < (pointer+1)? YES NO Interchange Numbers Decrement COUNT 2 NO Is COUNT 2 zero? YES Decrement COUNT 2 NO Is COUNT 1 zero? YES Store sum as result Stop .

B Interchange numbers if not in order Decrement count2 Decrement count 1 Stop the Process SKIP 411F 4120 4122 4124 MOVX @DPTR.B LOOP1 Compare consecutive numbers LOOP1 4115 4117 4119 411B 411C 411D JZ SKIP JC SKIP MOV DPL.A R0 = COUNT 1 for (N1)repetitions R1= COUNT 2 for (N1)Comparisons AGAIN 4106 4107 MOV A.R2 MOVX @DPTR.A DJNZ R1.A INC DPTR MOVX A.A BACK 4108 410B 410D 410E 4110 4111 4112 MOV DPTR.#4500 MOVX A.A INC DPTR MOV A.R0 MOV R1.#4501 MOV R2.DPL MOVX A.@DPTR MOV B.@DPTR DEC A MOV R0.AGAIN NOP RESULT: Thus the Assembly Language Program to arrange the given data in descending order has been written and executed & the results are stored in desired memory location.PROGRAM FOR SORTING A SERIES IN DESCENDING ORDER LABEL START ADDRESS MNEMONIC OPCODE OPERAND COMMENTS 4100 4103 4104 4105 MOV DPTR.BACK DJNZ R0.@DPTR CJNE A. .

R1? What addressing mode is used in the instruction MOV A.@R1? . A? What addressing mode is used in the instruction ADD A. 2. 3. What is the purpose of ALE signal? What addressing mode is used in the instruction MOV A. 5.#data1? What addressing mode is used in the instruction MOVX @DPTR. 4.OBSERVATION: ADDRESS DATA INPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1.

go to step 6. Step 2: Move the total number of data to the R0 register. . (ii) Power Cable.Decrement the R0 register. Step 7: Increment the destination block pointer. ALGORITHM: Step 1: Make the data pointer to point the address 4500H. The total number of data is stored at 4500H APPARATUS REQUIRED: (i) 8051 Microprocessor. Step 8:. Step 9: If ZF=0.otherwise go to next step.Experiment No: FILLING EXTERNAL MEMORY Date: AIM: To write an Assembly Language Program to fill the data starting from memory location 4200H to 4300H. Step 10: Stop the Process. Step 4: Move the first data to Accumulator Step 5: Make the data pointer to point the address 4200H. Step 3: Increment datapointer. Step 6: Store the first data to the destination address .

FLOWCHART: Start Move DPTR to point 4500 Move count to R0 reg Increment DPTR move 1st data to Accmulator Move DPTR to point 4200 Store the data in the deastination address Increment Data pointer` II Decrement R0 reg NO If ZF=1 YES Stop .

No operation 410FH NOP RESULT: Thus the assembly language program to fill the data starting from memory location 4200H to 4300H and internal memory 30 to 40 has been written and verified. Increment datapointer Move the data from address pointed by DPTR to the accumulator Move the address 4200H to DPTR Move the data from accumulator to the address pointed by DPTR Increment datapointer Decrement the register R0 If ZF=0.@DPTR OPCODE OPERAND COMMENTS 4104H MOV R0.@DPTR 4107H LOOP1 MOV DPTR.A 410AH 410BH 410CH 410DH INC DPTR DEC R0 JNZ LOOP1 Move the address 4500H to DPTR Move the data from address pointed by DPTR to the accumulator Move the content of accumulator to R0 register.PROGRAM: LABEL START ADDRESS 4100H 4103H MNEMONICS MOV DPTR.A 4105H 4106H INC DPTR MOV X A. #4500H MOV X A. .program control jump to label. #4200H MOV X @DPTR.

OBSERVATION: ADDRESS DATA INPUT OUTPUT COMMENTS OUTPUT VIVA VOCE QUESTIONS 1. . What is the use of RST pin? 5. The crystal oscillator is connected to pins__________ &________________ 4. What is the use of JUMP instruction? 2. How many ports are used in 8051 3. “Pushing the stack” refers to___________ operation in a LIFO memory.

Step 3: Get the data for rotation in accumulator. THEORY: The hardware setup consists of a microprocessor motherboard and stepper motor interface board. (iii)Stepper Motor Interface.Experiment No: STEPPER MOTOR INTERFACE AIM: To run a stepper motor at different speed in two directions. The motherboard consists of 8085 MPU. Date: APPARATUS REQUIRED: (i) 8085 Microprocessor. 8KB RAM. Step 7: Check the value of DE reg pair. The software for the system is developed in 8085 assembly language. Step 6: Decrement DE register pair. 8KB EPROM. The microprocessor output the binary sequence through data bus. Otherwise go to step 1. Keyboard and display controller 8279. 21-key Hex-keypad and six numbers of seven segment LEDs and Bus Expansion connector. (ii) Power Cable. ALGORITHM: Step 1: Initialize HL register pair with address 4150H. The stepper motor interface consists of driver transistors for stepper motor windings and address decoding circuit. If it is not equal to zero go to step 3. which are converted to current pulses by the driver transistors and used to drive stepper motor. Step 4: Send the data from accumulator to port address of stepper motor interface. . Step 2: Initialize register B with total number of data for rotation. Step 5: Initialize DE register pair with data 030H.

FLOWCHART: Start Initialize HL reg with 411AH & Initialize B reg with 04H Get data for rotation in accumulator Send data to port address Initialize DE reg pair with 0303H Décrément DE reg Is NO DE=00 YES Increment HL reg pair Decrement B reg Is B=0 YES NO .

41 Initialize HL reg with 411AH. go to REPEAT. OR the accumulator content with D reg. Decrement DE reg pair.M OUT C0H LXI D. Decrement B reg.41 04 REPEAT C0 03. If B#0.411AH 21 MVI B. If DE#0. .PROGRAM: LABEL START ADDRESS MNEMONICS OPCODE OPERAND COMMENTS 4100H 4103H 4105H 4106H 4108H LXI H.41 05. Go to start. Load data 04H to B reg. Send data to accumulator.E ORA D JNZ DELAY INX H DCR B JNZ REPEAT JMP START 06 7E D3 11 00 1B 7B B2 C2 23 05 C2 C3 1A. No operation. The stepper motor is also rotated at different speed.0303H NOP DCX D MOV A. Increment HL reg pair. Move data from E to A.04H MOV A. Send data to output port. Initialize DE reg pair with 0303H. Unipolar steeping scheme: Step 1 2 3 4 clock A1 1 0 0 0 wise A2 0 0 1 0 B1 0 0 0 1 B2 0 1 0 0 A1 1 0 0 0 Anticlock A2 0 0 1 0 wise B1 0 1 0 0 B2 0 0 0 1 Two Phase Steeping Scheme: Step 1 2 3 4 clock A1 1 0 0 1 wise A2 0 1 1 0 B1 0 0 1 1 B2 1 1 0 0 A1 1 0 0 1 Anticlock A2 0 1 1 0 wise B1 1 1 0 0 B2 0 0 1 1 RESULT: Thus the program has been written and the stepper motor is rotated in two directions. go to DELAY.41 00.03 DELAY 410BH 410CH 410DH 410EH 410FH 4112H 4113H 4114H 4117H 0B.

microprocessor 8085 is the enhanced version of ____________ with essentially the same construction set . What is the use of JUMP instruction? 2.OBSERVATION: ADDRESS 411AH 411BH 411CH 411DH Stepper motor DATA 0A 09 06 05 05 06 09 0A Rotated in forward COMMENTS Data to rotate in forward direction INPUT OUTPUT Direction VIVA VOCE QUESTIONS 1. How many machine cycles needed for the execution of ORA? 3. What is the difference between unipolar and two phase steeping scheme? 4. A state during which nothing happens is known as ________________ 5.

otherwise do the next step Step 9: Send the data from accumulator to input port address of ADC interface Step10:store the result and stop the operation . The ADC0809 is suitable for interface with 8086 microprocessor. The ADC0809 has a total unadjusted error of ±1 LSD (Least Significant Digit). ALGORITHM: Step 1: Load data 10 to accumulator. Step 4: Load data 10 to accumulator Step 5: Send the data from accumulator to output port address of ADC interface Step 6: Send the data from accumulator to input port address of ADC interface Step 7: AND the contents 01 with accumulator and compare with it. Step 8:check for zero flag if not set go to step 6.The ADC0808 is also same as ADC0809 except the error. The total unadjusted error in ADC0808 is ± 1/2 LSD.Experiment No: Date: ADC INTERFACING AIM: To write a program to initiate ADC and to store the digital data in memory APPARATUS REQUIRED:   8085 Trainer Kit ADC Interface board THEORY: The ADC0809 is an 8-bit successive approximation type ADC with inbuilt 8-channel multiplexer. The ADC0809 is available as a 28 pin IC in DIP (Dual Inline Package). Step 2: Send the data from accumulator to output port address of ADC interface Step 3: clear accumulator.

FLOWCHART: START TT Initialize HL reg with 411AH & Initialize B reg with 04H Get data for rotation in accumulator Send data to port address Initialize DE reg pair with 0303H Decrement b-reg Is NO DE=00 YES Increment HL reg pair Decrement B reg Is B=0 YES NO .

10 Load 10 to A-reg 4103 OUT C8 Send data to output port 4104 MVI A.10 Load 10 to A-reg 4105 OUT D0 Send data to output port 4106 XRA A Clear accumulator 4107 XRA A Clear accumulator 4108 XRA A Clear accumulator 4109 MVI A.PROGRAM: ADDRESS LABEL MNEMONICS OPCODE OPERAND COMMENTS 4100 START: MVI A.go to specified label 4111 IN C0 Send data to input port 4112 STA 4150 Store accumulator 4115 HLT Stop operation RESULT: Thus the ADC was initiated and the digital data was stored at desired location .10 Load 10 to A-reg 4101 OUT C8 Send data to output port 4102 MVI A.00 Load 00 to A-reg 410A OUT D0 Send data to output port 410B LOOP IN D8 Send data to input port 410C ANI 01 And 01 with accumulator 410D CPI 01 Compare 01 with accumulator 410E JNZ LOOP If zero flag is not set.

What is the difference between LXI H. 5. 3.OBSERVATION: Compare the data displayed at the LEDs with that stored at location 4150 VIVA VOCE QUESTIONS 1.4100 and LHLD 4100? What are the application of microprocessor? What is called LIFO? How many interrupts are there in 8085? Which group of ports of 8255 PPI can be operated in 2modes . 4. 2.

1.00 Referring to Table..1 Input Data in HEX 00 01 02 … 7F … FD FE FF Output Voltage -5.04(appx).the analog output is -5v.00 -4. Outputting digital data 00 and FF at regular intervals to DAC.triangular etc. the port address of DAC is 08H. with 00H as input to DAC.96 5. ALGORITHM: 1. The digital data input and the corresponding output voltages are presented in the table. SQUARE WAVE GENERATION: (i) Load the initial value (00) to accumulator and move it to DAC (ii) Call the delay program (iii) Load the final value (FF) to accumulator and move it to DAC (iv) Call the delay program (v) Repeat steps 2 to 5 .00 … 4.The output is +5v. the output voltage varied in steps of 10/256=0.saw tooth and rectangular wave. Similarly.results in different waveforms namely square.92 4.92 … 0.96 -4.Experiment No: DAC INTERFACING Date AIM: To interface DAC with 8085 to demonstrate the generation of square. APPARATUS REQUIRED:   8085 Trainer Kit DAC Interface board THEORY: DAC 0800 is an 8-bit DAC and the output voltage variation is between -5V and + 5V. with FFH as input .

3. . Else go to step 3 Load value (FF) to accumulator Move the accumulator content to DAC Decrement the accumulator content by 1 If accumulator content is zero go to step2. TRIANGULAR WAVE GENERATION: (i) (ii) (iii) (iv) (v) (vi) (vii) (viii) Load the initial value (00) to accumulator Move the accumulator content to DAC Increment the accumulator content by1 If accumulator content is zero proceed to next step. SAW TOOTH WAVE GENERATION: (i) Load the initial value 00 to accumulator (ii) Move the accumulator content to DAC (iii) Increment the accumulator content by 1 (iv) Repeat steps 3 and 4.2. Else go to step 7.

FLOWCHART: SQUARE WAVEFORM Start Move data to 00H to A Call Delay subroutine Move data FFH to A Call Delay subroutine Jump DELAY: Start Move data FFH to C reg & 05 to B reg Decrement C reg YES Is C#0 NO Decrement B reg Is B#0 NO Return YES .

FLOWCHART: SAWTOOTH WAVEFORM Start Move data to 00H to A Increment A YES If There is No zero NO YES Jump NO Stop .

TRIANGULAR WAVEFORM Start Move data 00H to L reg Move L reg to Accumulator Increment the reg L YES If There is No zero NO Move data to FFH to L reg Move L reg to Accumulator Decrement the reg L YES If There is No zero NO YES Jump NO Stop .

05 L1: MVI C.FF L2: DCR C JNZ L2 OPCODE OPERAND COMMENTS Load 00 to accumulator Send data to output port Call operation Load 00 to accumulator Call operation Jump tothe label specified Load 05 to B-reg Load FF to C-reg Dec C-reg Jump to the label specified if zero flag is not set Decrement B-reg Jump to the label specified if zero flag is not set Return to the mainprogram 410A 410B DCR B JNZ L1 410C RET Saw tooth Wave Generation: ADDRESS LABEL 4100 START: 4101 4102 4103 L1 MNEMONICS OPCODE OPERAND COMMENTS MVI A.PROGRAM: Square Wave Generation: ADDRESS LABEL 4100 START: 4101 4102 4103 4104 4105 4106 4107 4108 4109 MNEMONICS MVI A.00 Load 00 to accumulator OUT C8 Load 00 to accumulator INR A Increment A-reg JNZ L1 Jump to the label specified if zero flag is not set JMP START Jump to the label specified 4104 .00 OUT C8 CALL DELAY OUT C8 CALL DELAY JMP START DELAY: MVI B.

L OUT C8 DCR L JNZ L2 410E JMP START RESULT: Thus the square.triangular and saw tooth waveform were generated by interfacing DAC with 8085 trainer kit.L OUT C8 INR L JNZ L1 OPERAND COMMENTS Load 00 to Lreg Load 00 to accumulator Send data to output port incrementLreg Jump to the label specified if zero flag is not set Load FF to Lreg Load FF to accumulator Send data to output port Decrement Lreg Jump to the label specified if zero flag is not set Jump to the label specified 4107 4108 4109 410A 410B L2: MVI L.00 MOV A.Triangular Wave Generation: ADDRESS LABEL 4100 START: 4101 4102 4103 4104 L1: MNEMONICS OPCODE MVI L..FF MOV A. .

how?? What is difference between PUSH and POP instruction? How many flags are affected for the HALT? . 4. 2. Write the two ways to initialize stack pointer at FFFFH? Define instruction set? is it possible to check AC flag status of 8085.VIVA VOCE QUESTIONS 1. 5. 3.

26 pin parallel port connector. The first part is Microprocessor based system with 8085.So the traffic lights can be automatically switched ON/OFF in desired sequence. THEORY: The traffic lights are interfaced to Microprocessor system through buffer and ports of programmable peripheral Interface 8255. (iii)Traffic Light Interfacing.Experiment No: TRAFFIC LIGHT CONTROLLER AIM: Date: To control the traffic light system with an 8085 microcontroller program. Microprocessor as CPU and the peripheral devices like EPROM. (iii)Lights for traffic signaling. APPARATUS REQUIRED: (i) 8085 Microprocessor. 21 keys Hexa key pad and six number of seven segment LED’s. . The hardware of the system consists of two parts. The Interface board has been designed to work with parallel port of Microprocessor system. (ii) Power Cable. The LED’s can be switched ON/OFF in the specified sequence by the Microprocessor. RAM. Keyboard & Display Controller 8279. Remaining LED’s are used for pedestrian traffic. Programmable as Peripheral Interface 8255. The traffic light interface board is connected to Main board using 26 core flat cables to 26-pin Port connector. The second part is the traffic light controller interface board. which consist of 36 LED’s in which 20 LED’s are used for vehicle traffic and they are connected to 20 port lines of 8255 through Buffer.

. otherwise go to step 3. Step 5: Decrement C reg. Step 6: if C=0 go to step 1. Step 2: Send control word to CNT register. Step 4: Call delay and increment HL pair. Step 3: Send data to port A & B.ALGORITHM: Step 1: Initialize HL pair with 4500H and C reg with 02H.

FLOWCHART: Start Initialize HL pair with 4500H & C reg with 02H Send control word to CNT reg Send data to port A & B Call Delay Increment HL pair Decrement C register If C=0 YES NO .

DELAY: PUSH BC reg pair to stack Move 05H to C reg Load the DE with FFFFH Décrément DE reg pair Is DE=0 NO YES Décrément C reg NO Is C=0 YES POP stack to BC rerg Return .

PROGRAM:
LABEL START ` ADDRESS MNEMONICS OPCODE OPERAND COMMENTS

4100H 4103H 4105H 4106H 4108H 4109H 410AH 410CH 410DH 410EH 4110H 4113H 4114H 4115H 4118H 411BH 411DH 4120H 4121H 4122H 4123H 4126H 4127H 412AH

LXI H,4500H MVI C,02H MOV A,M OUT CNT INX H MOV A,M OUT APRT INX H MOV A,M OUT BPRT CALL DELAY INX H DCR C JNZ LOOP1

21 0E 7E D3 232 7E D3 23 7E D3 CD 23 0D C2

00,45 02

0F

LOOP1

0C

0D 1B,41

Initialize HL pair with 4500H Move data 02H to C reg. Get data from memory to accumulator. Send data to control reg. Increment HL pair reg. Get data from memory to accumulator. Send data to port A. Increment HL pair reg. Get data from memory to accumulator. Send data to port B. Call delay routine. Increment HL pair reg. Decrement HL pair. If C reg value is non-zero go to loop1. Go to start. Move 05H to B reg. Initialize DE reg pair with FFFFH. Decrement DE reg pair. Move data from D to A reg. OR reg with E reg. Go to loop2. Decrement B reg. Go to loop3. Return.

09,41 00,41 05 FF,FF

DELAY LOOP3 LOOP2

JMP START C3 MVI B.05H 06 LXI D,FFFFH 11 DCX D MOV A,D ORA E JNZ LOOP2 DCR B JNZ LOOP3 RET 1B 7A B3 C2 05 C2 09

20,41 1D,41

RESULT: Thus the Assembly Language Program to control the traffic light system has been written and output is verified.

OBSERVATION: ADDRESS 4500H 4501H 4502H 4503H 4504H DATA 80 1A A1 81 5A COMMENTS Control Word First Step Data First Step Data Second Step Data Second Step Data

VIVA VOCE QUESTIONS

6. What is the use of latch? 7. What is the use of IN/OUT instruction? 8. What addressing mode is used for the instruction MOV A,M? 9. What is called buffer? 10. How many modes are there in 8255

Experiment No: KEYBOARD / DISPLAY CONTROLLLER

Date

AIM: To interface 8279 Programmable Keyboard Display Controller to 8085 Microprocessor. APPARATUS REQUIRED:     8085 Microprocessor toolkit 8279 Interface Board VXT Parallel bus Regulated D.C Power supply

THEORY:

& 310
A programmable keyboard and display interfacing chip. It Scans and encodes up to a 64-ey keyboard and it controls up to a 16-digit numerical display. The keyboard section has a builtin FIFO 8 character buffer. The display is controlled from an internal 16x8 RAM has stores the coded display information.

90H OUT C2H MOV A.M OPERAND COMMENTS Initialize HL pair with 4130H Load 0F to D-reg Load 10 to A-reg Send data to outport port Load CC to A-reg Send data to outport port Load 90 to A-reg Send data to outport port Move content of memory to accumulator Send data to outport port Call delay Increment HL pair Decrement D-reg Jump to the label specified if zero flag is not set Jump to the label specified Load A0 to B-reg Load FF to C-reg Decrement C-reg Jump to the label specified if zero flag is not set Decrement B-reg Jump to the label specified if zero flag is not set Return to the main program 410B 410E 4121 4122 4123 OUT C0H CALL DELAY INX H DCR D JNZ LOOP 4126 4129 412B 412D 412E JMP START DELAY: MVI B.4130H MVI D.CCH OUT C2H MVI A.0FH MVI A.10H OUT C2H MVI A.PROGRAM: ADDRESS LABEL 4100 START: 4101 4102 4103 4104 4107 4108 4109 410A LOOP: MNEMONICS OPCODE LXI H. .FFH LOOP1 DCR C JNZ LOOP1 4131 4132 DCR B JNZ LOOP2 4135 RET RESULT: Thus 8279 controller was interfaced with 8085 and program for rolling display was executed successfully.A0H LOOP2 MVI C.

What is the use of RETURN instruction? 13.4130H . How many machine cycles are used for the instruction LXI H. 4130 -FF 4131 -FF 4132 –FF 4133 -FF 4134 -FF 4135 -FF 4136 -FF 4137 -FF 4138 -FF 4139 -FF 413A -FF 413B–FF 413C -FF 413D-FF 413E-FF 413F-FF VIVA VOCE QUESTIONS 11. What is the Jump range? 15.FF? 14.OBSERVATION: Pointer equal to 4130 FF repeated eight times. What is the use of CALL instruction? 12. What addressing mode is used for the instruction MVI C.

select Bank 1 of RAM by setting 3rd bit of PSW Using Register 0 of Bank 1 and accumulator perform addition For direct addressing provide the address directly(30 in this case) Use the address and Accumulator to perform addition Verify the results. APPARATUS REQUIRED:   8051 Interfacing board power supply ALGORITHM: For Bit addressing.Experiment No: RAM ADDRESING Date AIM: To exhibit the RAM direct addressing and bit addressing schemes of 8051 microcontroller. .

#4500 MOVX @DPTR.#data1 MOV A.3 MOV R0.A SJMP HERE HERE: OBSERVATION: Bit Addressing: INPUT : 54 25 OUTPUT: 79(4500) Direct Addressing: INPUT : 54 25 OUTPUT: 79(4500) RESULT: Thus the program to exhibit different RAM addressing schemes of 8051 was executed.#4500 MOVX @DPTR.R0 MOV DPTR.A SJMP HERE HERE: Direct Addressing: MOV 30.30 MOV DPTR.PROGRAM: Bit Addressing: SETB PSW.#data2 ADD A.#data2 ADD A. .#data1 MOV A.

Sign up to vote on this title
UsefulNot useful