1 registered members (AndrewAMD),
678
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Assertion macro
[Re: FBL]
#343263
10/04/10 20:29
10/04/10 20:29
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
OP
Expert
|
OP
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Assertion macro
[Re: FBL]
#343266
10/04/10 20:51
10/04/10 20:51
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
OP
Expert
|
OP
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
But it isn't a test dummy, it's just a random dummy =/
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Assertion macro
[Re: jcl]
#343304
10/05/10 10:04
10/05/10 10:04
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
OP
Expert
|
OP
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Well, this wouldn't be a problem if SED would show macros in an extra color (automatically!). But at the moment it isn't visible for the user if it is an macro or a function. (Oh and just a side note, every code I have seen so far that uses assertion has an ; at the end, wether it is used or not). However, the workaround works great and I don't see a problem in using this so this thread is more or less obsolete. BUT! What about the feature request inline assembler? I don't need a full GCC style inline assembler, and would be enough if the compiler would just insert my assembler code to what it translates. Would this be possible?
Edit: FFFFFFFFUUUUUU, now this topic is moved and I guess JCL doesn't look into it anymore -.-
Last edited by JustSid; 10/05/10 10:05.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Assertion macro
[Re: jcl]
#343308
10/05/10 10:59
10/05/10 10:59
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
OP
Expert
|
OP
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Assertion macro
[Re: WretchedSid]
#343378
10/05/10 20:43
10/05/10 20:43
|
Joined: Apr 2009
Posts: 33 Germany
Bunsen
Newbie
|
Newbie
Joined: Apr 2009
Posts: 33
Germany
|
I don't assume, Conitec will offer an inline assembler feature within Lite-C. The reason maybe is, that you could use a regular C/C++ Compiler to do this and Lite-C should be as easy as possible. But if you need this in your Lite-C project you may try this method. For instance:
double fmod_native(double x, double y)
{
double ptr(double,double);
static char machine_code[] = {
0x55, // push ebp
0x8B, 0xEC, // mov ebp, esp
0xDD, 0x45, 0x10, // fld qword ptr [ebp+0x10]
0xDD, 0x45, 0x08, // fld qword ptr [ebp+0x08]
0xD9, 0xF8, // fprem
0xDD, 0x5D, 0xF8, // fstp qword ptr [ebp-0x08]
0xDD, 0xD8, // fstp st(0)
0xDD, 0x45, 0xF8, // fld qword ptr [ebp-0x08]
0x5D, // pop ebp
0xC3 // ret
};
ptr = machine_code;
ptr(x, y);
}
void main()
{
printf("fmod(7.0, 5.0) = %f", fmod_native(7.0, 5.0));
}
|
|
|
Re: Assertion macro
[Re: Bunsen]
#343392
10/05/10 21:58
10/05/10 21:58
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
OP
Expert
|
OP
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
But Conitec also offers shader support and they are clearly not easy to use and for beginners. Same goes for Multiplayer, so why no inline assembler? Users who have no clue about assembler don't need to use it and it wouldn't bother them. But for me it would be really useful as I could improve some functions calls to my runtime.
However, your solution might work but in fact its just a nicer buffer overflow (or at least the same way to use a buffer overflow without the overflow) and it doesn't look like something work with. Finding the hexadecimal for the mnemonics isn't the problem but a official solution would feel much better and safer (I think you can understand this). However, your solution is really awesome. Hut ab!
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|