Sofern bit 1 stets 0 ist:
Code
lsr zeropageByte [6] ; shift to the right, carry flag contains now former bit 0
bcc nottin [2/3] ; carry is clear: do nothing
inc zeropageByte [5] ; carry is set: increase zeropageByte => current bit 0 becomes 1
.nottin
rol zeropageByte [5] ; rotate to the left, carry flag is shifted into bit 0
insgesamt 18/19 Taktzyklen und 8 bytes.
Andernfalls mit bit 1 "initialisieren":
Code
lda zeropageByte [3] ; clear bit 1
and #%00000010 [2]
sta zeropageByte [3]
lsr zeropageByte [6] ; shift to the right, carry flag contains now former bit 0
bcc nottin [2/3] ; carry is clear: do nothing
inc zeropageByte [5] ; carry is set: increase zeropageByte => current bit 0 becomes 1
.nottin
rol zeropageByte [5] ; rotate to the left, carry flag is shifted into bit 0
insgesamt 26/27 Taktzyklen und 14 bytes.
Freitags-brain-fart und ungestestet.