Very cool! And it can be streamlined down to no more than two jumps:
sne M*(N+0)+step*0 ,M*(N+0)+step*1
seq M*(N+0)+step*2 ,M*(N+0)+step*3
jmp found
sne M*(N+2)+step*0 ,M*(N+2)+step*1
seq M*(N+2)+step*2 ,M*(N+2)+step*3
jmp 3 ,>ptr1
sne M*(N+1)+step*0 ,M*(N+1)+step*1
seq M*(N+1)+step*2 ,M*(N+1)+step*3
jmp found ,>ptr1
sne M*(N-2)+step*0 ,M*(N-2)+step*1
seq M*(N-2)+step*2 ,M*(N-2)+step*3
jmp 3 ,<ptr1
sne M*(N-1)+step*0 ,M*(N-1)+step*1
seq M*(N-1)+step*2 ,M*(N-1)+step*3
jmp found ,<ptr1
sne N*(M+2)+step*0 ,N*(M+2)+step*1
seq N*(M+2)+step*2 ,N*(M+2)+step*3
jmp 3 ,}found
sne N*(M+1)+step*0 ,N*(M+1)+step*1
seq N*(M+1)+step*2 ,N*(M+1)+step*3
jmp found ,}found
sne N*(M-2)+step*0 ,N*(M-2)+step*1
seq N*(M-2)+step*2 ,N*(M-2)+step*3
jmp 3 ,{found
sne N*(M-1)+step*0 ,N*(M-1)+step*1
seq N*(M-1)+step*2 ,N*(M-1)+step*3
jmp found ,{found
jmp start
found mul.ab #M ,ptr1
mov.ba ptr1 ,ptr1
ptr1 sne *0 ,@[EMAIL PROTECTED]
we just need to work on that decoder.
P. Kline


|