title: Multiply 2 Values in Assembly Language 8086?
body: <p>I am multiplying two values input from console window. I am using <strong>32 bit registers eax, ebx</strong>, but it is not multiplying the values. The program is running, but it is not multiplying. Can anyone detect the problem?  What is wrong in this code? I am using KIP.R.IRVINE Link Libraries in assembly language.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>  INCLUDE Irvine32.inc
  
    .data
  
     inputValue1st BYTE "Input the 1st integer = ",0
     inputValue2nd BYTE "Input the 2nd integer = ",0
     outputSumMsg BYTE "The sum of the two integers is = ",0
  
     num1 DD ?
     num2 DD ?
     sum  DD ?
  
  
    .code
  
    main PROC
  
     ; here we are calling our Procedures
  
    call InputValues
    call multiplyValue
    call outputValue
    call Crlf
  
    exit
    main ENDP
  
  
  
  InputValues PROC
  
  ;----------- For 1st Value--------
  ; input message
  
  call Crlf
  mov edx,OFFSET inputValue1st
  call WriteString
  
  
  call ReadInt    ; read integer
  mov num1, eax   ; store the value
  
  
   ;-----------For 2nd Value----------
  
   ; output the prompt message
   mov edx,OFFSET inputValue2nd
   call WriteString
  
  
    call ReadInt  ; read integer
    mov num2, ebx     ; store the value
  
    ret
    InputValues ENDP
  
  
  
     ;---------multiply----------------
  
     multiplyValue PROC
     ; compute the sum
  
      mov eax, num1   ; moves num1 to eax
      mov ebx, num2   ; moves num2 to ebx
  
      mul ebx  ; num1 * num2 = 6 * 2
      mov sum, eax  ; the val is stored in ebx
  
  
      ret
      multiplyValue ENDP
  
  
      ;--------For Sum Output Result----------
  
      outputValue PROC
  
  
      ; output result
      mov edx, OFFSET outputSumMsg
      call WriteString
  
  
      mov eax, sum
      call WriteInt ; prints the value in eax
      ret
      outputValue ENDP
  
  
      End main
  </code></pre>
  
  <p>One more question: Do I need to use a carry flag in it?  If so, then what would the code for it look like?</p>