🔒 Locked
Assembly!
Advertisement
Original Post
Since you can program games in Assembly, I do not find it an odd thing to post about my problem here. I want to learn assembly, but I need a course (at a school or on-line), I just can't find any in my own country, nor from foreign countries. I hope that maybe one in here, know something that can help me, because I find assembly interesting and quite powerfull, though it seems to be a dying art, more or less! any replies that can help me out is appreciated highly.
You learn asm if you study datalogi (computer science for all you non-danes). But I doubt there are anywhere you can literally study assembly as such. It's usually just one or two classes somewhere at computer science degrees.
However, how much do you know already? Might also just pick up a few books on the subject.
However, how much do you know already? Might also just pick up a few books on the subject.
I can't say I know much!
...but I started out reading a book/manual I downloaded, from Randall Hyde's page.
I bumped into some problems... not sure what it's called, but tables crossing 00, 01, 10, 11... I found it lacking of explanation of how/why the outcome became what it did, cause looking at it logically, trying to figure out how the results turned up, seemed 'non-logic'/illogical to me.
Otherwise I found it very interesting to read/learn about, I really would like to get help with getting past that problem I got (just to start somewhere).
(cause I probably run into more problems, no doubt)
...but I started out reading a book/manual I downloaded, from Randall Hyde's page.
I bumped into some problems... not sure what it's called, but tables crossing 00, 01, 10, 11... I found it lacking of explanation of how/why the outcome became what it did, cause looking at it logically, trying to figure out how the results turned up, seemed 'non-logic'/illogical to me.
Otherwise I found it very interesting to read/learn about, I really would like to get help with getting past that problem I got (just to start somewhere).
(cause I probably run into more problems, no doubt)
Assembly can be learned by going to the CPU manufacturer (Intel and AMD for x86) and downloading books describing every instruction in detail. Intel calls this book the "IA-32 Intel Architecture Software Developer's Manual" (at least my copy from Jan 2006 did). Intel also releases the "IA-32 Intel Architecture Optimization Reference Manual" which is a quicker way to learn a new chip once you already know x86. AMD releases similar books. ARM releases the "ARM Architecture Reference Manual" and the "ARM v7-M Architecture Application Level Reference Manual".
You should be able to find these documents pretty easily with a search on the manufacturer's site. If you need traditional class structure, ASM probably is not for you. It is a constantly changing field, so you will need to keep up on your own. As an example, every PC chip quite a ways back now has had quick shift operations except the Pentium 4. Also there is of course SSE+2+3+4...
A tip: if you do not already know C and want to learn ASM, learn C first. A lot of the documentation assumes you know C.
You should be able to find these documents pretty easily with a search on the manufacturer's site. If you need traditional class structure, ASM probably is not for you. It is a constantly changing field, so you will need to keep up on your own. As an example, every PC chip quite a ways back now has had quick shift operations except the Pentium 4. Also there is of course SSE+2+3+4...
A tip: if you do not already know C and want to learn ASM, learn C first. A lot of the documentation assumes you know C.
While programming a game totally in assembler may be interesting as an exercise, it is not really practicle for anything but the smallest of games.
Writing certain sections of a program in assembler is OK for optemisation purposes, but for anything beyond the simplist/smallest of games, you would need to be a masochist to write an entire game in assembler :)
For the bulk of the game code, you would have to know assembler very well to top the machine code generated by a decent C/C++ optemising compiler, and have a lot of spare time.
The last time I wrote a game completely in assembler was to satisfy CPU speed and RAM constraints. That was a program for a Commadore 64 back in the early 1980's (8 bit CPU, 64K memory).
IMHO, small sections of a game app in assembler is OK, but I wouldn't recommend writing an entire game using it.
HTH
Writing certain sections of a program in assembler is OK for optemisation purposes, but for anything beyond the simplist/smallest of games, you would need to be a masochist to write an entire game in assembler :)
For the bulk of the game code, you would have to know assembler very well to top the machine code generated by a decent C/C++ optemising compiler, and have a lot of spare time.
The last time I wrote a game completely in assembler was to satisfy CPU speed and RAM constraints. That was a program for a Commadore 64 back in the early 1980's (8 bit CPU, 64K memory).
IMHO, small sections of a game app in assembler is OK, but I wouldn't recommend writing an entire game using it.
HTH
Programming in pure asm is insane dude. But if you wanna learn a bit of asm check out http://www.xs4all.nl/~smit/asm01001.htm
Quote:
Original post by Anonymous Poster
I think the best thing you have to do to learn assembly language is to read a book about computers architecture and organization, because you will understand how the computer work internally witch will help you to get the meaning of the ASM instruction and there meanings.
I agree AP, if a person can understand what is happening at the lowest level, learning any high level language is relatively trivial.
After that, learning the common API's associated with a particular language is the real work : )
Quote:
Original post by SiCrane
If you're already familiar with a compiled programming language like C or C++, one tool for learning assembly is to examine the emitted assembly code for source code. For example, You can get an assembly listing with MSVC with the /FAs switch or gcc with the -S switch.
Thanks for that SiCrane,
I wondered how to do that in MSVC (done it in other dev environments).
Very useful for writing a procedure in asm with the correct calling/return conventions that can be accessed from higher level languages.
Cheers.
Quote:
I agree AP, if a person can understand what is happening at the lowest level, learning any high level language is relatively trivial.
That's like saying that if a person can understand how a piano works, learning to write sonets is relatively trivial :)
I don't really think learning assembly will make easier to grasp, say, OO design or functional languages. It just might make micro-optimizations or debugging a little bit easier.
Quote:
Original post by mikeman Quote:
I agree AP, if a person can understand what is happening at the lowest level, learning any high level language is relatively trivial.
That's like saying that if a person can understand the alphabet, learning to write poems is relatively trivial.
I don't really think learning assembly will make easier to grasp, say, OO design or functional languages. It just might make micro-optimizations or debugging a little bit easier.
Yes, I agree with your point, my statement was over simplified. When I stated "relatively trivial", maybe I should have said "easier" :)
Learning "low level" concepts doesn't teach you "high level" concepts, but I am sure it will make that learning easier.
will assenbly enable me to write my own OpenGL extensions?
will assembly enable me to modify the graphics pipeline? or is HLSL better?
will assembly enable me to implement features on an existing graphics hardware that isn't available yet?
Assembly is a fully usable language. You can link to libraries, you can interact with DLLs, etc. It seems from the posts here that this is not recognized.
Writing a large program in ASM is possible, and not even that difficult. It is also good practice at learning to prevent bugs. It will also allow you a chance to gain a certain level of intuition about what the compiler is doing to your code, since you'll probably write a macro to set up a standard C function call and other similar language features.
Often experienced programmers tell you to save your time by not doing something they had to do, but they may not recognize what they learned from the experience. I hope you do abandon ASM quickly, but perhaps you will learn very valuable lessons from the experience.
There are many reasons people do not code in ASM:
- less people know ASM than more traditional languages
- ASM code generally is very coupled to software and hardware, so less useful in the future
- it is much harder to get a good ASM IDE, and assemblers rarely spit out useful warning/error messages (more bugs)
- good coding practices and standards are much harder to enforce in ASM (more bugs)
Writing a large program in ASM is possible, and not even that difficult. It is also good practice at learning to prevent bugs. It will also allow you a chance to gain a certain level of intuition about what the compiler is doing to your code, since you'll probably write a macro to set up a standard C function call and other similar language features.
Often experienced programmers tell you to save your time by not doing something they had to do, but they may not recognize what they learned from the experience. I hope you do abandon ASM quickly, but perhaps you will learn very valuable lessons from the experience.
There are many reasons people do not code in ASM:
- less people know ASM than more traditional languages
- ASM code generally is very coupled to software and hardware, so less useful in the future
- it is much harder to get a good ASM IDE, and assemblers rarely spit out useful warning/error messages (more bugs)
- good coding practices and standards are much harder to enforce in ASM (more bugs)
I like richardurich's recommendations and both of his posts.
And I know there exists books, I was asking about help for knowledge about
courses or if any is up for it, be my tutor.
...but just that you all have replied, shows you want to help,
and you did the best way you could, I hope.
And I know there exists books, I was asking about help for knowledge about
courses or if any is up for it, be my tutor.
...but just that you all have replied, shows you want to help,
and you did the best way you could, I hope.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement