Professional Documents
Culture Documents
Ee312-Assgn 13
Ee312-Assgn 13
LAB ASSIGNMENT-13
~By Arhita Kundu(210102021)
1. Consider the decimal number 14.25 stored in BCD format. Addresses A and (A + 1) respectively store 14 and
25 in BCD. Convert 14.25 to fixed-point representation and store that in addresses B and (B+1). Here, B
stores the integer part (8bits) and (B + 1) stores the fraction part (8bits).
1. Load and Exchange (LHLD 2000, XCHG):
- Load the contents of memory location 2000 into the HL register pair.
- Exchange the contents of the HL register pair with the DE register pair.
- Extract the lower 4 bits of the E register (MOV A,E, ANI 0F).
- Extract the higher 4 bits of the E register, rotate right through carry (RRC), and store in register C.
- Move E to A.
- Move B to A.
- Move E to A.
- Move B to A, rotate right through carry, and jump back to the LOOP label.
In summary, the code processes a BCD number, converts its integer and decimal parts separately to
hexadecimal, and stores the result in memory. The loop iterates through each digit of the BCD number. The
final hexadecimal result is stored in consecutive memory locations.
2. Read data1 from memory location 2000H. After a delay of around 100ms, data2 from location 2001H. After a
delay of 100ms store the sum of data1 and data2 at 2002H. Explain your approach and delay estimation.
4. Increment HL, Add D, and Store in Memory (INX H, ADD D, MOV M,A):
- Set C to 10H.
Note: The code involves memory manipulations, subroutine calls, and delay loops. The actual functionality
depends on the specifics of the DELAY1 subroutine and the purpose of the data manipulation.
3. Write a program for 8085 to copy 5 numbers stored from address 2000H to 3000H if the number of ones in
the number is greater than four else copy FF.
1. Initialization (START):
- Call the subroutine COUNT_ONES to count the number of set bits in the content of C.
- If the count is less than 4, subtract it from a preset value and store the result in memory.
- Use a loop labeled COUNT_LOOP to count the number of set bits in register C.
- The data sequence consists of numbers: 01, 03, 60, 71, 50.
4. Someone has damaged a program written at 4050H for 8085 microprocessor. The damage is done by
changing the bit D7 and bit D5 of each byte. The size of the program is 100 bytes. Now write a program for
8085 to correct this damaged program.
1. Set the origin address to memory location 4050H.
2. Initialization:
1. Initialization (START):
- Load the first term of the Fibonacci sequence (C) into register A.