beginning of CPU interface code