program Compiler; {$mode Delphi}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes, SysUtils, UZ80Compiler, CustApp, UDynamicNumber; type TCompilerApplication = class(TCustomApplication) protected procedure DoRun; override; end; procedure TCompilerApplication.DoRun; var Compiler: TZ80Compiler; SourceCode: TStringList; FileName: string; begin Compiler := TZ80Compiler.Create; with Compiler do begin if HasOption('s', 'source') then begin FileName := GetOptionValue('s', 'source'); SourceCode := TStringList.Create; SourceCode.LoadFromFile(FileName); Load(SourceCode); SourceCode.Destroy; end else begin raise Exception.Create('Source file name not specified.'); end; end; Compiler.Destroy; ReadLn; Terminate; end; var Application: TCompilerApplication; {$IFDEF WINDOWS}{$R Compiler.rc}{$ENDIF} begin Application := TCompilerApplication.Create(nil); with Application do begin StopOnException := True; Title := 'Z80 compiler'; Run; Free; end; end.