Program to make output port B = FFH, if and only if input port A = 01H (another input then output is 00)
Here my code:
LD A, 4FH
OUT (82H), A
LD A, 0FH
OUT (83H), A
LOOP: IN A,(80H)
CP 01H
JR NZ,S1
LD A,00H
S1: LD A,FFH
OUT (81H),A
JP LOOP
the problem is when i give input another than 01, the output still FF