MAA Assingment 4
MAA Assingment 4
3. MUL AB
Description: the multiplicand and the multiplier must be in A and B registers. After multiplication
if the result is 8 bit it will be in the accumulator and if the result is larger than 8 bit ,lower byte of
result will be in accumulator and higher byte will be in register B.
Example : MOV A,#10H
MOV B,#02 H
MUL AB
After execution A=20H,B=0 H
5. MOV A,R0
Description: this instruction copies the contents of source register R0 into accumulator. The
register R0 remains unaffected.
Example: Before Execution A=43 H, R0=32 H
After execution A=32 H, R0-32H
6. MOVC A, @ A + DPTR
Description: Copy the contents of code memory pointed by the sum of Accumulator and
DPTR to the Accumulator
MOVC is a move instruction, which moves data from the code memory space. The address
operand in this example is formed by adding the content of the DPTR register to the
accumulator value.
Here the DPTR value is referred to as the base address and the accumulator value is referred to
as the index address.
ORG 0000H
MOV 30H,A
END
8. Write a program to move data from accumulator to memory location 30h using immediate and
indirect addressing mode.
ORG 0000H
MOV R1, #30H
MOV @R1 ,A
END
9. Write a program to transfer a block of data from internal memory location 20H to internal memory
location 40H.
ORG 0000H
MOV R0, #20H ; Initialize source pointer R0 to 20H
MOV R1, #40H ; Initialize destination pointer R1 to 40H
10. Write ALP to find smallest number from the given five bytes stored in internal memory locations
40H onwards and store the result in location 50H.
ORG 0000H
MOV R0,#40H Initialize source pointer R0 to 40H
MOV R1, #05H Initialize byte counter
MOV A, #0FFH
12. Write a program to multiply two 8 bit numbers which are stored at internal memory location 30H
and 31H.