Page 1 of 1

ASM lessons/tutorials?

Posted: Tue May 18, 2010 4:43 pm
by Auraomega
Hi there,

A friend is interested in OS deving but doesn't have any experience of ASM and while I know my way around (tentatively), I'm not confident in giving advice and explaining things to him so can anyone point us in the direction of some tutorials with example code to get him started? Preferably NASM oriented and x86 architecture to be relevant to the aims.

Cheers in advance for any feedback :)

Re: ASM lessons/tutorials?

Posted: Tue May 18, 2010 5:32 pm
by bewing
Teaching someone else how to do something is one of the best ways of mastering something yourself. You'll get comfortable very quickly. :wink:

Re: ASM lessons/tutorials?

Posted: Tue May 18, 2010 6:12 pm
by montrom

Re: ASM lessons/tutorials?

Posted: Tue May 18, 2010 6:55 pm
by gerryg400
Don't let a lack of knowledge of assembler stop you or him. I'm fairly sure that some will disagree with me, but I'd say that being proficient in asm is not essential to OS design. For me, asm is difficult to read and impossible to write. My entire OS has fewer then 200 lines of gas asm code (including a small library of inline asm functions I call from c) and I would describe my assember skills as very poor. I have absolutely no experience with writing asm outside those 200 lines. I couldn't write a boot loader from scratch in asm to save my life, don't know how to use int10 and have to look up the intel book every time I do a leaq.

I'll admit right now that my favourite way of generating asm code is to write something in c and cut and paste from the output of objdump to my .S file. I do know a little about how interrupts, paging, selctors, apics etc. work, but I do it all in c.

What is absolutely essential, and for me the interesting part of OS design, is to understand the architecture of the processor you are targeting.

- gerryg400

Re: ASM lessons/tutorials?

Posted: Wed May 19, 2010 2:27 am
by Auraomega
Thanks for that, maybe I'll brush up on my ASM a little more and then attempt 'teaching' as you're right, it would probably make me more confident in my own abilities that way.

@montrom: Amazingly Google does infact work around here, however I asked for which tutorials would be useful not easy to find. I learned on micro-controllers personally at college so I never read any online tutorials and rather than give crap to my friend to learn from I asked on here to make sure I was getting something worth while.

Re: ASM lessons/tutorials?

Posted: Wed May 19, 2010 3:03 am
by montrom
In my opinion, that is the most useful ASM tutorial. It just happens to also be the first hit on Google too. Couldn't you have looked at the guide and determined on your own whether it was useful? Anyway, don't answer that. Just send your friend to the library and he can check out a book. I recommend one that I started with called, "Peter Norton's Assembly Language Book for the IBM PC" (isbn: 0-13-661901-0). In his book he takes you step by step through writing a hex editor. By the end of this book, your friend may be teaching you something. ;)

Re: ASM lessons/tutorials?

Posted: Wed May 19, 2010 11:25 am
by Auraomega
As I say, I asked to get other peoples opinion on good tutorials. As for that book, I may have to get a copy for myself :wink:

Re: ASM lessons/tutorials?

Posted: Thu May 20, 2010 4:52 am
by montrom
OK, then fair warning. The book was published in 1986, it's 16 bit TASM syntax meant for MSDOS. However, don't let that discourage you too much, because the basics of the language are covered quite well throughout the lesson, references are provided in the back, and the complete source is also provided in the back as well as throughout the lesson with descriptive comments. Thus, it's a great place to start for beginners that also becomes a useful reference later.

Re: ASM lessons/tutorials?

Posted: Sat May 29, 2010 12:12 am
by SpooK
-----> ASM Community <-----