by Sam_Odio · 17y ago · 0 comments
Here's an easy brain teaser: do the above using only two registers.
I have used a similar trick (with a fixed N) to implement a cheap running average for an image acquisition software and it works quite well, but of course if N is very large val / N becomes negligible.