Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data
- .global a
- .global b
- .global c
- .global d
- .global res
- .section .text
- .global operation
- operation:
- # prologue
- pushl %ebp # save previous stack frame pointer
- movl %esp, %ebp # the stack frame pointer for sum function
- #operation
- movl $0, %ebx
- movb a, %al
- movw b, %bx
- movl c, %ecx
- movl d, %edx
- addw %ax, %bx
- subl %ecx, %ebx
- movl %ebx,%eax
- addl %edx, %eax
- movl $0, %edx
- movl %eax, res # copy the result to res
- # epilogue
- movl %ebp, %esp # restore the previous stack pointer ("clear" the stack)
- popl %ebp # restore the previous stack frame pointer
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement