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
44
45
46
47
48
|
{ %cpu=i386 }
{ %opt=-Cg- }
program bug;
type
br=bitpacked record //Note! "bitpacked"
l:longword;
m:longword;
h:longword;
end;
var
l,
m,
moffs,
h: longword;
test:br;
{$asmmode att}
begin
with test do
begin
l:=4;
m:=8;
h:=$f
end;
asm
movl br.m,%eax //eax should be 4,but it is 32. Eight times. error!
movl %eax, moffs
movl test.m,%eax //eax should be 8,but it is, a strange number. error!
movl %eax, m
movl test.l,%eax
movl %eax, l
movl test.h,%eax
movl %eax, h
end;
if (moffs<>4) then
halt(1);
if (m<>8) then
halt(2);
if (l<>4) then
halt(3);
if (h<>$f) then
halt(4);
end.
|