home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / cdfm.zip / STRHTN.RT < prev    next >
Text File  |  1992-08-02  |  607b  |  30 lines

  1. public  _strhtn
  2. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  3. ; Get number from mem
  4. ; In:
  5. ;   EDX -> ASCIIZ hex number string
  6. ; Out:
  7. ;   EAX - number
  8. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  9. _strhtn:
  10.         push bx
  11.         push edx
  12.         xor eax,eax
  13. strhtnml:
  14.         mov bl,[edx]
  15.         inc edx
  16.     sub bl,'0'
  17.     jc short strhtnmld
  18.         cmp bl,0ah
  19.     jb short strhtnmlc
  20.     sub bl,('A'-'0')-10
  21. strhtnmlc:
  22.         shl eax,4
  23.         or al,bl
  24.     jmp strhtnml
  25. strhtnmld:
  26.         pop edx
  27.         pop bx
  28.         ret
  29.  
  30.