How can you find modulus of a integer number?
Printable View
How can you find modulus of a integer number?
In VB is Mod
=========
A = B Mod 2
In C++, is %
=========
A = B % 2
A and B are integers.
Yes but how do you do this i assembly?
mov ax, number
cwd ; sign extend ax into dx:ax
div word [divisor] ; divide dx:ax by divisor
; ax = result
; dx = modulus
if you need to care for sign extending (i.e. you handle signed integers) you should use IDIV