View Single Post
Old 01 June 2019, 13:44   #3
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,538
Quote:
Originally Posted by Bruce Abbott View Post
There's a bug, but it's in your code. In the 'write' callback you should save and restore D2 and D3.
Indeed! That's my fault. Thanks. So RawDoFmt() is fine.

Quote:
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
That was intended. I was pushing D0 onto the stack not to save it, but to make room for the character on the stack. Writing it with "move.b d0,-(sp)" is also a nice solution, though.

Quote:
Still got the wrong hex result though... must investigate further!
Yes. It has definitely nothing to do with RawDoFmt. I spotted the problem in a different context and wrote this code for better reproduction.
phx is offline  
 
Page generated in 0.04182 seconds with 11 queries