Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .586
- .MODEL FLAT, C
- .DATA
- oper DB 0 ;Set to 0 if multiplication, 1 if division
- a DWORD 25
- b DWORD 5
- .CODE
- MULTIPLY PROC
- mov ebx, 1 ;Move 0 to EBX register for counter
- mov eax, a
- cmp oper, 0
- je multi
- jmp divi
- multi:
- add eax, a
- inc ebx
- cmp ebx, b
- jl multi
- jmp endSect
- divi:
- sub eax, b
- inc ebx
- cmp eax, 1
- jg divi
- mov eax, ebx
- dec eax
- jmp endSect
- endSect:
- mov eax, eax
- MULTIPLY ENDP
- END
Advertisement
Add Comment
Please, Sign In to add comment