Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- while True do
- begin
- op := Bytecode.Code[pc];
- Inc(pc);
- BIN_SUB:
- begin
- right := frame.Pop();
- frame.Top.SUB(right, bytecode.Variables[op.arg]);
- frame.SetTop(bytecode.Variables[op.arg]);
- end;
- BIN_MUL:
- begin
- right := frame.Pop();
- frame.Top.MUL(right, bytecode.Variables[op.arg]);
- frame.SetTop(bytecode.Variables[op.arg]);
- end;
- ...
- procedure SetIntDest(var dest:TEpObject; constref value:epInt); inline;
- begin
- if dest is TIntObject then
- TIntObject(dest).value := value
- else
- begin
- if not(dest is TNoneObject) then dest.Free;
- dest := TIntObject.Create(value);
- end;
- end;
- ...
- procedure TIntObject.MUL(other:TEpObject; var dest:TEpObject);
- begin
- if (other is TIntObject) then
- SetIntDest(dest, self.value * TIntObject(other).value)
- else if (other is TFloatObject) then
- SetFloatDest(dest, self.value * TFloatObject(other).value)
- else
- inherited;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement