Last change
on this file since 2800 was 642, 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:
1015 bytes
|
Line | |
---|
1 | ; $Id: tst4asm.asm 642 2003-08-19 00:26:01Z bird $
|
---|
2 | ;
|
---|
3 | ; Optlink testcase no. 4.
|
---|
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 | .386
|
---|
15 |
|
---|
16 | CODE32 segment para use32 public 'CODE'
|
---|
17 |
|
---|
18 | ; 15 int __cdecl asmdefaultconvention(int i1, int i2, int i3)
|
---|
19 | public _asmdefaultconvention
|
---|
20 | _asmdefaultconvention proc
|
---|
21 | ;
|
---|
22 | ; If all registers match it's suspicious!
|
---|
23 | ;
|
---|
24 | cmp eax, 1
|
---|
25 | jne ok
|
---|
26 | cmp edx, 2
|
---|
27 | jne ok
|
---|
28 | cmp ecx, 3
|
---|
29 | jne ok
|
---|
30 | ; they all match fail.
|
---|
31 | mov eax, 4
|
---|
32 | ret
|
---|
33 |
|
---|
34 | ;
|
---|
35 | ; Verify the stuff on the stack.
|
---|
36 | ;
|
---|
37 | ok:
|
---|
38 | cmp dword ptr [esp+04h],01h; i1
|
---|
39 | je @BLBL1
|
---|
40 | mov eax,01h
|
---|
41 | ret
|
---|
42 |
|
---|
43 | @BLBL1:
|
---|
44 | cmp dword ptr [esp+08h],02h; i2
|
---|
45 | je @BLBL2
|
---|
46 | mov eax,02h
|
---|
47 | ret
|
---|
48 |
|
---|
49 | @BLBL2:
|
---|
50 | xor eax,eax
|
---|
51 | cmp dword ptr [esp+0ch],03h; i3
|
---|
52 | setne al
|
---|
53 | neg eax
|
---|
54 | and eax,03h
|
---|
55 | ret
|
---|
56 | _asmdefaultconvention endp
|
---|
57 |
|
---|
58 | CODE32 ends
|
---|
59 |
|
---|
60 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.