How to improve my level of assemble language ?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
david
Member
Member
Posts: 93
Joined: Tue Aug 21, 2007 4:22 am
Location: Beijing.China
Contact:

How to improve my level of assemble language ?

Post 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
Just For Fun
User avatar
david
Member
Member
Posts: 93
Joined: Tue Aug 21, 2007 4:22 am
Location: Beijing.China
Contact:

Re: How to improve my level of assemble language ?

Post 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.
Just For Fun
User avatar
david
Member
Member
Posts: 93
Joined: Tue Aug 21, 2007 4:22 am
Location: Beijing.China
Contact:

Re: How to improve my level of assemble language ?

Post 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..
Just For Fun
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: How to improve my level of assemble language ?

Post 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.
User avatar
stephenj
Member
Member
Posts: 140
Joined: Wed Jul 23, 2008 1:37 am
Location: Canada

Re: How to improve my level of assemble language ?

Post 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.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: How to improve my level of assemble language ?

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: How to improve my level of assemble language ?

Post 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
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
david
Member
Member
Posts: 93
Joined: Tue Aug 21, 2007 4:22 am
Location: Beijing.China
Contact:

Re: How to improve my level of assemble language ?

Post 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
Just For Fun
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: How to improve my level of assemble language ?

Post 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).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: How to improve my level of assemble language ?

Post 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
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: How to improve my level of assemble language ?

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: How to improve my level of assemble language ?

Post 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.
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: How to improve my level of assemble language ?

Post 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.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: How to improve my level of assemble language ?

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
david
Member
Member
Posts: 93
Joined: Tue Aug 21, 2007 4:22 am
Location: Beijing.China
Contact:

Re: How to improve my level of assemble language ?

Post 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 ?
Just For Fun
Post Reply