Can someone give me an idea as to why I would use a modulo instruction. I asked our senior Engineer, but left more confused, than before I asked him. TIA.

Hey Mike,

Itâ€™s not a commonly used instruction, that being said it stems from a simple mathematical calculation that you will find in almost every calculator.

Image a production line that packs 8 bottles into 1 box and 36 boxes into one pallet. At the end of the shift, the team has produced 20 pallets. However, the â€ścase packerâ€ť made 750 boxes and the â€śbottlerâ€ť made 6010 bottle. What happened?

750 MOD[36] = 30 cases were left over.

6010 MOD [8] = 2 bottles were left over.

Itâ€™s just an example of how these operators could be usedâ€¦

Hope that helps,

Vlad

1 Like