Posted By


gfazioli on 09/14/09

Tagged


Statistics


Viewed 185 times
Favorited by 0 user(s)

StringHexToValue


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



Copy this code and paste it in your HTML
  1. ***************************************************************************************
  2. * (20-Feb-1995) --- value = StringHexToValue(string) (a0)
  3. ***************************************************************************************
  4. _LVOStringHexToValue
  5. movem.l d1-d7/a0-a2,-(sp)
  6. movem.w DecClearRegs(pc),d0-d7
  7. suba.l a2,a2 * Marking Neg Number
  8. moveq #5,d4 * Fast CODE
  9. moveq #"a",d5 * Fast CODE
  10. moveq #"0",d6 * Fast CODE
  11. moveq #$57,d7 * Fast CODE
  12. H2V_Skp cmp.b (a0),d6 * Check Jolly Char
  13. ble.s H2V_Con
  14. cmpi.b #"$",(a0)+ * Jolly...
  15. beq.s H2V_Skp
  16. cmpi.b #"+",-1(a0) * Pos
  17. beq.s H2V_Skp
  18. cmpi.b #"-",-1(a0) * NOT... provoca qualcosa...
  19. bne.s H2V_Skp
  20. addq.w #1,a2 * Set Mark Negative
  21. bra.s H2V_Skp
  22. H2V_Con STRLEN a0,d1
  23. subq.w #1,d1
  24. H2V_Lop move.b (a0,d1.w),d2
  25. bset d4,d2 * bit 5 UP sDn,sDn for Fast
  26. cmp.b d5,d2 * "A" sDn,sDn for Fast
  27. bge.s H2V_Wrd
  28. sub.b d6,d2 * "0" sDn,sDn for fast
  29. bra.s H2V_Put
  30. H2V_Wrd sub.b d7,d2 * #$57 sDn,sDn for fast
  31. H2V_Put rol.l d3,d2
  32. or.l d2,d0
  33. addq.b #4,d3 * Ok 4 cicli di clock only QUICK
  34. moveq #0,d2
  35. dbf d1,H2V_Lop
  36. move.w a2,d1
  37. beq.s H2V_Ext
  38. neg.l d0
  39. H2V_Ext movem.l (sp)+,d1-d7/a0-a2
  40. rts

URL: http://www.undolog.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.