Posted By

gfazioli on 09/14/09


Tagged

Motorola 680x0 Amiga


Versions (?)

StringBinToValue


 / Published in: Assembler
 

URL: http://www.undolog.com

  1. ***************************************************************************************
  2. * (20-Feb-1995) --- value = StringBinToValue(string, optlen) (a0/d0)
  3. ***************************************************************************************
  4. _LVOStringBinToValue
  5. movem.l d1-d3/a0,-(sp)
  6. moveq #0,d2 * Mark Negative
  7. moveq #"0",d3 * Type Of Chars
  8. B2V_Skp cmp.b (a0),d3 * Check Jolly Char
  9. ble.s B2V_Con
  10. cmpi.b #"%",(a0)+ * Jolly...
  11. beq.s B2V_Skp
  12. cmpi.b #"+",-1(a0) * Pos
  13. beq.s B2V_Skp
  14. cmpi.b #"-",-1(a0) * NOT... provoca qualcosa...
  15. bne.s B2V_Skp
  16. moveq #1,d2 * Set Mark Negative
  17. bra.s B2V_Skp
  18. B2V_Con move.w d0,d1 * Introdotta lunghezza forzata?
  19. bne.s B2V_Chk * Si... considera questa...
  20. STRLEN a0,d1 * Tutta la stringa
  21. B2V_Chk moveq #0,d0
  22. subq.w #1,d1
  23. bmi.s B2V_Ext
  24. B2V_SBt cmp.b (a0)+,d3
  25. beq.s B2V_Lp
  26. bset d1,d0
  27. B2V_Lp dbf d1,B2V_SBt
  28. tst.w d2
  29. beq.s B2V_Ext
  30. not.l d0
  31. B2V_Ext movem.l (sp)+,d1-d3/a0
  32. rts

Report this snippet  

You need to login to post a comment.