source: branches/libc-0.6/testcase/optlink/tst2asm.asm@ 2800

Last change on this file since 2800 was 678, checked in by bird, 22 years ago

Fixed testcase.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1 .386
2 .387
3CODE32 segment para use32 public 'CODE'
4CODE32 ends
5DATA32 segment para use32 public 'DATA'
6DATA32 ends
7CONST32_RO segment para use32 public 'CONST'
8CONST32_RO ends
9BSS32 segment para use32 public 'BSS'
10BSS32 ends
11DGROUP group BSS32, DATA32
12 assume cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
13CONST32_RO segment
14@CBE1 dq 3ff8000000000000r ; 1.5000000000000000e+00
15CONST32_RO ends
16CODE32 segment
17
18; 21 int _Optlink asmfoo(int i1, struct sss s1, void *pv, float rf1, struct sss s2)
19 align 010h
20
21 public asmfoo
22asmfoo proc
23 push ebp
24 mov ebp,esp
25 mov [ebp+08h],eax; i1
26 mov [ebp+014h],edx; pv
27 fstp dword ptr [ebp+018h]; rf1
28
29; 23 if (i1 != 1)
30 cmp dword ptr [ebp+08h],01h; i1
31 je @BLBL1
32
33; 24 return 1;
34 mov eax,01h
35 pop ebp
36 ret
37 align 010h
38@BLBL1:
39
40; 25 if (s1.a != 2)
41 cmp dword ptr [ebp+0ch],02h; s1
42 je @BLBL2
43
44; 26 return 2;
45 mov eax,02h
46 pop ebp
47 ret
48 align 010h
49@BLBL2:
50
51; 27 if (s1.b != 3)
52 cmp dword ptr [ebp+010h],03h; s1
53 je @BLBL3
54
55; 28 return 3;
56 mov eax,03h
57 pop ebp
58 ret
59 align 010h
60@BLBL3:
61
62; 29 if (pv != (void*)4)
63 cmp dword ptr [ebp+014h],04h; pv
64 je @BLBL4
65
66; 30 return 4;
67 mov eax,04h
68 pop ebp
69 ret
70 align 010h
71@BLBL4:
72
73; 31 if (rf1 != (float)1.5)
74 fld dword ptr @CBE2
75 fld dword ptr [ebp+018h]; rf1
76 fucompp
77 fnstsw ax
78 and ax,04500h
79 cmp ax,04000h
80 je @BLBL5
81
82; 32 return 5;
83 mov eax,05h
84 pop ebp
85 ret
86 align 010h
87@BLBL5:
88
89; 33 if (s2.a != 6)
90 cmp dword ptr [ebp+01ch],06h; s2
91 je @BLBL6
92
93; 34 return 6;
94 mov eax,06h
95 pop ebp
96 ret
97 align 010h
98@BLBL6:
99
100; 35 if (s2.b != 7)
101 cmp dword ptr [ebp+020h],07h; s2
102 je @BLBL7
103
104; 36 return 7;
105 mov eax,07h
106 pop ebp
107 ret
108 align 010h
109@BLBL7:
110
111; 37 return 0;
112 mov eax,0h
113 pop ebp
114 ret
115asmfoo endp
116CONST32_RO segment
117 align 04h
118@CBE2 dd 3fc00000r ; 1.5000000e+00
119CONST32_RO ends
120CODE32 ends
121end
Note: See TracBrowser for help on using the repository browser.