|
Last change
on this file since 635 was 634, checked in by bird, 22 years ago |
|
expanded 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:
2.0 KB
|
| Line | |
|---|
| 1 | ; $Id: tst1asm.asm 634 2003-08-17 18:47:16Z bird $
|
|---|
| 2 | ;
|
|---|
| 3 | ; Optlink testcase no. 1.
|
|---|
| 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 |
|
|---|
| 17 | CODE32 segment para use32 public 'CODE'
|
|---|
| 18 | CODE32 ends
|
|---|
| 19 | CONST32_RO segment para use32 public 'CONST'
|
|---|
| 20 | CONST32_RO ends
|
|---|
| 21 |
|
|---|
| 22 | CONST32_RO segment
|
|---|
| 23 | @CBE1 dq 3ff199999999999ar ; 1.1000000000000000e+00
|
|---|
| 24 | @CBE2 dq 3ff3333333333333r ; 1.2000000000000000e+00
|
|---|
| 25 | @CBE3 dq 3ff4cccccccccccdr ; 1.3000000000000000e+00
|
|---|
| 26 | @CBE4 dq 3ff6666666666666r ; 1.4000000000000000e+00
|
|---|
| 27 | CONST32_RO ends
|
|---|
| 28 | CODE32 segment
|
|---|
| 29 | ASSUME ds:FLAT, es:FLAT, ss:FLAT
|
|---|
| 30 |
|
|---|
| 31 | ; 2 extern int _Optlink foo (int i1, int i2, int i3, float rf1, float rf2, float rf3, float rf4)
|
|---|
| 32 | align 010h
|
|---|
| 33 |
|
|---|
| 34 | public asmfoo
|
|---|
| 35 | asmfoo proc
|
|---|
| 36 |
|
|---|
| 37 | ; 4 if (i1 != 1)
|
|---|
| 38 | cmp eax,01h
|
|---|
| 39 | je @BLBL1
|
|---|
| 40 | fstp st(0)
|
|---|
| 41 | fstp st(0)
|
|---|
| 42 | fstp st(0)
|
|---|
| 43 | fstp st(0)
|
|---|
| 44 |
|
|---|
| 45 | ; 5 return 1;
|
|---|
| 46 | mov eax,01h
|
|---|
| 47 | ret
|
|---|
| 48 | align 010h
|
|---|
| 49 | @BLBL1:
|
|---|
| 50 |
|
|---|
| 51 | ; 6 if (i2 != 2)
|
|---|
| 52 | cmp edx,02h
|
|---|
| 53 | je @BLBL2
|
|---|
| 54 | fstp st(0)
|
|---|
| 55 | fstp st(0)
|
|---|
| 56 | fstp st(0)
|
|---|
| 57 | fstp st(0)
|
|---|
| 58 |
|
|---|
| 59 | ; 7 return 2;
|
|---|
| 60 | inc eax
|
|---|
| 61 | ret
|
|---|
| 62 | align 010h
|
|---|
| 63 | @BLBL2:
|
|---|
| 64 |
|
|---|
| 65 | ; 8 if (i3 != 3)
|
|---|
| 66 | cmp ecx,03h
|
|---|
| 67 | je @BLBL3
|
|---|
| 68 | fstp st(0)
|
|---|
| 69 | fstp st(0)
|
|---|
| 70 | fstp st(0)
|
|---|
| 71 | fstp st(0)
|
|---|
| 72 |
|
|---|
| 73 | ; 9 return 3;
|
|---|
| 74 | lea eax,[eax+02h]
|
|---|
| 75 | ret
|
|---|
| 76 | align 010h
|
|---|
| 77 | @BLBL3:
|
|---|
| 78 |
|
|---|
| 79 | ; 10 if (rf1 != 1.1)
|
|---|
| 80 | fld qword ptr @CBE1
|
|---|
| 81 | fucompp
|
|---|
| 82 | fnstsw ax
|
|---|
| 83 | and ax,04500h
|
|---|
| 84 | cmp ax,04000h
|
|---|
| 85 | je @BLBL4
|
|---|
| 86 | fstp st(0)
|
|---|
| 87 | fstp st(0)
|
|---|
| 88 | fstp st(0)
|
|---|
| 89 |
|
|---|
| 90 | ; 11 return 4;
|
|---|
| 91 | lea eax,[ecx+01h]
|
|---|
| 92 | ret
|
|---|
| 93 | align 010h
|
|---|
| 94 | @BLBL4:
|
|---|
| 95 |
|
|---|
| 96 | ; 12 if (rf2 != 1.2)
|
|---|
| 97 | fld qword ptr @CBE2
|
|---|
| 98 | fucompp
|
|---|
| 99 | fnstsw ax
|
|---|
| 100 | and ax,04500h
|
|---|
| 101 | cmp ax,04000h
|
|---|
| 102 | je @BLBL5
|
|---|
| 103 | fstp st(0)
|
|---|
| 104 | fstp st(0)
|
|---|
| 105 |
|
|---|
| 106 | ; 13 return 5;
|
|---|
| 107 | lea eax,[ecx+02h]
|
|---|
| 108 | ret
|
|---|
| 109 | align 010h
|
|---|
| 110 | @BLBL5:
|
|---|
| 111 |
|
|---|
| 112 | ; 14 if (rf3 != 1.3)
|
|---|
| 113 | fld qword ptr @CBE3
|
|---|
| 114 | fucompp
|
|---|
| 115 | fnstsw ax
|
|---|
| 116 | and ax,04500h
|
|---|
| 117 | cmp ax,04000h
|
|---|
| 118 | je @BLBL6
|
|---|
| 119 | fstp st(0)
|
|---|
| 120 |
|
|---|
| 121 | ; 15 return 6;
|
|---|
| 122 | lea eax,[ecx+03h]
|
|---|
| 123 | ret
|
|---|
| 124 | align 010h
|
|---|
| 125 | @BLBL6:
|
|---|
| 126 |
|
|---|
| 127 | ; 16 if (rf4 != 1.4)
|
|---|
| 128 | ; 17 return 7;
|
|---|
| 129 | fld qword ptr @CBE4
|
|---|
| 130 | fucompp
|
|---|
| 131 | fnstsw ax
|
|---|
| 132 | and ax,04500h
|
|---|
| 133 | cmp ax,04000h
|
|---|
| 134 | setne al
|
|---|
| 135 | and eax,01h
|
|---|
| 136 | neg eax
|
|---|
| 137 | and eax,07h
|
|---|
| 138 | ret
|
|---|
| 139 | asmfoo endp
|
|---|
| 140 | CODE32 ends
|
|---|
| 141 |
|
|---|
| 142 | end
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.