Page 1 of 2

How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 8:21 am
by david
I have programmed for half and a year using MASM. but I still think my level is low.I must look for book sometimes.Do you have some good idea for me to improve it ? Thank you! :D

Re: How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 8:34 am
by david
you know, there are a few programmers using assemble language. In my company, only I write code using assemble language. others write C language.It is hard to improve my level to a high level.

Re: How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 8:53 am
by david
I have programmed 5.000 rows codes. but i don't think it is enough, do you have some good project. if it is open source, maybe i can develop it with you.. :P and if you want me to join you..

Re: How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 8:56 am
by bewing
If you have been doing it for six months, then you already understand the basics. Getting to a higher level is just a matter of practice, after that. I would say that a good way to learn more is to create some small programs in C, compile them, disassemble them, and study the assembly code. Try to figure out if the compiler did a very good job, or a bad job. Try to rewrite the code in assembler, better than the compiler did it. Also, go back and look at ASM programs you wrote 6 months ago. Rewrite them so that they are up to your current standards. This kind of practice will improve your skills quickly.

As far as projects go, I found that creating a hexeditor in ASM was an interesting challenge, and was very useful in helping me create my OS, so far.

Re: How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 12:04 pm
by stephenj
What I'd like to know is if a modern collection of "assembly gems" exists.

Agner Fog's page is the closest I've found.

Re: How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 2:44 pm
by Love4Boobies
Also, I suggest reading Michael Abrash's Graphics Programming Black Book Special Edition. Don't be fooled by the book's name; it's not just about graphics, he actually summed up all his books and articles into one, and Michael Abrash is well-known for his assembly optimizations. It contains a lot of stuff on assembly, especially the first chapters.

Re: How to improve my level of assemble language ?

Posted: Sat Nov 22, 2008 4:37 pm
by kmtdk
and if you "read Michael Abrash's Graphics Programming Black Book Special Edition", please read the document from intel about optimizing ( for example cpus have more than 2 pipes ... and the most is improved... , and about the "zen" timer, you can make something close, but about cycles (RDTSC)* a little hint)
I have programmed asm for a year ( aprocemently), and i still trends to do a few dummy errors, but i still chalange my self: "can i make the code faster", "can it be done in another way"( this is a design thing, but desing in asm can also be a good path to learn more), but the best advice i can give, is try to make some app, but also try speed up code ( like bewing said), cause you learn much from that.
and as the last advice:
code more OS, that gives some good pratice 8)


KMT dk

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 3:59 am
by david
I have been doing it for 18 months.

I am relly interesting in compiler( C language). I want to program a C language compiler. but i don't think my asm is high.
so i want to improve my asm first, and then I will begin to program a C language compiler. maybe my asm level will be improved when I develop a compiler. I will think it again.

bewing:
what C language compiler do you use ? Borland C++/ GCC/ VC

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 4:45 am
by Love4Boobies
Intel is well-known for compiler optimizations. You should also take a look through their Intel 64 & IA-32 manuals (including, but not limited to, the optimization reference).

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 5:45 am
by kmtdk
well
to program a compiler , you will need at least one thing, the knowledge of every "instruction", and then could translate it.
secound you will need a interface ( a gui manby ? ), but if it is about file saving, gui and sutch, try looking for APIs on masm.
masm and fasm have both api calls interface..

KMT dk

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 9:55 am
by Love4Boobies
kmtdk wrote:well
to program a compiler , you will need at least one thing, the knowledge of every "instruction", and then could translate it.
That's in the Intel CPU manuals (volumes 2A and 2B).
secound you will need a interface ( a gui manby ? ), but if it is about file saving, gui and sutch, try looking for APIs on masm.
masm and fasm have both api calls interface..
Ahem... Compilers have nothing to do with GUIs. And I'm not sure what he's trying to say about API calls to the interface.

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 12:19 pm
by kmtdk
eh
i can see the problem,( i could not explaine it in another way):
Masm have the abillity to call win API functions.

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 12:32 pm
by Troy Martin
If you have the right library, any assembler can call the Win32 API. Except for MS-DEBUG, since that would be stupid.

And on the subject of writing compilers: one thing you can do is just turn the high level source into assembly for MASM, NASM, FASM, YASM, TASM, etc. and then have the respective assembler do the rest.

Re: How to improve my level of assemble language ?

Posted: Sun Nov 23, 2008 3:55 pm
by Love4Boobies
kmtdk wrote:eh
i can see the problem,( i could not explaine it in another way):
Masm have the abillity to call win API functions.
There are low-level assemblers (NASM) and high-level assemblers (MASM). High-level assemblers already start to look a bit like high-level languages and provide things like FOR,IF,WHILE,REPEAT..UNTIL. I'm not sure what kind of projects the OP is working on and which would suite him better.

Re: How to improve my level of assemble language ?

Posted: Mon Nov 24, 2008 11:14 pm
by david
I want to develop a compiler,

CPU has real mode and protect mode, my compiler should run in real mode or protect mode.

and a compiler must run in one OS, for example: Windows/Linux...

I am familiar with MASM and VC , they are all run in Windows, but no compiler open source in windows, it is hard to develop in windows.

GCC is open source, I can read its source to help me. but i have not used it before.

if you developed a compiler before, would you like to give me some good idea ?