These both instructions JZ and JNZ are not working for me. ie for JZ(Jump on Zero) though the accumulator is not zero, i am getting the jump instruction executed.
betwixt is correct. jz and jnz will check to see the ZERO flag, not the accumulator. This condition is true for any microprocessor, I believe. Basically, something is done in previous two or three instructions before JZ and after that you test the zero flag. You might wanna read more on how the zero flag is affected by other instructions.