Instructions & Addressing Modes


Answer & solution
Answer: A=05H and B=0AH (decimal 5 and 10). (no official key was published)
MVI means “move immediate”: it loads the byte written in the instruction directly into the named register. MVI B,0AH sets B to hexadecimal 0A, which is decimal 10. MVI A,05H then sets the accumulator to hexadecimal 05, which is decimal 5. These are the initialized values just before CALL SUB, not claims about unspecified power-on register contents.
LXI H,1C40H loads the separate HL pair and does not change either A or B. CALL changes control flow and the stack, not these initialized register values. During the routine A remains the search key 05H because CMP only changes flags. B is the loop counter and can subsequently decrease. The source asks for the initial values, so a final B value derived from an assumed memory image would answer a different question.