summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw0961.pp
blob: 2147ff1a013d16b6af7da1f32b5a050a55725b35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ %CPU=i386 }
{ older ppc386 only define cpu86 }
{$ifdef cpu86}
{$define cpui386}
{$endif cpu86}
var
 x,y : byte;
 z : longint;
{$asmmode intel}

procedure test(var x : byte);
begin
  x:=5;
{$ifdef cpui386}
  asm
    mov   edi,$12345678
    mov   edi,x
    mov   dword ptr [edi],78
  end;
{$else cpui386}
  x:=$78;
{$endif cpui386}
end;

begin
  x:=34;
  test(x);
  if x<>78 then
    begin
      Writeln('Problem !!');
      Halt(1);
    end;
end.