News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

MUL

Started by imadhx30, January 01, 2014, 06:37:50 AM

Previous topic - Next topic

imadhx30

MOV eax,21374253
MOV ebx,13628914
MUL ebx

edx:eax=21374253*13628914

how to view full results in masm32!!!!!!!!!

MichaelW


include \masm32\include\masm32rt.inc
.code
start:
    mov eax,3
    mov ebx,4
    mul ebx
    printf("%I64d\n",edx::eax)
    mov eax,21374253
    mov ebx,13628914
    mul ebx
    printf("%I64d\n\n",edx::eax)
    inkey
    exit
end start


12
291307855951242
Well Microsoft, here's another nice mess you've gotten us into.

imadhx30

for the division!! tanks  :t

dedndave

MOV eax,21374253
MOV ebx,13628914
MUL ebx

push  edx
push  eax
push  eax
print uhex$(edx)
pop   eax
print uhex$(eax),13,10
pop   eax
pop   edx


for DIV

xor   edx,edx
mov   eax,0FFFFFFFFh
mov   ecx,10000h
div   ecx

push  ecx
push  edx
push  eax
push  ecx
push  edx
print uhex$(eax),'+'
pop   edx
print uhex$(edx),'/'
pop   ecx
print uhex$(ecx),13,10
pop   eax
pop   edx
pop   ecx

jj2007

One more ;)

include \masm32\MasmBasic\MasmBasic.inc        ; download
MyQ        QWORD 123456789123456789
  Init
  mov eax, 123456789
  mov ebx, 1000000001
  Print Str$("eax*ebx=\t%u\n", eax*ebx)
  Inkey Str$("MyQ/ebx=\t%u", MyQ/ebx)
  Exit
end start


Output:
eax*ebx=        123456789123456789
MyQ/ebx=        123456789