> investigate when I get home to my TINI tonight. A dumb question: do
> you get the same result if you remove the code to generate and print n
> / 10?
Yes it does, that's when I noticed it. I just tried to isolate the problem
using the div and mod variables.
> One odd thing: the Dallas "High-Speed Micro" data sheet describes the
> "div ab" opcode as: (A 15-8),(A 7-0) = A / B. This is clearly
> nonsense (the A register has only 8 bits), and I can't imagine that
> Dallas broke 8051 compatability by not placing the remainder in B,
> but I'll see if I can get a straight answer.
That was the first thing I looked at too because I used the same method,
with success, in the past with 80c535. I didn't wanted to say out loud what
you just said, but had my suspicions, that's the "ds390 related?", knowing
that the generated code lookes ok, that's the "bug (?)".
Did some further tests, but got even more suspicious, please let me know.