a block of data is stored in memory location from d001 h 2005 write a program to find the number count number which are divisible by 2 Indian block store result immediately after the end of block
Answers
Answer:
Here is how to find the number count number which are divisible by 2 Indian block store result immediately after the end of block
Explanation:
Algorithm
Take a count equal to 4
Store the starting address of both blocks in 2 different register pairs
Now exchange the contents at the addresses in both register pairs
Increment the values of both register pairs
Decrements count by 1
If count is not equal to 0 repeat steps 3 to 5
LXI D 2001 – Loads register pair, that is in this case, D=20 and E=01
LXI H 3001 – H=30 and L=01
MVI C 04 – Assigns immediate data, eg.- here C=04
MVI A 45 – assigns A(accumulator) with 45, A=45
MOV B, M – Here M is the data in H – L register pair and it serves as an address. Copies content at address stored in M to register B
LDAX D – Here Accumulator is loaded with the data stored at address formed by register pair D – E
MOV M, A – Here A’s content is copied to address which is stored in M.
MOV A, B – Copies content of register B to A
STAX D – Stores the content of A (accumulator) in the address formed by register pair D – E.
INX H – Increment the content of register pair H – L
INX H – Increment the content of register pair D – E
DCR C – Decrements the content of register C
JNZ 2508 – If value of register C is not equal to 0 then jump to address 2508
HLT – Stop execution of program
See more:
https://brainly.in/question/43618870
#SPJ1
Explanation:
a a block of data store in memory location from :
D-001
H-2005
divisible by 5l