You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That is true, but you can write your own code using DIV and MUL to get around that. Suppose you need N%M
MOV A, N
MOV C, A
MOV B, M
DIV B
MUL B
SUB C, A
MOV A, C
The end result is A contains N%M. Although this uses both DIV and MUL once, its still better than repeated subtraction. In x86 assembly we have 64 bit EDX:EAX combined register for multiplication and division. In case of Division, EDX gets remainder and EAX gets quotient. But since here this has only 8 bit registers, we need to implement our own modulo operation.
There is no way to get the remainder of a division operation.
The text was updated successfully, but these errors were encountered: