Yet another way: decf lo, f incf lo, w bnz exit decf mid f incf mid, w bnz exit decf hi, f exit: