It will be half VB, half C++, with a twist ;)
And I was thinking of designing the logo using DirectX, and add spotlights and such, with the logo in 3D.
Printable View
It will be half VB, half C++, with a twist ;)
And I was thinking of designing the logo using DirectX, and add spotlights and such, with the logo in 3D.
Logical and bitwise NOT and AND etc. are different operations. In VB they are effected by the same keyword and the actual operation determined by the compiler. In C++ and .NET they are different keywords/symbols, e.g. in VB.NET Not is bitwise and IsNot is logical.Quote:
Originally Posted by eyeRmonkey
I like the last logo best. I like the medium coloured background and the light/dark text on it with that glowy effect :) It should look like it is coming from the heavens :D
The arithmetic modulus of a number is actually the absolute value, i.e. |-5| = 5, or abs(-5) = 5. The mod or % operator is modulo, the remainder after fitting the 2nd value into the 1st as many times as possible.Quote:
Originally Posted by eyeRmonkey
Can I be stuck with the job of writing an IDE? :D I assume thats what you meant when you said it writes the code for you..
chem
So let me get this straight, the language does not have built in support for windows, but the facilitating code (Win32 calls) is generated by the IDE?
also Jacob,the linking issue with the library is sorted, it will be a static .lib file which allows inlining using any calling convention. (Thanks twanvl for that info :))
I fixed your PowI code, penagate. You needed a jmp command in there ;)
Code:inline int powI(int n, int exp)
{
__asm {
mov eax, n ; num
mov ebx, n ; exp
mov ecx, exp ; counter
cmp ecx, 0
je retOne
cmp ecx, 1
je retVal
loopstart:
imul eax, ebx
dec ecx
cmp ecx, 1
jg loopstart
jmp retVal
retOne:
mov eax, 1
retVal:
}
}
I'm pretty much doing it how C++ does it somewhat. When a Win32 window is created, it puts the code in the code window automatically to generate it. I believe VB.NET did the same thing.Quote:
Originally Posted by penagate
I was going over the thread and spotted exactly that, but didn't correct it because it always returns the correct result for me regardless. Illogical, but... :confused:
Yeah I was wondering why it wasn't giving me the correct results. I was always getting 1. :lol:
I can understand that :D But now I'm really confused. Where are you calling it from, a C++ exe? Because I called it from VB and it always returned the right result. Maybe a call issue with teh DLL. If so, then I'll shift it into a C++ exe to test the functions.
I tested it in C++.NET. Is there anyway we can make it faster? I think that's as fast as we can make it go. artofassembly.com said that less code equals more speed.
Yeah thats true in most cases. However some instructions use more CPU cycles and so sometimes (rarely) multiple quick instructions will be faster than one slow one. And the more common situatation is with loops. If you know you're always gonna loop at least a fixed number of times then you can "unroll" the loop i.e. write the code out several times. That saves you a few compares and jumps which are fairly expensive.
Can you give me a template to use to test my functions on a console app? I suck at C++ :D
Yeah here ya go:
I don't think that C++ has an exponent operator. Maybe there is a function in the math.h header, but I'm not sure.Code:
#include <stdio.h>
inline int exp(int n, int exp)
{
__asm {
mov eax, n ; num
mov ebx, n ; exp
mov ecx, exp ; counter
cmp ecx, 0
je retOne
cmp ecx, 1
je retVal
loopstart:
imul eax, ebx
dec ecx
cmp ecx, 1
jg loopstart
jmp retVal
retOne:
mov eax, 1
retVal:
}
}
int main(void){
int t = exp(2,5);
printf("%d\n",t);
printf("%d\n",2 * 2 * 2 * 2 * 2);
return 0;
}
Thanks mate. OK now I see it returning 1. Must be something different about the way it is called from VB and C++. I'll use that to test the functions in future.
Re. exponents in C++, pow() is defined in math.h, but it accepts Doubles. I think making separate integer/float versions for all the maths functions would be much more efficient. (Don't quote me on pow() because I haven't found any integer exponent function yet :D)
Good idea, penagate. And we can do the same for other functions. Variants will NOT be allowed in Lightfusion. You will have no choice but to declare your variables a certain data type.
We can have the functions named like so:
exp_int8()
exp_int16()
exp_int32()
exp_flt64()
exp_int64()
exp_flt64()
Or something more simplified.
Where did you guys learn ASM? I'm having a hard time finding any crash-course tutorials. Anyway, what language are you writing this project in?
I answered your question over in the Assembly Tutorials thread. Take a look ;)
I'm gonna write it in C++, using a lot of assembly though in areas where it's needed. The book I'm getting that teaches you how to make a compiler, is in C++ as well.
Woss, I've been picking up ASM for months now off a bucketload of websites while looking for extremist ways to power up VB6 :D
Jacob, re. the function names, I think we shoud have compiler definitions for those perhaps. So if you call exp() in LF, it compiles to exp_int32(), or exp_fl32() etc., depending on which data types you pass in. I understand that is sort of like working with Variants but it's all determined at compile time so you don't lose any efficiency and you gain ease of use.
Alternatively, we could do it using overrides:
etc. and that would compile the same way. What do you think?Code:int exp(int n, int exp);
float overrides exp(float n, float exp);
It's an idea, but well see what happens.
'overrides' is a very bad idea. C++ had that for a time, and it caused nothing but chaos.
Just make every function overloadable.
Which brings me to a point of accepted terminology. Overriding means redefining a function in a derived class. Overloading means having several implementations of a function with different argument types.
I always get them mixed up. My bad. I meant overload. Where the compiler determines which function to call at compile-time.
So I guess it's best to use separate functions. I'm thinking of having an operator for exponents instead, and having the compiler check for the data types used and work with it.
I guess operators is would be covered in your book. I'm not sure how you'd insert the code inline. Possibly you'd need to push the registers before the operation and pop them back afterwards so that the operation doesn't mess up the state of the current procedure. I don't know much about that.
I can't wait for that book to arrive at the bookstore. It's been 3 business days already since I had them preorder it.
Jake, feel free to make a logo (or THE logo) in DX, but for now I think one of those will serve. I have a few more to post though.
Chem, I think Jake was talking about writing the IDE in ASM, but I am not sure I see the point in that. I think we should do it in VB6, that way I have something I can contribute. I don't see how it would slow down our language at all because the compiler will be totally seperate. If you want on the project you are more than welcome. I'll wait for Jake to reply about what he wants done with the IDE.
Jake, can you link me to that ASM thread you mentioned above?
EDIT: Jake, edit your first reply in this thread and make it an introduction to LightFusion type thing.
EDIT AGAIN: Maybe I will just take over the first post again until I REALLY can't put any time into this.
The link I hooked wossy up was this: www.artofassembly.com
The IDE will be made in C++, not assembly. The reason is because it makes no difference on how it interacts with the Win32 API, cause it will be the same speed pretty much. The functions/operators and the compiled code will be made with assembly. But will see what the book I'm getting says.
And I think it's best for you to edit your first post. It's not gonna matter that much.
I'm currently working on a logo, as well as the project itself. It's being done on Visual C++.NET.
I meant this link.Quote:
Originally Posted by Jacob Roman
I attached some more logos. Anyone like 1 particularly? Any suggestions about colors or styles? Anyone want me to post these as .PNGs so you can start using them? Should I make it thinner so it can fit in a sig easier?
That light glare. Can you upload that as a separate pic for me?
The 4th one? Or the 1st one? Do you want me to make it thinner so it fits in a sig better?
Here is the one I think you want.
I meant the light glare itself. I'm gonna use that as an icon for my app. Also this logo seems to be better.
Sorry I meant lens flare. Just upload the lens flare picture. That's all I want for now.
Nevermind. Found one inside Photoshop. Now I got a good icon for it.
It depends if you can use instructions like lodsb. They perform their actions in a single clock cycle, so technically:Quote:
Originally Posted by Jacob Roman
Is slower than:Code:Message db "Hello World!",0
mov esi,Message
mov al,[esi]
inc esi
Although the difference would no doubt be hardly noticable.Code:Message db "Hello World!",0
mov esi,Message
lodsb
chem
chem I thought individual instructions take more than a single clock cycle.
My crappy efforts.
http://www.vbforums.com/attachment.p...id=40577&stc=1
Small button, like the Fx ones in my sig.
http://www.vbforums.com/attachment.p...id=40578&stc=1
Like eyeRmonkey's but slightly different background colour. And I couldn't find a lens flare.
Not according to the documentation I've read..Quote:
Originally Posted by penagate
Think I'll change my sig to include the stuff you guys are doing :D
chem
LOL. Figures.Quote:
Originally Posted by Jacob Roman
chem
Yo, can i help i have an advanced and length back ground in making tea and coffee, and am a great target for all your office jokes.
ILMV
LOL. Easy targets are boring though. Theres no point if they don't give some back...
chem
How do you guys make the "Light" glow in Photoshop? Mine wasn't glowing for crap. At least Photoshop supports Lens Flares. :)