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
A community discussion post from the original code:zIRON forum.
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
ok , the same error is take place but this time in the plugin module itself.
http://www.freewebs.com/ogremagic/index.htm
here is the plugin 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
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
i have found the problem, it is a problem with local variables when pushing onto the stack from a function call, in this case
eax = Ziron_Execute(@buf, Len);
Len is the problem, i am going to fix this bug then will re-post with updated version hopefully.
ok i fixed 2 bugs related to this, thanks - this has been helpful :)
new file: http://www.codeziron.com/uploads/releases/ziron.compiler.11261alpha.rar
everything is okay , but the fastcall has the same error when calling this
char buf[5000];
DWord Len;
strcpy(@buf,'mov eax, 5000');
http://www.freewebs.com/ogremagic/index.htm
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 :)