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. :)
Don't know how to use PS. I use an ancient version of PhotoImpact. Added a 150% sized orange-coloured drop shadow around the text.
Ohhhh drop shadow. I saw different kinds of things like glow and other related functions that I thought would make it glow, but I'll see if they got anything on drop shadows.
[EDIT] Nope. But there might be one under a different name.
Um, yes. In PS its a drop shadow aswell. Its in Layer > Layer Options > Blending Options or something similar. Haven't used photoshop in yonks.
In the dialog that appears there should be an option for a drop shadow.
chem
Layer->Layer Style->Drop Shadow in Photoshop CS.
Instructions take more than one cycle, but due to pipelining, most appear to use one cycle (that is, that's their effective speed).
That reminds me, to optimising ASM well you have to make it pretty CPU-specific. What works well on one CPU might not work so well on another. So we have to think about whether we want compiler optimisations for specific CPUs.
In photoshop 6.0 here is how how I did the "glow" around the word Light:
1) Put the text on its own layer
2) Double click that layer (Brings you to Layer Style)
3) Select the checkbox that says outglow
Let me know if that works for you?
Chem, are you still interested in joining the project? If so, how do you want to help? Do you know C++.NET to help with the IDE?
I'm still working on the IDE window itself. Right now, I'm on the step where I have to add menus and such.
Should the compiled programs automatically be multithreaded for a good kick in speed?
How much extra work does it take to multithread an app? If its not too much then yes, otherwise no.
I attached some more logos. They are smaller this time. I also need to add the ™. What colo should I make the ™? The 5th logo has more spikes in the flare and the 4th logo has a totally different flare (more blue). Logo 2 and 3 are the same flare, but positioned differently.
Jake, how is the syntax.doc coming? I'm guessing you book came and you have just been reading that. Once you make syntax.doc we need to make an organized format for it so other people can add to it if they wish. Either that or you will have to keep ontop of all suggestions made.
Is there still nothing I can do as far as development? Maybe I could help with the library if I learned a little ASM? Are we still using MASM through and calling it via C++? Does artofassembly.com have good beginners tutorials?
Yes www.artofassembly.com has some killer tutorials for beginners. Use the Dos 16 bit section though. They got 32 bit stuff in there as well, but it gives you a feel of the x86 instruction set, and you can use it in C++. The Windows 32 bit stuff is too high level and will only work for MASM.
I haven't started on the doc just yet cause I was working on the LightFusion program itself. The book has not been shipped to Barnes & Noble just yet. I called them this morning and they said that they will call me when it arrives.
I'm thinking since it's called LightFusion, you should have two lens flares and have the lights fuse into each other across the logo, by having one flare on the left side and another on the right. A black background with it would be awesome as well.
I could teach you a little assembly right here if you like as well. :)
Cool. Aren't the 16bit instructions diff fromt he 32bit ones?
Could you explain (in detail) how I execute MASM from VC++ (I have Visual Studio 6). I saw you guys do it a few times, but I have never even opened VC++.
Should the lights fuse in the center of the image? Should they be the same size? If the background is black what color should Fusion and ™ be?
I couldn't find the 16 bit section. All I saw was this: http://webster.cs.ucr.edu/Page_win32/index.html
You have to click on this button ;)
http://www.vbforums.com/attachment.p...id=40601&stc=1
And when you are in there, either click on the HTML version of the tutorial or download the PDF files that are all in one zip file.
You will see the 32 bit instructions in there. For the 4 main 16 bit registers ax, bx, cx, and dx, all you would need is an e before them to make them eax, ebx, ecx, and edx, which are 32 bit registers.
Ok. You missed my other 2 questions. Aren't the 16bit instructions different fromt he 32bit instructions? And how do I put it all into C++? I have never used VC++ before.
EDIT: Nevermind. You answered one as I was typing this. Can you clear up the C++ part?
To use asm in C++ it's as easy as this:
And this, for example, can fill a cetain number of elements in an array with a value instantaniously without the reliance of a loop. It's like the Fillmemory API only done on 32 bit integers rather than bytes.Code:inline void Mem_Set_QUAD(void *dest, unsigned int data, int count)
{
_asm
{
mov edi, dest ;edi points to destination memory
mov ecx, count ;number of 32-bit words to move
mov eax, data ;32-bit data
rep stosd ;move data
}
}
Here are some more logos. What color should I make the ™?
Make the lights futher apart.