user2932450
user2932450

Reputation: 71

How to find the modulus of a function in assembly code for IJVM

I am learning assembly code and am trying to write a function for assembly code that finds the modulus of two numbers. The pseudocode for this problem would be just fine.

Upvotes: 0

Views: 274

Answers (1)

ooga
ooga

Reputation: 15501

You could try repeated subtraction.

modulus(a, b)
    while a >= b
        a -= b
    return a

Upvotes: 1

Related Questions