I'm sure there's prior art, of course, even in assembler, if you look in the right places.
_________________________
Tony Fabris