Computer Science, asked by costi1902, 1 year ago

Write a program to store byte aah in 200 memory locations and also test the contents of each location to see if aah is present. If it fails, the system should display the message bad memory.

Answers

Answered by NarenKarthikeyan
0

Answer:

Load register pair H-L with the address 2500H

Load register pair D-E with the address 2600H

Move the content at memory location into accumulator

Store the content of accumulator into memory pointed by D-E

Increment value of register pair H-L and D-E by 1

Decrements value of register C by 1

If zero flag not equal to 1, go to step 3

Stop

Explanation:

Registers A, D, E, H, L, C are used for general purpose:

MOV is used to transfer the data from memory to accumulator (1 Byte)

LXI is used to load register pair immediately using 16-bit address (3 Byte instruction)

MVI is used to move data immediately into any of registers (2 Byte)

STAX is used to store accumulator into register pair indirectly (3 Byte instruction)

DCR is used to decrease register by 1 (1 Byte instruction)

INX is used to increase register pair by 1 (1 Byte instruction)

JNZ is used to jump if not zero to given memory location (3 Byte instruction)

HLT is used to halt the program

Similar questions