https://github.com/ip1981/GCD/blob/mast
По системным вызовам Соляриса:
http://my.opera.com/myrkraverk/blog/201
Различия с линуксовой версией:
--- gcd-x86-linux.s 2011-07-04 00:33:43.000000000 +0400
+++ gcd-x86-solaris.s 2011-07-14 20:31:09.000000000 +0400
@@ -68,12 +68,15 @@
# printing the number:
mov $4, %eax # syscall `write'
- mov $1, %ebx # write to stdout
- mov %edi, %ecx # first character to write
mov $buf_end, %edx
sub %edi, %edx # edx is a number of characters to write (buf_end - edi)
inc %edx # + new line
- int $0x80 # do syscall (print the number)
+ push %edx
+ push %edi # first character to write
+ push $1 # write to stdout
+ push $0 # dummy
+ int $0x91 # do syscall (print the number)
+ add $16, %esp # clean stack 16 = 4 * 4 (32 bits!)
ret
@@ -133,6 +136,7 @@
exit:
mov $1, %eax # exit syscall
- xor %ebx, %ebx # exit code = 0
- int $0x80
+ push $0 # exit code = 0
+ push $0 # dummy
+ int $0x91