English
Language : 

Z51F0410 Datasheet, PDF (183/184 Pages) Zilog, Inc. – Z8051 Series 8-Bit Microcontrollers
Z51F0410
Product Specification
 Do not use input bit port for bit operation but for byte operation. Using byte operation instead
of bit operation will not cause any error in using compare jump instructions for input port.
while(1){
if ((P0&0x01)==0x01){ P10=1; }
else { P10=0; }
P11^=1;
}
zzz: MOV A, 080
; read as byte
JNB 0E0.0, xxx ; compare
SETB 088.0
SJMP yyy
xxx: CLR 088.0
yyy: MOV C,088.1
CPL C
MOV 088.1,C
SJMP zzz
If you use input bit port for compare jump instruction, you have to copy the input port as internal
register or carry bit and then use compare jump instruction.
bit tt;
while(1){
tt=P00;
if (tt==0){ P10=1;}
else { P10=0;}
P11^=1;
}
zzz: MOV C,080.0 ; input port to C
MOV 020.0, C ; C to internal register
JB 020.0, xxx ; compare with internal register
SETB 088.0
SJMP yyy
xxx: CLR 088.0
yyy: MOV C,088.1
CPL C
MOV 088.1,C
SJMP zzz
PS029502-0212
PRELIMINARY
180