tw0961.pp 448 B

123456789101112131415161718192021222324252627282930313233
  1. { %CPU=i386 }
  2. { older ppc386 only define cpu86 }
  3. {$ifdef cpu86}
  4. {$define cpui386}
  5. {$endif cpu86}
  6. var
  7. x,y : byte;
  8. z : longint;
  9. {$asmmode intel}
  10. procedure test(var x : byte);
  11. begin
  12. x:=5;
  13. {$ifdef cpui386}
  14. asm
  15. mov edi,$12345678
  16. mov edi,x
  17. mov dword ptr [edi],78
  18. end;
  19. {$else cpui386}
  20. x:=$78;
  21. {$endif cpui386}
  22. end;
  23. begin
  24. x:=34;
  25. test(x);
  26. if x<>78 then
  27. begin
  28. Writeln('Problem !!');
  29. Halt(1);
  30. end;
  31. end.