source: trunk/testcase/optlink/tst2asm.asm@ 2509

Last change on this file since 2509 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
RevLine 
[678]1 .386
2 .387
[635]3CODE32 segment para use32 public 'CODE'
4CODE32 ends
[678]5DATA32 segment para use32 public 'DATA'
6DATA32 ends
[635]7CONST32_RO segment para use32 public 'CONST'
8CONST32_RO ends
[678]9BSS32 segment para use32 public 'BSS'
10BSS32 ends
11DGROUP group BSS32, DATA32
12 assume cs:FLAT, ds:FLAT, ss:FLAT, es:FLAT
[635]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
[678]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
[635]28
29; 23 if (i1 != 1)
[678]30 cmp dword ptr [ebp+08h],01h; i1
[635]31 je @BLBL1
32
33; 24 return 1;
34 mov eax,01h
[678]35 pop ebp
[635]36 ret
37 align 010h
38@BLBL1:
39
40; 25 if (s1.a != 2)
[678]41 cmp dword ptr [ebp+0ch],02h; s1
[635]42 je @BLBL2
43
44; 26 return 2;
[678]45 mov eax,02h
46 pop ebp
[635]47 ret
48 align 010h
49@BLBL2:
50
51; 27 if (s1.b != 3)
[678]52 cmp dword ptr [ebp+010h],03h; s1
[635]53 je @BLBL3
54
55; 28 return 3;
[678]56 mov eax,03h
57 pop ebp
[635]58 ret
59 align 010h
60@BLBL3:
61
62; 29 if (pv != (void*)4)
[678]63 cmp dword ptr [ebp+014h],04h; pv
[635]64 je @BLBL4
65
66; 30 return 4;
[678]67 mov eax,04h
68 pop ebp
[635]69 ret
70 align 010h
71@BLBL4:
72
[678]73; 31 if (rf1 != (float)1.5)
[635]74 fld dword ptr @CBE2
[678]75 fld dword ptr [ebp+018h]; rf1
[635]76 fucompp
77 fnstsw ax
78 and ax,04500h
79 cmp ax,04000h
80 je @BLBL5
81
82; 32 return 5;
[678]83 mov eax,05h
84 pop ebp
[635]85 ret
86 align 010h
87@BLBL5:
88
89; 33 if (s2.a != 6)
[678]90 cmp dword ptr [ebp+01ch],06h; s2
[635]91 je @BLBL6
92
93; 34 return 6;
[678]94 mov eax,06h
95 pop ebp
[635]96 ret
97 align 010h
98@BLBL6:
99
100; 35 if (s2.b != 7)
[678]101 cmp dword ptr [ebp+020h],07h; s2
102 je @BLBL7
103
[635]104; 36 return 7;
[678]105 mov eax,07h
106 pop ebp
[635]107 ret
[678]108 align 010h
109@BLBL7:
110
111; 37 return 0;
112 mov eax,0h
113 pop ebp
114 ret
[635]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.