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

Last change on this file since 654 was 635, checked in by bird, 22 years ago

Initial coding.

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