I think I finished implementing the f function.

Testing will come when the rest is written, since testing specific parts
of assembly code is hard.