main functions and procedures
compiled 'core.pas'