List at least three single instructions that clears all 8 bi
List at least three single instructions that clears all 8 bits of the accumulator B (only B). (Specify operands as well.) Determine how many times the instruction \"DECA\" in the program below is executed if NUM = 100. How many times the \"DECA\" instruction be executed if the \"BNE\" instruction is replaced with \"BEQ\" instruction? How many times the \"DECA\" instruction be executed if the NUM is equated to $00 (ie. NUM = 0)?
Solution
Ans.1. Following commands clear the accumulator:
XRA AMVI B
ANI FOH
MVI B 00H
SUB B
Ans.2.
a. SInce NUM = 100, DECA wont be executed at all. Therefore, 0 times.
b. 1 time since flag is changed from \"not equal\" to \"equal\".
c. Infinite times.
