Added most of the logic needed by the PC register, not tested.