Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Learning x86 Assembly

Options
  • 25-05-2011 11:49pm
    #1
    Registered Users Posts: 3,735 ✭✭✭


    I've just finished first year in UL doing Comp sci & info Systems, we studied java, I'm led to believe we'll doing c/c++ in second year also. So prograaming isnt too new to me.

    We had one subject this year, comp org, I found it really really interesting, we touched on a tiny bit of machine code with it.
    We wont be doing it again next year to my disappointment.

    I'm not a fan of OO development I find it boring, but I am really keen and interested in low level hardware, would love to learn assembly, I really think this is the route Id like to go career wise after college.

    Can anyone reccomend some texts I can be studying and trying myself, to increase my knowledge of assembly, or any advice appreciated !

    Thanks
    Tagged:


Comments

  • Closed Accounts Posts: 5,482 ✭✭✭Kidchameleon


    Christ I'm a long way off learning machine code at the moment but I did happen to flick through a few books in town the other day. There was a good selection of Assembly language books in Hoggis Figgis and they looked surprisingly easy to understand...


  • Registered Users Posts: 1,071 ✭✭✭Art_Wolf


    Hmm most of the assembly we learnt was from lecture notes. This may not be what you are looking for but the book Modern Compiler Implementation in Java was great in explaining how assembly is turned into OO languages.


  • Closed Accounts Posts: 410 ✭✭JohnathanM


    You might want to take a look here:

    http://www.grc.com/smgassembly.htm

    You'll see a reference to "The Art of Assembly Language" alongside some other links which might be of use. If you are on Windows, that page also has a decent example of a simple application and links to Masm32. You're heading into HLA territory here, but it might be a decent start anyhow.


  • Registered Users Posts: 894 ✭✭✭Dale Parish




  • Registered Users Posts: 627 ✭✭✭Dboy85


    Hardcore stuff :)


  • Advertisement
  • Registered Users Posts: 3,945 ✭✭✭Anima


    What are you going to do with it though?

    These days its less and less useful to know assembly. There are some cases like fine tuning loops (done sometimes with DSP apps) but the majority of code will be written in a high level language for a few reasons.

    The compiler will do a better job most of the time. To write a big application completely in assembly is too time consuming and error prone.

    Most devices are more than powerful enough to use higher level languages. Most embedded devices will use C and even C++ / Java these days.


  • Moderators, Music Moderators Posts: 1,481 Mod ✭✭✭✭satchmo


    There are plenty of advantages of knowing assembly, but I agree that being able to program with it isn't especially useful these days. There are still cases - eg. all our low-level skinning code it written in assembly - but even then I'd argue that intrinsics might have done an as good or better job.

    I've found the most useful aspect of knowing assembly is being able to understand what the compiler is doing with your code and why. There are plenty of times I've needed to view disassembly in order to debug something. It might be because of memory corruption, diagnosing threading issues, or because of a crash that only happens in Release where you don't have any debug symbols. I'm not alone either - have a look at Elan Ruskin's excellent GDC talk, Forensic Debugging, to see how useful understanding assembly can be.

    In general, I think an understanding of assembly definitely gives a better understanding of how the CPU and related hardware works, which seems to be what the OP is after.


  • Registered Users Posts: 2,717 ✭✭✭ARGINITE


    How we learned assembly in college: Easy Pic'n and ask Micro Chip for some sample Pics and you have nearly everything you need to start a small project, the best way to learn or if your a bit more adventures try BareMetal OS a 64Bit OS written completely in assembler.


  • Registered Users Posts: 490 ✭✭Chefburns


    Have a look at ARM assembly language its very well documented and its quite simple to learn.


  • Registered Users Posts: 3,735 ✭✭✭Stuxnet


    Anima wrote: »
    What are you going to do with it though?


    These days its less and less useful to know assembly. There are some cases like fine tuning loops (done sometimes with DSP apps) but the majority of code will be written in a high level language for a few reasons.

    The compiler will do a better job most of the time. To write a big application completely in assembly is too time consuming and error prone.

    Most devices are more than powerful enough to use higher level languages. Most embedded devices will use C and even C++ / Java these days.

    well I'm not too sure atm, as I said in my first post I find so far what ive learnt in high level, boring, maybe because it's java, but I presume they all fairly similar bar syntax ?

    I have a keen interest in low level hardware, ideally I think I'd like to get involved with cpu/spu development ! I wasn't aware these can be developed in high level also ! Im just finished first year, we dont cover this stuff, Im chasing it out of my own interest....

    advice is appreciated tho !


  • Advertisement
  • Registered Users Posts: 981 ✭✭✭fasty


    C might be sufficiently low level to start with. The syntax might look familiar to Java but C maps much closer to hardware. The lower level parts of operating systems would be written in C.

    Knowing about assembly is worth it though as it helps understand the hardware. Knowing how to lay out your data structures in memory in C or C++ to play nicely with the cache, knowing the consequences of branching and doing things quickly often depend on knowing the language and the hardware.

    Plus implementing data structures in C is worth it. You'd be amazed how few people couldn't write a linked list if you asked them to!


  • Registered Users Posts: 375 ✭✭unknownlegend


    I write mostly c# day to day. Recently I've been working on an application re-write. The bulk of it was written in COBOL (financial app), however the core was written in HLASM (IBM's high level assembler). It was written in 1978, a time when an abundance of memory and processing power was NOT available and it is watertight in terms of computational efficiency and speed.

    I am quite familiar with x86, so picked up HLASM pretty quick as I wasn't writing it, just re-implementing in an OO way which has its own curious quirks. Clearly previous knowledge of a low level language has uses in modern development, though I don't expect this is a regular occurrence :)

    Knowing a low level language has huge benefits in knowing how to properly disassemble and debug code like a demon. You'll also have a deep knowledge of what the compiler does to your high level code. However, given the increase in architecture insulation (see, JIT, CLR, mono & mobile devices, etc...) use of a low level language for large scale development is realistically reserved to those interested in developing new hardware, researching new low wattage/power devices, etc.

    Still, I think programmers in general should have a good grounding in at least one assembler language. OP, check out IBMs documentation on HLASM if you want to see something that isn't the usual Intel, Motorola, et al.


  • Registered Users Posts: 3,735 ✭✭✭Stuxnet


    Thanks, very helpful :-)

    Will do


  • Registered Users Posts: 458 ✭✭tadcan


    www.showmedo.com have some video tutorials including some on assembly.


Advertisement