Register | Login
Forum Index > Source Help > fastcall question
Author Message
Pages: 1 2
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[296] - posted: 2011-11-03 21:38:44
ok seems there is an internal fault with the @local address, specifcally with lea, i have fixed it now.

http://www.codeziron.com/uploads/releases/ziron.compiler.11261alpha.rar

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
[297] - posted: 2011-11-03 21:48:12


ok , the same error is take place but this time in the plugin module itself.


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

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[298] - posted: 2011-11-03 21:51:57

here is the plugin code
Code:
program WIN32DLL 'Test PLUGIN';

#include 'zirplug/framework.zir';
#include 'zirutils.zir'

//////////////////////////////

const strLoaded = 'Test plugin has loaded!';

function  strcpy(Dword dst,src)
{ 
  Eax = dst; 
  Edx = src; 
  push Eax;
  BL =  [Edx]; 
  while ( BL != 0)  
   { 
      [Eax] = BL; 
      Eax++; Edx++; 
      BL =  [Edx]; 
   }  
  [Eax] = 0;
  pop Eax;
} 

//////////////////////////////


//
// event_Emit()
// return false to allow the assembler to process this keyword internally.
// return true to tell the assembler this keyword has been processed.
//
function event_Test() {
    uses edi;
    char  buf[5000];
    DWord Len;
    strcpy(@buf,'mov eax, 5000');
    Len = strlen(@buf);
    Ziron_ShowMessage(@buf);
    eax = Ziron_Execute(@buf,Len);
    if (eax == false) {
        Ziron_FatalError('myCMD plugin is not compatible with this version of Ziron');
     }  
    
    eax = true;
}

function InitPlugin(pointer pGetF) {
  Ziron_LoadAll(pGetF); //use framework utility function to load all

  //register our keyword
  Ziron_RegisterKeyword('KeyTest', @event_Test);
  
  return strLoaded;
}

entry function DLLMain(DWord iDLL,iReason; Pointer iResult) {
  if (iReason == DLL_PROCESS_ATTACH) {
    return true;
  }

  return false;
}

exports InitPlugin;


and here is the program
Code:
program WIN32CUI 'test';

#include 'console.zir';

eax = 1;
print('eax = ', eax:int, '\r\n');

KeyTest;

print('eax = ', eax:int, '\r\n');

wait_key(nil);
ExitProcess(0);


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[300] - posted: 2011-11-03 23:08:07
i have found the problem, it is a problem with local variables when pushing onto the stack from a function call, in this case

Code:
eax = Ziron_Execute(@buf, Len);


Len is the problem, i am going to fix this bug then will re-post with updated version hopefully.

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
[302] - posted: 2011-11-03 23:29:39
ok i fixed 2 bugs related to this, thanks - this has been helpful smile

new file: http://www.codeziron.com/uploads/releases/ziron.compiler.11261alpha.rar

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
[304] - posted: 2011-11-04 10:20:54

everything is okay , but the fastcall has the same error when calling this
Code:
    char  buf[5000];
    DWord Len;
    strcpy(@buf,'mov eax, 5000');



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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[307] - posted: 2011-11-04 15:42:05
yes, these problems are not fixed yet, they will take a little longer, since the type of mov is very different, i will have these fixed as soon as i get time smile

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


Quick reply:

Message:



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