Posted By


gfazioli on 09/14/09

Tagged


Statistics


Viewed 189 times
Favorited by 0 user(s)

ValueToStringHex


/ Published in: Assembler
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ***************************************************************************************
  2. * (20-Feb-1995) --- ValueToStringHex(buffer, value, optlen, prefix) (a0,d0,d1,d2)
  3. ***************************************************************************************
  4. _LVOValueToStringHex
  5. movem.l d2-d7/a0,-(sp)
  6. tst.l d1
  7. bne.s ConvHex_Default
  8. moveq #8,d1
  9. ConvHex_Default
  10. moveq #$f,d5
  11. moveq #48,d6
  12. moveq #58,d7
  13. cmpi.l #8,d1
  14. bhi.s ConvHex_Exit
  15. move.l d1,d3
  16. rol.w #2,d3
  17. ror.l d3,d0
  18. subq.l #1,d1
  19. tst.l d2
  20. beq.s ConvHex_Next
  21. move.b #"$",(a0)+
  22. ConvHex_Next
  23. rol.l #4,d0
  24. move.l d0,d3
  25. and.b d5,d3
  26. add.b d6,d3
  27. cmp.b d7,d3
  28. bcs.s ConvHex_Out
  29. addq.b #7,d3
  30. ConvHex_Out
  31. move.b d3,(a0)+
  32. dbf d1,ConvHex_Next
  33. ConvHex_Exit
  34. movem.l (sp)+,d2-d7/a0
  35. rts

URL: http://www.undolog.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.