;To use the following proc to convert a tring to int
; do this:
;   1. Move the string to the var result1 ( result1       db  '$$$$$$')
;   2. Define a variable:                   vardec        dw   10
;   2. Issue the following commands
;
;             mov  di,offset result1
;             call strnumber             ;dx gets the number 
;
;  The resulting int will be in dx
;-----------------------------------------------------------------------
proc          strnumber
;count how many digits we have
              xor  ax,ax
              xor  bx,bx
              push di
countloop:     
              mov  bl,[di]
              cmp  bl,'$'
              je   updatesize
              inc  al
              inc  di
              jmp  countloop
updatesize:
              pop  di
              mov  [size1],al
              xor  cx,cx
              mov  cl,[size1]
              mov  bx,1
              xor  dx,dx
              xor  ax,ax
              add  di,cx
              sub  di,1
loop1:              
              mov  al,[di] 
              mov  ah,0
              sub  al,30h
              push dx 
              mul  bx
              pop  dx 
              add  dx,ax
              mov  ax,bx
              push dx
              mul  [vardec]
              pop  dx 
              mov  bx,ax
              dec  di
              loop loop1 
              ret
endp          strnumber              
;-----------------------------------------------------------------------------------------------------