Integer division with MON166

If I do an integer division using the 167 CPU simulator it works fine. However, if I use my Kitcon-167 evaluation board and the MON166 monitor (simulated serial mode) with uVision2, I get the wrong result for the division. Stepping through the assembler code generated by the compiler it seems to go wrong when the code attempts to load the MDL register. The same code is fine when I step through it using the CPU simulator.

Can anyone offer any idea why this might be, and what I might be able to do to work around it?

Parents
  • I have done some more investigation of this. I have now found that the division works fine on the target CPU as well, providing I use either the BOOTSTRAP or ASC0 mode for the debugger. If I use Simulated Serial mode, the result of the division is incorrect.

    If anyone can offer any advice as to what is going on it would be greatly appreciated. I'm wondering if the Simulated Serial version of the monitor is upsetting the DPP registers or something like that?

Reply
  • I have done some more investigation of this. I have now found that the division works fine on the target CPU as well, providing I use either the BOOTSTRAP or ASC0 mode for the debugger. If I use Simulated Serial mode, the result of the division is incorrect.

    If anyone can offer any advice as to what is going on it would be greatly appreciated. I'm wondering if the Simulated Serial version of the monitor is upsetting the DPP registers or something like that?

Children
More questions in this forum