Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: Assertion macro [Re: FBL] #343263
10/04/10 20:29
10/04/10 20:29
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
LFDummy


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Assertion macro [Re: WretchedSid] #343264
10/04/10 20:34
10/04/10 20:34
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Minimum I'd have expected would be LFTestdummy laugh

Re: Assertion macro [Re: FBL] #343266
10/04/10 20:51
10/04/10 20:51
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline 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: WretchedSid] #343268
10/04/10 21:21
10/04/10 21:21
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I was referring to the user =(

Re: Assertion macro [Re: FBL] #343300
10/05/10 09:14
10/05/10 09:14
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Back to topic: I'm using similar macros in my code, but I don't write the final ;. This reminds me that it's a macro and not a function.

A single ';' throws an error in lite-C because in most cases it is not intended, but caused by an error in the preceding line.

Re: Assertion macro [Re: jcl] #343304
10/05/10 10:04
10/05/10 10:04
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline 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: WretchedSid] #343306
10/05/10 10:33
10/05/10 10:33
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I still look into it, but no, there won't be an inline assembler.

Re: Assertion macro [Re: jcl] #343308
10/05/10 10:59
10/05/10 10:59
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline OP
Expert
WretchedSid  Offline OP
Expert

Joined: Apr 2007
Posts: 3,751
Canada
But why?


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
B
Bunsen Offline
Newbie
Bunsen  Offline
Newbie
B

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:

Code:
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 Offline OP
Expert
WretchedSid  Offline 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
Page 2 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1