Assembly -- for the curious

Discussion in 'Mac Programming' started by mac2x, Nov 1, 2011.

  1. mac2x macrumors 65816

    Joined:
    Sep 19, 2009
    #1
    Hi all,

    I've become interested of late in obtaining a greater understanding of what goes on at the lowest levels of a computer. It seems that assembly is one place to do that.

    I am quite aware that assembly is highly processor dependent. Since I merely want to learn the fundamentals, I don't need the head spinning processor manuals Intel offers. I'm thinking some kind of emulator.

    I've been messing with emu8086 on windows, but it's shareware and I'd rather have something open source.

    What do you guys recommend?


    PS -- I've read Cromulent's thread from a few years ago already, but it did not answer my question.

    PPS -- I am fairly competent with C, though by no means an expert. Just to give a little perspective on my skills. I've also been doing some C++ and C#, but haven't had much time for those due to other obligations.
     
  2. jiminaus, Nov 1, 2011
    Last edited: Nov 1, 2011

    jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    This is just an idea that came to mind.

    Donald Knuth's classic books The Art of Computer Programming are written in a factitious assembler called MIX. If you were to read these, you would not only get used to working in low-level assembler, you'll also gain some excellent (not so) ancillary knowledge as well.


    There are other IA32/x86-64 emulators out there. QEMU http://wiki.qemu.org/Main_Page. Bochs http://bochs.sourceforge.net/


    This book might interest you: http://www.amazon.com/Professional-Assembly-Language-Programmer/dp/0764579010

    This is the book I learnt assembly programming from (back in the day): http://www.amazon.com/Assembly-Language-Primer-Personal-Computer/dp/0136619010


    At Uni (a while ago), we learnt MIPS32 assembly using SPIM http://pages.cs.wisc.edu/~larus/spim.html. Seems to have been "superseeded" by MARS http://courses.missouristate.edu/KenVollmar/MARS/.
     
  3. mac2x thread starter macrumors 65816

    Joined:
    Sep 19, 2009
    #3
    Wow, thanks for the suggestions!


    Funny thing, I've been looking for an excuse to buy Knuth's books. Maybe a Christmas present for myself. =)

    Looks like SPIM has a new version written with QT (QtSPIM); it looks pretty sharp.
     
  4. Jest3r macrumors regular

    Joined:
    Nov 22, 2010
    #4
    I got my start to low level programming thru debuggers and reverse engineering. If you are a hands on kind of person, there are a lot of sites out there with sample simple applications and tutorials for debuggers such as Olly (Win 32,) etc.
     
  5. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #5
    Qemu is great, but I would not pick an x86 emulator, but something like Vice to emulate a c64 and 6502 with all system functionality memory mapped. :D
     
  6. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #6
    Just run XCode 4, set a breakpoint, turn on "Show Disassembly when debugging", and step through individual instructions.

    And go to www.intel.com and download their processor manuals.
     

Share This Page