Search code examples
assemblytaocp

How does division work in MIXAL assembly?


I am trying to perform a simple integer division (9/2=?) but MIX builder throws Integer overflow error. Am I doing something wrong? Here is the code:

ORIG    1000
START   NOP
A   CON 0
B   CON 0
ENTA    2
STA A
ENTX    9
DIV A
STA A
HLT
END START

Solution

  • The solution was to add ENTA 0 (set register rA = 0) before DIV A. I really don't know the reason why you have to reset the register where the quotient is saved...