Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Bugs and Fixes

logical error 'imul'

A community discussion post from the original code:zIRON forum.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

logical error 'imul'

this code must print this result

1 255
program WIN32CUI 'test';

#include 'console.zir';
#include 'zirutils.zir';

dword indx;
char tmp[255];

   indx = 1;

   eax = indx
   imul  eax,255
   IntToStr(indx,@tmp);
   print(@tmp,'\r\n');
   IntToStr(eax,@tmp);
   print(@tmp,'\r\n');  
   
wait_key(nil);
ExitProcess(0);               

but it prints that

1 12593

http://www.freewebs.com/ogremagic/index.htm

Replies

Colin admin
Posts
928
Threads
49
Location
Bulgaria

eax has been changed by "print"

I also think you require imul in the opposite direction ;)

I need to go out right now, but i will be back and can add the opposite, ie..

imul value, reg