1 # many thanks to David Fang
2 # for providing an OSX 10.5 machine to test on
4 # count for 1 million instructions
5 # total is 1 + 1 + 499997*2 + 4
9 xor %ecx,%ecx # not needed, pads total to 1M
10 mov $499997,%ecx # load counter
12 dec %ecx # repeat count times
15 #================================
17 #================================
19 # syscall numbers in /usr/include/sys/syscall.h on OSX
20 # in arc/x86/include/asm/unistd_32.h on Linux
21 # disassemble on OSX otool -tV
24 inc %eax # put exit syscall number (1) in eax
25 #if defined(VGO_darwin) || defined(VGO_freebsd)
26 pushl $0 # we return 0
28 #elif defined(VGO_linux)
29 xor %ebx,%ebx # we return 0
31 #elif defined(VGO_solaris)
32 pushl $0 # we return 0
34 #elif defined(VGO_freebsd)
35 mov $0x1,%eax # we return 0