Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TITLE Add and Subtract (AddSub.asm)
- ; This program adds and subtracts 32-bit integers.
- ; Last update: 2/1/02
- INCLUDE Irvine32.inc
- .data
- ansSI DWORD 0
- X SDWORD 0
- Y SDWORD 0
- Z SDWORD 0
- ;(X-300) % Y * Z - 1
- .code
- main PROC
- ;mov X, 12
- ;mov Z, 9
- ;mov Y, 5
- mov X, 10
- mov Z, 11
- mov Y, 12
- mov eax, X
- sub eax, 300
- neg eax
- cdq
- idiv Y
- mov eax, edx
- imul Z
- sub eax, 1
- mov ansSI, eax
- Call WriteInt
- exit
- main ENDP
- END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement