List various instructions that can be used to clear accumulator in 8085
Answers
Answered by
5
executing instructions which affect them appropriately. Here's a method that only uses one register and no stack (this example uses B):-
MVI B,0 ; B = 0 INR B ; B = 1 (resets Sign, Zero, Parity and Auxiliary Carry flags) STC ; set Carry flag CMC ; complement Carry flag
The INR (Increment Register) instruction sets S, Z, P and AC flags according to the result of the increment. 1 is positive and not zero, so the S and Z flags are reset. It has an odd number of '1' bits so P is reset, and there is no carry from bit 3 so AC is reset.
INR does not affect the Carry flag, so we must reset it separately. Unfortunately the 8085 does not have a 'reset carry' instruction, but it does have 'set carry' and
MVI B,0 ; B = 0 INR B ; B = 1 (resets Sign, Zero, Parity and Auxiliary Carry flags) STC ; set Carry flag CMC ; complement Carry flag
The INR (Increment Register) instruction sets S, Z, P and AC flags according to the result of the increment. 1 is positive and not zero, so the S and Z flags are reset. It has an odd number of '1' bits so P is reset, and there is no carry from bit 3 so AC is reset.
INR does not affect the Carry flag, so we must reset it separately. Unfortunately the 8085 does not have a 'reset carry' instruction, but it does have 'set carry' and
Answered by
24
1)MVI A, 00H
2)ANI 00H
3)XRA A
4)SUB A
Similar questions
English,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Math,
1 year ago
Math,
1 year ago