Note that you are using obsolete OOP from Turbo Pascal. Note that
class is not the same thing as
object.
Classes need to operate on "instances". I.e. a specific self-contained object which in reality is a reference to memory volume (data) and methods on how to operate it.
In other words:
type TMyClass = class
public A; virtual;
end;
var
MyClass: TMyClass;
begin
MyClass.Init;
MyClass.A;
end;
Is not correct. A is a method that needs to operate on an "instance", and therefore calling it on class "type" may and will result in unexected behavior. The fact that A is
virtual makes things only worse - as virtual methods not just operate on some abstract memory volume, but operate on a specific instance of a class which you don't provide.
So, what happens above is
MyClass (in your case
Processor) variable is
nil. Nil is a reference to "nowhere", meaning that the instance doesn't exist. Some methods may survive being called on a
nil instance. But virtual methods that must know about what instance they are called on (to know what exact child of the method must be called) cannot do that and hence the error.
Again, the confusion comes from old
objects which were rather like (advanced)
records, i.e. were automatically allocated on heap memory and therefore didn't need any additional memory management to make sure the variable is pointing to a valid instance of a class.
So, the new way of handling objects is this:
type TMyClass = class
public A; virtual;
end;
var
MyClass: TMyClass; // this is a reference to an instance of the class
begin
MyClass := TMyClass.Create; // create an instance of the class and assign it to the variable pointing to the instance of the class
MyClass.A; // call method of this specific instance;
MyClass.Free; // finally release memory occupied by the class
end;
I must admit that a few years ago I myself had been struggling with this specific problem
And this short book helped me greatly to switch from Turbo Pascal to modern Pascal way of thinking
https://castle-engine.io/modern_pascal