title: Assembly 8086. Read from the standard input several numbers, in base 2. Print on the screen these numbers in base 10
body: <p>So, i have to convert the numbers from base two in base 10, and i have no idea how to do it.This is how my program looks for now, but I am not sure if what I got until now works properly. The conversion part is really giving me a hard time, but for sure I have lots of mistakes in my code, so any help would be greatly appreciated. </p>
  
  <pre><code>   assume cs:code, ds:data
  
  data segment
  msg db 'Give numbers:$'
  numbers LABEL BYTE
      max_size DB 100
      numbers_len DB ?
      number DB 100 dup (?)
  ten db 10
  errm db 'Numbers not in binary.$'
  data ends
  code segment
  start:
  
  mov ax,data
  mov ds,ax
  
  mov ah,09h
  mov dx,offset msg
  int 21h
  
  mov AH,0Ah
  mov DX,offset numbers
  int 21h
  
  mov CL,numbers_len
  mov CH,0
  mov SI,0    
  repeat:
      mov AL,number[SI]
      cmp AL,' '
      je conversion
  
      check:
      cmp AL,'0'
      jb erro
      cmp AL,'1'
      ja erro
  
      jmp conversion
      continue:
      inc SI
      dec cx
      jcxz print 
      jmp repeat
  
  
  conversion:
  
      jmp continue
  
  print:
      pop dx
      add dl,'0'
      mov ah,02h
      int 21h
      loop print  
  erro:
      mov ah,09h
      mov dx,offset errm
      int 21h
  
  mov ax,4c00h
  int 21h
  
  code ends
  end start
  </code></pre>