tw1633.pp 531 B

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