thats not hard to translate at all at least in x86 at&t system v syntax. i suggest throwing that function into a .c file and compile it with gcc with the -g flag on a linux machine followed by a objdump -d. that way you can see the system v syntax and you can kind of follow along.
all its doing is passing 2 memory addresses (not the pointer to the actual variable) to the function and then adding +8 to esp to store 2 local variables. everything after that i just a bunch of cmp statements and jumps to labels. its pretty straight forward.
the first couple of lines should look something like this in system v.
Code
.function
do_add:
addl 8, %esp
xorl 4(%esp), 4(%esp)
xorl 8(%esp), 8(%esp) #create 2 local variables in our function and zero them out (set them as false (0))
first_if:
cmpl -4(%esp), 4(%esp)
jne second_if
movl $1, 4(%esp) #set sign1 to true
and -4(esp), 4(%esp)
second_if:
xxxxxxxx
something like that. not totally correct but you should get the jist of it.
also i suggest using #define statements to define names for your variables. will help aid you in creating asm code that looks more like the C code.
aka
Code
#define sign1 -4(%esp)
now you can use sign1 anywhere you would want to use that variable.
This post was edited by AbDuCt on Dec 5 2012 10:33am