Register | Login
Forum Index > Source Help > arithmetic expression
Author Message
Pages: 1 2 3
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[701] - posted: 2011-11-15 21:01:17
Code:
finit;

char right[5000];
dword indx;
dword addr;

indx = 5;

eax = @right;
push eax
fild [esp]
pop eax
fild indx
fpush 255
fmulp;
faddp;
fistp addr;


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[702] - posted: 2011-11-15 21:08:50
also i would suggest 5000 = 5100, 20x 255's

once i finish the mul opcodes and other int math opcodes, it will be better smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[703] - posted: 2011-11-15 21:09:42

ok , thank you for your suggestion

but i did not like using fpu in integer expression

the other solution is , you can tell me the machine code of imul eax,255 ,so that i can emit it inside my code.


http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[704] - posted: 2011-11-15 21:16:17
this is what i get from sphinx C-- , so is it wright
Code:
6669C0FF000000           imul    eax,0FFh


if so how code i emit that , i mean the byte order ?

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[705] - posted: 2011-11-15 23:16:18
hmm that does not look correct

0x66 first byte would mean it is in 16bit... anyways here is what you need:

Code:
emit byte 0x6B,0xC0,0xFF;


i guess that should work, i will implement imul tomorrow hopefully smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[706] - posted: 2011-11-15 23:37:19
infact i've just implemented imul now.. for now only accepts reg, value.

Code:
imul eax, 32

//etc


i have updated the latest beta package smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[707] - posted: 2011-11-16 07:32:41

after updating , i got this error
Code:
                   edx = @right
                   eax = indx
                   imul  eax,255
                  // emit byte 0x6B,0xC0,0xff;              
                   IntToStr(indx,@tmp);
                   Ziron_ShowMessage(@tmp);
                   IntToStr(eax,@tmp);
                   Ziron_ShowMessage(@tmp);  
                   add eax , Edx             
                   H_strcpy(eax , @val );


[137,25]: Unknown Identifier "imul" in [masm.zir]
Code:
imul eax,255



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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[708] - posted: 2011-11-16 15:15:52
my apologies, i added the code for it to work, but did not add the keyword, i have re-updated the beta pack. smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2 3
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 1 user(s) online. 0 member(s) and 1 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd