Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1402
2014-04-21 12:33:40 UTC
I have just tested with the Microsoft Incremental Linker and it linked fine.
my batch file:
Ziron.exe "DIR\sample.zir"
link.exe /SUBSYSTEM:windows /ENTRY:entry user32.lib kernel32.lib sample.obj
pause
happy easter btw! :)
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #1403
2014-04-26 20:38:29 UTC
Hi Mr Colin,
happy easter :)
the problem here is ziron did not put H_strcpy , the name of my ziron function, in symbol table of obj file. i open the obj file by PE hex editor and PEview.
so when calling H_strcpy from c code and link it with ziron obj file the ld linker did not
recognize H_strcpy name.
i think you have to export the function name in obj file in symbol table.
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1404
2014-04-27 22:01:10 UTC
Hi there, seems I broke the linker.dll during the upgrade, please download the following dll plugin and replace the original:
linker.dll [plugin]
then inside your code, add the exports clause to export which functions you want exposed.
e.g.
program MSCOFF 'test';
#define APPTYPE_LIB;
#include 'win_def.zir';
function H_strcpy(Dword dst, src) {
// your code
}
exports H_strcpy;
Let me know how it works out and i will make sure to include the fixed linker in next release. Thanks for report :yess:
bare in mind Ziron 2 only supports stdcall for now, i will re-implement cdecl and fastcall very soon, maybe even for next update.
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #1405
2014-04-28 20:06:27 UTC
Hi ,
your code did not produce coff file
but this code works okay with the new linker.
program MSCOFF 'test';
#define APPTYPE_CUI;
#include 'win_def.zir';
#Include 'console.zir';
function H_strcpy(Dword dst, src)
{
uses edx ebx;
Eax = dst;
Edx = src;
push Eax;
BX = word[Edx];
while ( BX != 0)
{
word[Eax] = BX;
Eax++; Edx++;
BX = word[Edx];
}
word[Eax] = 0;
pop Eax;
}
exports H_strcpy;
http://www.freewebs.com/ogremagic/index.htm
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1406
2014-04-28 21:24:28 UTC
OK, glad it is working, just let me know if you have any other problems :)
Colin
admin
Posts
928
Threads
49
Location
Bulgaria
Post #1407
2014-05-02 11:12:58 UTC
btw i see you using low level push, there is a newer feature you may like and might be worth you looking into - emacros.
e.g.
function H_strcpy(Dword dst, src) {
uses edx ebx;
eax = dst;
edx = src;
using(eax) {
bx = [edx];
while (bx != null) {
[eax] = bx;
eax++;
edx++;
bx = [edx];
}
char[eax] = null;
}
}
check out includes/zirutils.zir, they have a lot of potential for useful high level additions :)
Emil_halim
member
Posts
639
Threads
104
Location
Alex, Egypt
Post #1408
2014-05-23 17:50:33 UTC
yes , nice new features Mr. Colin.
My i ask you a question , why Ziron2 progress is very slow?
http://www.freewebs.com/ogremagic/index.htm