Register | Login
Forum Index > Bugs and Fixes > inline function problem
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[1225] inline function problem - posted: 2012-05-24 20:41:52

Hi ,

this code give error
Code:
  inline function Absi(x){eax =  $x ; cdq ; xor eax , edx ; eax -= edx ; $return eax }

  print( Absi(-100)  , '\r\n');    


error is

Expected , or ) but found 100 in [test_def.zir]
Code:
print( Absi(-100) , '\r\n');


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1229] - posted: 2012-05-27 19:21:45
I have fixed this in latest beta smile

Code:
program WIN32CUI 'Test';

#include 'ch.zir';

inline function Absi($x) {
  eax = $x;
  test eax, eax
  jns @notsigned;
  neg eax
  @notsigned:
  $return eax;
}

print(-100, ' ', Absi(-100)  , ' ', Absi(100), '\r\n'); 

wait_key();

ExitProcess(0);


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
[1230] - posted: 2012-05-28 19:59:59

works well.

thank you for fixing it.

http://www.freewebs.com/ogremagic/index.htm
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1857] - posted: 2016-05-07 15:10:53
This seems works Code:
program RAW_IMAGE 'test';
#set bits 32;

inline procedure test($a){
  $a = eax;
}
Dword a;
test(a);

But this not(just changed name $a to $p1) Code:
program RAW_IMAGE 'test';
#set bits 32;

inline procedure test($p1){
  $p1 = eax;
}
Dword a;
test(a);
Instruction usage is not supported!
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1863] - posted: 2016-12-12 20:52:04
This was actually part of a much bigger problem which is now fixed for next release. Thanks.

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


Quick reply:

Message:



Currently Active Users:
There are currently 15 user(s) online. 0 member(s) and 15 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