write an assembly language program using 8086 to add all the bytes value store in file consecutive memory location
Answers
Here is a program to lets say add 100 memory locations byte value
LDA 8500 // Some memory location say 8500
// Load the accumulator with the address of memory viz 8500
MOV D, A
// Move the accumulator value to the register D
MVI E, 99
// Load the E register with the counter 100 - 1
LXI B, 8500 + 1 // Next memory location from where we have done LDA - 8501
// Load immediate B C with the memory location
LDAX B
// Load Accumulator indirect A=[BC]
ADD D
//Add the content of the Accumulator to the Register D
MOV D, A
//Move the value in D to the Accumulator or register A
INX B
// Increment BC register pairs
DCR E
// Decrement the counter register
LDAX B
JNZ 9000 //
// Jump on no zero
STA 9000 // Suitable memory location
// Store the output into a memory location
HLT
End the program
"The program in assembly language to add all the byte values and store in consecutive memory locations is as follows:
LDA 8500 // Some memory location say 8500
// Load the accumulator with the address of memory viz 8500
MOV D, A
// Move the accumulator value to the register D
MVI E, 99
// Load the E register with the counter 100 - 1
LXI B, 8500 + 1 // Next memory location from where we have done LDA - 8501
// Load immediate B C with the memory location
LDAX B
// Load Accumulator indirect A=[BC]
ADD D
// Add the content of the Accumulator to the Register D
MOV D, A
// Move the value in D to the Accumulator or register A
INX B
// Increment BC register pairs
DCR E
// Decrement the counter register
LDAX B
JNZ 9000
// Jump on no zero
STA 9000 // Suitable memory location
// Store the output into a memory location
HLT
//End of the program"