ERO,

many thanks for your help.

The BASIC part is "readable" for me.

To be honest, I do not understand the ASM part.

I will start experimenting with the BASIC stuff and let you know how it works.

What I understand so far is:
It should be possible without having to use ASM,
but the challenge is to finetune the execution time of the program loops to get an acceptable accuracy.