DIV - Divide the Accumulator by X Command

Divides the accumulator value by the X register and stores the dividend to the accumulator and the remainder to the X register.
All flags are cleared. Only obvious use for this message would be to ensure all flags are cleared.

Syntax

DIV
Notice that there is no value or location attached to this command. It simply divides the value in the accumulator by the value in the X register.

Example

{
LDA     #6    //Puts the fixed decimal value 6 into the Accumulator
LDX     #4    //Puts the fixed decimal value 4 into the X Register
DIV           //6/4=1 remainder 2. Accumulator now contains the value #1 and the X register contains the value #2
}