Vous êtes sur la page 1sur 4

Punjab Technical University Lab Assignment

Introduction to Microprocessor

DATA REPRESENTATION 1. Convert the following: (for fraction part take atleast upto four digits after the decimal) A) FROM DECIMAL TO BINARY a) 167.00 b) 0.4475 c) 4097.188 d) 2048.0625 B) FROM BINARY TO DECIMAL a) 10110 b) 0.011011 c) 10111.1011 d) 1101111.101 C) FROM DECIMAL TO OCTAL a) 59.00 b) 0.580 c) 64.20 d) 199.30 D) FROM OCTAL TO DECIMAL a) 743 b) 0.400 c) 557.4 d) 1024.77 E) FROM DECIMAL TO HEXADECIMAL a) 344 b) 0.536 c) 263.478 d)663.889 F) FROM HEXADECIMAL TO DECIMAL a) 632 b) 0.67 c) AB0.77 d) BC2.F7 G) FROM BINARY TO OCTAL a) 1011001100110 b) 11101.1011 H) FROM BINARY TO HEXADECIMAL a) 10110011001 b) 1011101.1011 I) FROM OCTAL TO BINARY a) 167 b) 0.484 c) 234.48 d) 4653.00 J) FROM HEXADECIMAL TO BINARY a) 324 b) 0.67 c) 8109.4A d) EFF2.F K) FROM HEXADECIMAL TO OCTAL a) 381B b) 0.67 c) 641A.7F d) AB2.FF L) FROM OCTAL TO HEXADECIMAL a) 137 b) 0.484 c) 4163.48 d) 775.7 2. Perform the following addition using floating point notation X= 0.1101 X (2)3 Y= 0.1001 X (2)0 Convert the following decimal number in their equivalent BCD A) 147 B) 209 C) 2633 Subtract the following numbers using 1'S compliment method in signed magnitude formA) 101-10 B) 111-11 C) 1010-111 D) 1010-1111

3.

4.

5.

Subtract the following numbers using 2'S compliment method in signed magnitude formA) -48 AND +31 B) -64 AND +46 C) +39 AND -16 D) +62 AND -29

PROGRAMMING A MICROPROCESSOR 1. Draw the pin diagram of microprocessor 8085. 2. Draw microprocessor PINOUT signals and mark them. 3. Organise the given interrupts follow with descending order of interrupt priority RST 7.5; RST 6.5; TRAP; RST 5.5; INTR MICROPROCESSOR TIMING 1) Draw and explain briefly the timing diagram of the following instructions: -

SL NO. MEMORY LOCATION 1. 2. 3. 2005H 2000H 2050H 2051H

HEX CODE 4FH 3EH D3H 01H

MNEMONICS

INSTRUCTION

MOV C, A transfer data bytes from a to c MVI A, 32H load byte 32h in accumulator OUT 01H transfer data from accumulator to output device IN 84H reads(copies) data from input device and place the data byte in the accumulator STA 8000H store content of accumulator in memory location 8000H

4. 2066H

2065H 84H

DBH

5.

2050H 2051H 2052H

32H 00H 80H

2) Draw the timing diagram of rst 7.5 instruction in 8085 system. 3) Draw the timing diagram of rim and SIM instruction in 8085 system 4) Draw the timing diagram of INTA instruction in 8085 system. MICROPROCESSOR 8086 1. Draw the pin diagram of the microprocessor 8086. 2. Explain with pin out diagram 8284 a clock generator. 3. Explain with block diagram the operation of segment register 4. Explain with block diagram the operation of instruction pointer. 5. Explain the operation of the clock section of 8284. PROGRAMMING 1. Write instructions to load the hexadecimal number 65H in the register C, and 92H in the accumulator A. Display the number 65H at port 0; and 92H at the port 1.

2. Write instructions to a) load 00H in the accumulator. b) Decrement the accumulator c) Display the answer. 3. Write a program to a) Clear the accumulator b) Add 47H (using ADI instruction) c) Subtract 92H d) Add 64H. e) Display the results after subtracting 92H and after adding 64H. 4. Load the data byte A8H in register C; mask the high order bits(D7-D4), and display the low order bits (D3-D0) at an output port. 5. Load the bit pattern 91H in register B and 87H in register C. mask all the bits except D0 from register B and C. if D0 is at logic 1 in both registers, turn on the light connected to the D0 position. of output port 01H; otherwise turn off the light. 6. Write instructions to clear the CY flag, to load number FFH in register B, and increment B. if the CY flag is set, display 01 at an output port; otherwise display the contents of register B. briefly explain your result. 7. write instructions to load two unsigned number in register (B) and register (C), respectively. subtract (C) from (B). if the result is in 2's compliment form, convert the result in absolute magnitude and display it at port 1; otherwise display the +ve result. execute the programme with the following set of dataset 1 : (B) = 42H, (C) = 69H set 2 : (B) = 69H, (C) = 42H set 3 : (B) = f8H, (C) = 23H 8. Specify the contents of registers A, D, and HL after execution of the following instructions :LXI H, XX90H SUB A MVI D,0FH LOOP: MOV M, A INX H DCR D JNZ LOOP HLT 9. Rewrite the instructions in questions number 8 before, using the register BC as a memory pointer.

10. The following block of data is stored in the memory location from XX55H to XX5AH. transfer the data to the location XX80H XX85H in the reverse order ( e.g the data byte 22H should be stored at XX85H and the data byte 37H at XX80H) data(H) 22, A5, B2, 99, 7F, 37 11. A string of six data bytes is stored starting from memory location 2050H. The string includes some blanks (bytes with zero value). write a programme to eliminate the blanks from the string. (hints.- to check the blanks set the zero flag by using the ORA. use two memory pointer: one to get a byte, and the other to store the byte) data(H) F2, 00, 00, 4A, 98, 00 12. Identify the contents of the accumulator and the flag status as the following instructions are executed :-

A MVI A, 75H ORA AH CPI A2H

CY

13. Identify the bytes from the following set that will be displayed at port 1; assuming 1 byte is loaded into the accumulator at a time data (H) 58, 32, 7A, 87, F2, D7 14. Write a programme to generate a square wave with period of 400 s use bit D0 to output the square wave. 15. A railway crossing signal has two flashing lights run by a microcomputer. one light is connected to the data bit D7 and the second light is connected to data bit D6 . write a pro gramme to turn each signal light alternately on and off at an interval of 1 second. 16. Write an assembly level language programming(ALP) to add two 8 bit numbers stored at the memory location 2000H and 2001H and store the result at 2002H 17. Write an assembly level language programming (ALP) to subtract two 8 bit numbers, store at location 2000H and 2001H and store the result at 2002H Write an assembly level language programming (ALP) to transfer a block of data stored at memory locations 2000H to 200FH to the memory location 6000H to 600FH. Extra Assignments on PROGRAMMING 1. Write a n assembly level language programming (ALP) to add two 16bit data 0FFH and1F00H.

2. Write an ALP to substruct register pair B-C from register pair D-E and store the result of subtraction in register pair H-L. 3. Write an ALP to perform multiplication of two 8 bit numbers and store result in register pair H-L. 4. Write an ALP to generate an counter that counts from zero to nine and display the count at port 1 for a given time period generated by a delay programme. 5. Write an ALP to find 1's compliment of a 16 bit number.

6. Write an ALP to perform addition of two multi byte number 159279H and 05A2CH, store the 24 bit result in register BCD 7. Write a programme to add a data byte located at offset 0500H in 2000H.

Vous aimerez peut-être aussi