Thank you ALL.
@ Vortex
I got you , and agree with you.
@ fearless
I was thinking the same as you , but it is a bit dangerous to include all obj file , suppose that you don't want to include a specific obj one.
@ habran
I already (in my Example) let uasm to use headers from sphinx C-- , so i include this in the start.
#include <windows.h>
#include <MSVCRT.H-->
Also i am using Pelles IDE, I made a plugin to handle C-- files.
At first i separate this source code into two files but with .c-- extension, then let C-- detects the '.MODEL' , so that the control pass to Uasm , then when uasm finished the control pass back to c--.
The main reason for not separation is that , how to pass c-- stuff (API declarations) to Uasm , also for the opposite direction passing Uasm stuff to C--, only mixing them in one source code allows us to do that.
The Include Path is determen by C-- , if you have inc files for Uasm , put them with C-- include folder.
The only drawback here is C-- does not understand all C headers.
about the C-- for 64bit , i don know how , remember that i am not the owner of C-- ,so i extended it as i can.
Here is Uasm part.
// start uasm here
.MODEL flat, c
EXTERNDEF h:SDWORD
.data
vdword dd 300
vword dw 200
vbyte db 1
align 4
.data?
pdword dd ?
.code
kput:
push [ESP+4]
call puts
add esp,4
call _getch
ret 4
mtest Proc
mov eax , 100
mov pdword,eax
mov h,eax
ret
mtest Endp
End
As you see , the functions puts , _getch are not declared in Uasm.
Also in C-- part
main()
{
int k;
k=mtest();
kput("press any key...");
puts("welcome");
printf("%d\n",vdword);
printf("%d\n",vword);
printf("%d\n",vbyte);
printf("%d\n",pdword);
printf("%d\n",h);
ExitProcess(0);
}
The Variables vdword,vword... and the procedures kput, mtest are not declared in Uasm.
@ hutch--
I tried your idea but it did not work because the PoLinker did not see the main function when it is in Lib file but it okay with obj file.
@ aw27
It is not Quick C-- , see this
http://c--sphinx.narod.ru/indexe.htm