Changes
Another algorithm
ei
ret
</pre>
== [[Longshot]] version ==
Interleave keys here
28 bytes - 349 nops
<pre>
Asic_Unlock
ld de,#533e ; interleave key 32 bits
ld hl,#849 ; interleave key (#841 to lock)
ld a,#ff
ld bc,#bcef ; crtc input io address and 1st nibbles
out (c),a ; RQ00 <>0
out (c),0 ; defb #ed,#71 ; Send 00 (out (c),0
Asic_Unlock_Loop:
out (c),a ; Send 2 nibbles
xor h ; Put bit 12 of the key in the bit 4 of A for high nibble
and c ; erase bit 4 to put key bit instead
xor h
adc hl,hl ; Extract left incoming bit of high nibble of interleave key
ret z ; exit when key is empty (extra value sent to io address)
ex de,hl ; Switch the interleave key (add hl,hl is good for you)
rra ; Bit 7 high nibble=Cf and rotate the complete byte
add hl,hl ; Extract left incoming bit of low nibble of interleave key
jr Asic_Unlock_Loop ; Send at last 20 values to crtc input io address
</pre>