
    ...
    push   b
    mov    a, P0        ;get the present port 0 value
    add    a, #008H     ;add in a 1 at the low bit pos
    anl    a, #038h     ;mask the count to just 3 bits
    mov    b, a         ;save copy of count
    mov    a, P0        ;make copy of alternate bits
    anl    a, #0C7H
    orl    a, b         ;merge new count into a alternates
    mov    P0, a        ;set port 0 to new bits
    pop    b 
    ...    


