The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: fygr on April 01, 2007, 09:38:32 AM

Title: Again anotherr..
Post by: fygr on April 01, 2007, 09:38:32 AM
Yep again another noobieous in here, I have used a MASM32 a (very)little and just found EasyCode and delighted on that a lot. But my problem is here, just palying a little for Console applikations (MASM32, Qedit..) and my source file in MASM looks like this:

ohjelma:

call alku:
exit

alku proc
 
  LOCAL str1:DWORD
  LOCAL str2:DWORD

  LOCAL rslt:DWORD

  LOCAL buffer1[32]:BYTE
  LOCAL buffer2[32]:BYTE

  mov str1, ptr$(buffer1)
  mov str2, ptr$(buffer2)

  cls

  loc 10,8
  mov str1, input("number 1: ")

  loc 10, 10
  mov str2, input("number 2: ")

  mov eax, uval(str1)
  mov esi, eax

  add esi, uval(str2)

  mov rslt, ustr$(esi)
  pop esi

  loc 10, 18
  print rslt

  ret

alku endp

end ohjelma


and this seems to work, then addition summ. But i need these chosen numbers to multiply together.

Trying to IMUL uval(str1), uval(str2)
and copy it EAX and only MUL to str1, also str2, and so on with a lot of errors now, how to get these two numbers and multiply the answer into string the same way??


ThnX...























Title: Re: Again anotherr..
Post by: dsouza123 on April 01, 2007, 03:35:08 PM

  mov eax, uval(str1)
  mov esi, eax

  add esi, uval(str2)

  mov rslt, ustr$(esi)


is changed to


  mov eax, uval(str1)
  mov esi, eax

  mov eax, uval(str2)
  mul esi

  mov rslt, ustr$(eax)