Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TITLE Lab 3 (AddSub.asm)
- ; This program blahs
- ; Name:Amanda Clark
- ; Date: Oct 13 2011
- INCLUDE Irvine32.inc
- .const
- .data
- str1 BYTE "Enter a dividend ", 0Dh,0Ah,0
- str2 BYTE "enter a divisor: ",0
- str3 BYTE "Ends program"
- .code
- main PROC
- mov edx, OFFSET str1 ; edx gets address of str1
- call WriteString ; prints prompt to enter dividend
- call ReadInt ; reads int from library
- mov ecx, eax ; stores dividend in ecx
- mov edx, OFFSET str2 ; edx gets address of str2
- call WriteString ; prints prompt to enter divisor
- call ReadInt ; divisor is in eax
- mov ebp,0
- beginwhile:
- sub ecx,eax
- inc ebp
- mov esi, 0
- cmp esi, ecx
- jae endwhile
- jmp beginwhile
- endwhile:
- add ecx, eax
- dec ebp
- call DumpRegs
- exit
- main ENDP
- END main
Add Comment
Please, Sign In to add comment