title: Not loading the correct value from memory onto a register in 8086 assembly
body: <p>I am very new to 8086 assembly to please excuse the sloppy code and possibly unnecessary lines, I'm self taught. This code is a fragment of another program I'm making, which requires user input in numbers. These specific lines take the input, then produces a number the computer can actually work with. For example, taking 5, 4, and 3 and "compiling" the numbers into 543. </p>
  
  <p>The problem comes up in line 59, where I try to load back a number from memory to register bx, in which case, instead of loading the correct number, like 40 (from the 543 ex.) it just loads a 1. </p>
  
  <p>Some code after line 59 might not even work, because I got stuck there.</p>
  
  <p>I'm probably not using the correct registers, but again, I'm self taught and its hard finding easy to understand information about the syntax online.    </p>
  
  <pre><code>org  100h
  
  mov si, 100d
  
  input1:
      mov ah, 1h      ;input char
      int 21h
      push ax
      sub al, 30h     ;convert ascii to integer
      mov dl, al      ;put char into dl to be read
      mov [si], al    ;save char to ram for later
      mov ah, 2h      ;output char
      inc si          ;to save on next location in mem 
      pop ax
      cmp al, 13      ;check if done
      jne input1
  
      dec si              ;insert terination char 
      dec si              ;decrement to save value of si for multilying by ten
      push si             ;save current si value
      inc si              ;then continue
      mov al, 24h
      mov [si], al
  
      pop si
      mov cx, 1
  
      compileNum1:
          mov ax, 0
          mov bx, 0
          mov dx, 0    
      .fixNum:
          mov al, [si]   ; load last num into ax to be multiplied by 10
          mul cx
          mov bp, ax
          mov [si], bp
          dec si
          mov al, 10
          mov bx, cx
          mul bl
          mov cx, ax           
          cmp si, 99d
          jne .fixNum
  
      mov si, 100d       ;starts number addition
  
      mov ax, [si]       ;loads first number
      inc si             ;prepares second
      mov bx, [si]       ;loads second
  
      cmp bx, 24h        ;checks if there was only 1 number
      je .terminate1     ;if there was, goto terminate
  
      add ax, bx         ;else add them together
  
      .stloop1:
          inc si         ;prepares for third, fourth etc
          mov bx, [si]   ;loads it
  
          cmp bx, 24h    ;checks if numbver is 3 digts ot more long (depends on loop)
          je .terminate1 ;terminate if so
  
          add ax, bx     ;add them together, store in ax
  
      .terminate1:
          mov [100d], ax
  
  
  
  
  
  mov ax, 0   ;clear screen
  int 10h 
  
  
  mov ah, 2h  ;print char
  int 21h
  
  mov ah, 0   
  int 16h
  ret
  </code></pre>
  
  <p>Thanks for the help!</p>