tw1633.pp 518 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. { %fail }
  2. {$ifdef fpc}
  3. {$mode delphi}
  4. {$asmmode intel}
  5. {$endif}
  6. type tscreen = class
  7. x : Cardinal;
  8. end;
  9. type ttestobj = class
  10. screen : tscreen;
  11. constructor create;
  12. function testasmcall : tscreen;
  13. end;
  14. var
  15. testobj : ttestobj;
  16. constructor ttestobj.create;
  17. begin
  18. asm
  19. mov screen.x,0
  20. end;
  21. end;
  22. function ttestobj.testasmcall : tscreen;
  23. begin
  24. asm
  25. mov screen.x, 0
  26. ADD screen.x, 1
  27. end;
  28. result := screen;
  29. end;
  30. begin
  31. testobj := ttestobj.create;
  32. testobj.testasmcall;
  33. testobj.destroy;
  34. end.