|
-
Oct 13th, 2001, 10:33 AM
#1
Thread Starter
Junior Member
Modulus
How can you find modulus of a integer number?
-
Oct 14th, 2001, 04:53 AM
#2
Hyperactive Member
In VB is Mod
=========
A = B Mod 2
In C++, is %
=========
A = B % 2
A and B are integers.
-
Oct 14th, 2001, 06:56 AM
#3
Thread Starter
Junior Member
Yes but how do you do this i assembly?
-
Oct 15th, 2001, 02:19 AM
#4
Junior Member
mov ax, number
cwd ; sign extend ax into dx:ax
div word [divisor] ; divide dx:ax by divisor
; ax = result
; dx = modulus
-
Dec 2nd, 2001, 04:12 PM
#5
if you need to care for sign extending (i.e. you handle signed integers) you should use IDIV
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|