Results 1 to 10 of 10

Thread: Beginning to learn Assembly

  1. #1
    Join Date
    Jan 2007
    Beans
    91
    Distro
    Ubuntu 10.04 Lucid Lynx

    Beginning to learn Assembly

    I am considering to start learning assembly. I have been searching the net about assemblers but I am totally confused now.

    I want to ask if assemblers or the codes you write and assemble are machine or operating system dependent. (and i guess the code is probably assembler dependent right)

    And

    Which assembler should I use as a start, actually what is the first step in starting to learn programming with assembly.

    thanks.
    Nature and nature's laws lay hid in night;
    God said "Let Newton be" and all was light.

    "epitaph of Newton by Alexander Pope"

  2. #2
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,712
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Beginning to learn Assembly

    Yeah, assembly compiles to machine code, which isn't portable due to differences in executable formats.

    My advice would be to start with either FASM or NASM. I use GCC's "GAS" a lot to optimize C/C++ programs manually, but GAS isn't very standard syntax assembly and might not be the best to learn (unless of course you plan to work with GCC assembly dumps or GCC inline assembly)

    NASM is very common these days, and both FASM and NASM are free!

    Good luck, btw. You should search these forums because somewhere I posted a bunch of links for beginner assembly stuff.

  3. #3
    Join Date
    Nov 2006
    Beans
    Hidden!

    Re: Beginning to learn Assembly

    i would recommend taking a class on computer architecture. it's really neat to understand the datapath & control when you write assembly. very interesting stuff. before i took that i was always curious about how these things really work at the lowest level, and when it all made sense it was really cool.

    but it's not a requirement. i've never written assembly in industry, but the class used mips for assignments. i thought was a pretty good language to learn the concepts with - i would guess that it would be easy to pick up a practical language after that, but you may just want to start with one right away. just google for learning assembly, i'm sure there's lots of good info out there.

  4. #4
    Join Date
    Jan 2006
    Beans
    961

    Re: Beginning to learn Assembly

    Do a search for "Programming from the Ground Up" at google. It'll take you from the very beginning with both theory and hands-on stuff.
    Last edited by lnostdal; January 20th, 2007 at 09:54 AM.

  5. #5
    Join Date
    Apr 2006
    Location
    in the dark
    Beans
    1,513

    Re: Beginning to learn Assembly

    Do you have much of a clue about what assembly is used for? The only thing Ive ever used it for was for programming an intel based microcontroller. Which is really the only thing people use it for nowadays, embedded programming. Make sure you have a purpose for learning it before jumping straight into the deep end.
    Imagination is more important than knowledge

  6. #6
    Join Date
    Dec 2004
    Beans
    60

    Re: Beginning to learn Assembly

    one frustrating thing with asm is it doesn't provides easy ways to print values on screen, if you start practicing asm programming you will have to write long listings of code and then pray for all that thing to work, because you can't know what's going on inside... or you can start writing you own print procedure in asm but how to do it if you've just started learning...

    so, my advise is don't learn asm using nasm only, use nasm + gcc: http://www.csee.umbc.edu/help/nasm/sample.shtml

    at least you can debug your code with printf

    excuse my english

  7. #7
    Join Date
    Dec 2006
    Location
    Uk
    Beans
    109

    Re: Beginning to learn Assembly

    It's easy enough to link with libc and other libraries from asm. Also a debugger like gdb will let you debug asm just like other languages. You can set break points, step through code, examine registers and memory and so on.

  8. #8
    Join Date
    Jun 2006
    Beans
    Hidden!
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Beginning to learn Assembly

    Figure out how to do logging because you're likely going to need it.

  9. #9
    Join Date
    Oct 2006
    Location
    Austin, Texas
    Beans
    2,712
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Beginning to learn Assembly

    Assembly is still useful to learn... Why program in other languages when you don't have the slightest clue what is going on when a command executes? It gives you a lot of insight into that.

    About printing values... You can actually call C library functions from assembly if you link them, it's not that hard, but you might want to learn GAS for that (you can use GCC to assemble it and it's super easy to do).

  10. #10
    Join Date
    Mar 2006
    Location
    Sheffield, UK
    Beans
    322

    Re: Beginning to learn Assembly

    MenuetOS is a project of an Operating System written entirely in Assembly, you can download and study the source code at:

    http://www.menuetos.net/

    cheers

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •