View Single Post
Old 01 June 2019, 06:00   #2
Bruce Abbott
Registered User

Bruce Abbott's Avatar
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 292
Originally Posted by phx View Post
Bonus bug:
I was suprised that 1.3 first prints 3FD1DDFF with a blank, then waits for 30 seconds(!), prints D0000000 and waits for another 30 seconds! I didn't remember that RawDoFmt() was also that bugged...
There's a bug, but it's in your code. In the 'write' callback you should save and restore D2 and D3. Also copying the byte in D0 directly to the top of stack isn't a good idea because it splats over the current contents. In your code this is the (long) saved contents of D0, which luckily doesn't matter because D0 doesn't need to be preserved.

I changed your code to this:-

        movem.l d2-d3/a6,-(sp)
        movem.l (a3),d1/a6
        move.b  d0,-(sp)
        move.l  sp,d2
        moveq   #1,d3
        jsr     -48(a6)                 ; Write next character to stdout
        move.b  (sp)+,d0
        movem.l (sp)+,d2-d3/a6
and it printed properly in WB1.3 on my A500 (previously it would print a 'random' character several thousand times before doing the second number).

Still got the wrong hex result though... must investigate further!
Bruce Abbott is offline  
Page generated in 0.04403 seconds with 11 queries