Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .att_syntax noprefix
- .text
- .global main
- main:
- call readi32
- jc out
- mov eax, edx
- add edx, NumberSum
- jno main
- mov NumberSum, eax
- mov $1073741824, edx // mask to detect first bit
- and NumberSum, edx
- sar $30, edx
- mov edx, ebx
- xor $1, ebx
- mov edx, eax
- mov $2147483647, ecx
- imul ecx
- mov eax, IntHighOverflow
- mov ebx, eax
- mov $-2147483648, ecx
- imul ecx
- mov eax, IntLowOverflow
- xor eax, eax
- add IntHighOverflow, eax
- add IntLowOverflow, eax
- call writei32
- call nl
- call finish
- out:
- mov NumberSum, eax
- call writei32
- call nl
- call finish
- .data
- NumberSum:
- .int 0
- IntLowOverflow:
- .int 0
- IntHighOverflow:
- .int 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement