Ok what is Assembly like as a language(I have never seen any code in Assembly) and why is it necessary for game programmers to know??
Ok what is Assembly like as a language(I have never seen any code in Assembly) and why is it necessary for game programmers to know??
-Microsofts Visual C++ Introductory Kit-
Current Projects: Learning Everything C.
Everyone has a photographic memory, some people just don't have any film.
______________________________
When was the last time you went for a colon cleansing? Because quite frankly, you're so backed up with crap that it's spilling out your mouth
Assembly is estually machine code. It is usfull but no necessary to know.
it's faster!
but u need to write more!
Actually, that depends on the coderOriginally posted by pode
it's faster!
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Can anyone give me a quick example of assembly code like a line or 2 if you don't mind. Also how is it faster if it is machine code which as far as I know is all 0's and 1's so how is that faster. Please help.
-Microsofts Visual C++ Introductory Kit-
Current Projects: Learning Everything C.
Everyone has a photographic memory, some people just don't have any film.
______________________________
When was the last time you went for a colon cleansing? Because quite frankly, you're so backed up with crap that it's spilling out your mouth
example
what does the above code do?? nothing useful! that's the kind of syntax you are looking at though.Code:XOR EAX, EAX INC EAX SHL EAX, 2 PUSH EAX CALL MyFunc MOV EBX, [ECX]
Generally people will say that ASM code is faster because you have more control over what is going on and therefore you dont put in unnecessary code. But like Magos says, it depends on the coder.
These days, the optimisations that compilers do for you is enough to get the extra speed. i'll bet there are few people on this board that can write better ASM code than an optimising compiler.
Most of the time if you are looking for extra speed, you should rethink your algorithm! or the way you are going about your algorithm.
Bobish is right, it's handy to know... and useful when you really need to use it, and it really helps understand what's going on inside the PC when you are running yorr code.. but it's not necessary
hope that helps
U.
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
To do something realistic in ASM (not just part of your code using an inline assembler) is a hair tearing experience (but amazingly there are still diehard dedicated ASM coders in abundance out there on the web!)
I had a mess around for a while with 32Bit ASM calling WINAPI functions....not because I felt it was important, but it helped me work out and understand a few key things that I took for granted before......For example I have attached a program I wrote in for the TASM32 assembler.......It produces a window on the screen with a catchy caption!
It resizes the text when the window size changes...uses custom icons (the TASM package comes with BRC - the borland resource compiler which works for C progs too).....implements a basic message procedure..and does what you would expect to do in VC++ with virtually no effort.....but I must admit doing this in ASM was a killer at times.....
Still...keeps me from doing anything constructive with life
Hey, where could I pick up a good 32 bit assembly compiler? I'd like to get back into assembly; last time I touched it I was programming apps for the P100 (Weren't those the days?)
Probably the best free 32bit assembler (well for windows coding if that's your interest) is MASM......
The best pace to get it is this site here which is owned by a guy called Steve Hutchesson....he writes libraries and updates for it from time to time too.....
hey thanx alot.
i'm a fan of TASM myself. do a search for TASM 5 on google and i'm sure you'll find a download somewhere. Someones even making an IDE for it.
good luck!
U.
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
Ok I would thank you all (if I had any idea what the heck you were talking about , jj) How in the world is Assembly faster(depending on the coder I know) than lets say C or C++, how does it give you more control, and what parts of games would you use it in.
Also I got one other question, I don't know how old all of you guys are but what is a good age to start learing C, C++, or Assembly. I am 14 right now and trying to learn C when did you start and how long am I in for studying.
-Microsofts Visual C++ Introductory Kit-
Current Projects: Learning Everything C.
Everyone has a photographic memory, some people just don't have any film.
______________________________
When was the last time you went for a colon cleansing? Because quite frankly, you're so backed up with crap that it's spilling out your mouth
When you write code in C, or C++ it is
translated into assembly by the compiler,
and then assembled by the assembler.
Since the compiler is turning the high level
code into assembly, it has the tendency
to include alot of unnecessary code.
This problem has been worked on since
compilers were first developed, and we've
come a long way. This is the reason that
it is possible to write faster code in asm.
- transmitt
Assembly programs are direct instructions to your computer. Each command corresponds to a specific machine code instruction. It has a very small number of simple commands, basically MOV (move) this here or ADD that to this. It is much more time consuming than high level languages but the benefit is you know exactly what your code is doing. When you program in C/C++ or other high level languages, you use a compiler to translate the code to assembly before it becomes machine code. Even though commercial compilers are highly optimized (better than your average assembly coder) it is not a direct translation. In game programming, speed is a main goal so you don't want any overhead. Thus, game programmers use assembly when they need to make sure things get done quickly (quite often for low-level graphics routines). It should be noted that unless you are a good assembly programmer it would be much better to use a language like C or C++ and let the compiler take care of optimizations (you could actually make the program go slower).
Here is a link you might find useful.
http://webster.cs.ucr.edu/Page_asm/ArtOfAsm.html
If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?
I hate it when someone else posts the same thing at the same time.
If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?