| 1 |
#include "symbol-underscore.h" |
| 2 |
|
| 3 |
/* This sadly doesn't test the symbol underscore stuff. I can't figure out how |
| 4 |
* to not use an automatic stdcall mechanism and do everything manually. */ |
| 5 |
#ifdef _MSC_VER |
| 6 |
|
| 7 |
.386 |
| 8 |
.MODEL FLAT, C |
| 9 |
|
| 10 |
PUBLIC square_unsigned |
| 11 |
_TEXT SEGMENT |
| 12 |
|
| 13 |
square_unsigned PROC var1:DWORD |
| 14 |
mov eax, var1 |
| 15 |
imul eax, eax |
| 16 |
ret |
| 17 |
|
| 18 |
square_unsigned ENDP |
| 19 |
|
| 20 |
_TEXT ENDS |
| 21 |
END |
| 22 |
|
| 23 |
#else |
| 24 |
|
| 25 |
.text |
| 26 |
.globl SYMBOL_NAME(square_unsigned) |
| 27 |
# ifdef __linux__ |
| 28 |
.type square_unsigned, %function |
| 29 |
#endif |
| 30 |
|
| 31 |
SYMBOL_NAME(square_unsigned): |
| 32 |
movl 4(%esp), %eax |
| 33 |
imull %eax, %eax |
| 34 |
retl |
| 35 |
|
| 36 |
#endif |