Posted By

gfazioli on 09/14/09


Tagged

Motorola 680x0 Amiga


Versions (?)

StringDecToValue


 / Published in: Assembler
 

URL: http://www.undolog.com

  1. ***************************************************************************************
  2. * (20-Feb-1995) --- value = StringDecToValue(buffer) (a0)
  3. ***************************************************************************************
  4. _LVOStringDecToValue
  5. movem.l d1-d7/a0-a2,-(sp)
  6. movem.w DecClearRegs(pc),d0-d7
  7. moveq #"0",d5 * fasting Code
  8. D2V_Skp cmp.b (a0),d5 * Check Jolly Char
  9. ble.s D2V_Con
  10. cmpi.b #"#",(a0)+ * Jolly...
  11. beq.s D2V_Skp
  12. cmpi.b #"+",-1(a0) * Pos
  13. beq.s D2V_Skp
  14. cmpi.b #"-",-1(a0) * NOT... provoca qualcosa...
  15. bne.s D2V_Skp
  16. moveq #1,d4 * Set Mark Negative
  17. bra.s D2V_Skp
  18. D2V_Con STRLEN a0,d3
  19. subq.w #1,d3 * for dbf operation...
  20. lea D2V_TableDec(pc),a2
  21. D2V_Lop move.b (a0,d3.w),d1
  22. sub.b d5,d1
  23. beq.s D2V_Nex
  24. subq.b #1,d1
  25. D2V_Squ add.l (a2),d2
  26. dbf d1,D2V_Squ
  27. add.l d2,d0
  28. moveq #0,d2
  29. moveq #0,d1
  30. D2V_Nex addq.w #4,a2
  31. dbf d3,D2V_Lop
  32. tst.l d4
  33. beq.s D2V_Ext
  34. neg.l d0
  35. D2V_Ext movem.l (sp)+,d1-d7/a0-a2
  36. rts
  37. DecClearRegs
  38. ds.w 8

Report this snippet  

You need to login to post a comment.