Professional Documents
Culture Documents
Microprocessor Programming
Microprocessor Programming
Microprocessor Programming
MICROPROCESSOR PROGRAMMING
1.Statement: Find the l's complement of the number stored at memory location F000H and store the
complemented number at memory location F100H.
2. Statement: Find the 2's complement of the number stored at memory location F000H and store the
complemented number at memory location F100H.
C000 LDAF000H : Get the contents of memory location F000H into accumulator
C003 MOV B, A : Save the contents into B register
C004 LDA F100H : Get the contents of memory location F1000Hinto accumulator
C007 STA F000H : Store the contents of accumulator at address F000H
C00A MOV A, B : Get the saved contents back into A register
C00B STA F100H : Store the contents of accumulator at address F100H
4. Statement: Subtract the contents of memory location F001H from the memory location F000H and
place the result in memory location F002H.
5.Statement: Add the contents of memory locations F000H and F001H and place the result in the
memory locations F002Hand F003H.
6.Statement: Pack the two unpacked BCD numbers stored in memory locations F200H and F201H and
store result in memory location F300H. Assume the least significant digit is stored at F200H.
Sample problem:
(F200H) = 04
(F201H) = 09
Result = (F300H) = 94