blob: 94bb96cce31eff3c130b296da62c17eb13874b74 (
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
34
35
36
37
38
39
40
41
42
43
|
{%CPU=i386}
{%opt=-Cg-}
program test_word_ref;
var
j,loc : word;
{$asmmode att}
procedure TestAtt(w : word);
begin
asm
movw w,%ax
movw %ax,loc
end;
end;
{$asmmode intel}
procedure TestIntel(w : word);
begin
loc:=56*j;
asm
mov ax,w
mov [loc],ax
end;
end;
begin
j:=6;
TestAtt(6);
if loc<>6 then
begin
Writeln('Error in att code');
halt(1);
end;
TestIntel(46);
if loc<>46 then
begin
Writeln('Error in intel code');
halt(1);
end;
end.
|