square-x86.S 573 B

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