0% found this document useful (0 votes)
15 views2 pages

Expt 6 A

The document contains assembly code that stores 15 numbers from memory locations 0040H to 004FH and another 15 numbers from 0050H to 005FH. It adds the numbers with the same ordinal positions from both sets and stores the results starting at memory location 0060H. The code includes a loop for processing and storing the results, with specific memory locations outlined for input and output data.

Uploaded by

physizzmva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Expt 6 A

The document contains assembly code that stores 15 numbers from memory locations 0040H to 004FH and another 15 numbers from 0050H to 005FH. It adds the numbers with the same ordinal positions from both sets and stores the results starting at memory location 0060H. The code includes a loop for processing and storing the results, with specific memory locations outlined for input and output data.

Uploaded by

physizzmva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

6.

(a) Write the assembly code for the following: Store 15 numbers from the memory location 0040H
to 004FH and another 15 numbers from 0050H to 005FH. Add two numbers with the same ordinal
positions in the two sets. Store the results at memory locations starting from 0060H.

Assembly Code:

ORG 0000H

MOV R0,#40H

MOV R1,#50H

MOV R2,#60H

MOV R3,#0FH

LOOP: MOV A,@R0

ADD A,@R1

MOV B,A

MOV A,R1

ADD A,#10H

MOV R1,A

MOV @R1,B

SUBB A,#10H

MOV R1,A

INC R0

INC R1

INC R2

DJNZ R3,LOOP

DONE: SJMP DONE

END

Observation:

Memory 0x0040H 0x0041H 0x0042H 0x0043H 0x0044H 0x0045H 0x0046H 0x0047H


Location
Data
Memory 0x0048H 0x0049H 0x004AH 0x004BH 0x004CH 0x004DH 0x004EH 0x004FH
Location
Data
Memory 0x0050H 0x0051H 0x0052H 0x0053H 0x0054H 0x0055H 0x0056H 0x0057H
Location
Data
Memory 0x0548H 0x0059H 0x005AH 0x005BH 0x005CH 0x004DH 0x005EH 0x005FH
Location
Data
Memory 0x0060H 0x0061H 0x0062H 0x0063H 0x0064H 0x0065H 0x0066H 0x0067H
Location
Data
Memory 0x0068H 0x0069H 0x006AH 0x006BH 0x006CH 0x006DH 0x006EH 0x006FH
Location
Data

You might also like