Announcement

Collapse
No announcement yet.

Assembly Programming

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Assembly Programming

    Here is my delima, I've been learning assembly language for quite some time now. I've spent the past few weeks messing with it, even read up to page 250 in this step-by-step assembly book. My main concern is when will I be able to apply this knowledge in any type of real-world sense? I have a lot of experience with other higher level languages(including c++) and the even higher level languages xD(php :/).

    I'm getting bored with these trival examples that the book gives me, and the ones I come up with by myself to help me better understand certain instructions. Is there anything interesting I can write in assembly, just to get my feet wet. I'm not asking to write some huge piece, just something to keep my curiousity content and the knowledge flowing.

    Any ideas?

    Thanks
    John

    Edit:
    On another note, I've been reading up on asm for the z80 chipset. It looks interesting, after all writing applications that would be able to run on my ti calculator does sound interesting. Any input?

  • #2
    You will probably get really good responses from people like Lost or Bascule, but I'll chime in. Assembly programming is a really good skill to have, especially if you want to work in INFOSEC with exploit code, scripting, or software security testing. If you want a challenging project with it, check out the Robot Warez contest or the IP Appliance contests for DC13, really great way to exercise your skills and have fun doing it.
    Aut disce aut discede

    Comment


    • #3
      Originally posted by dark2k1
      Any ideas?
      Understanding asm can sometimes help with debugging. It can help you if you are doing reverse engineering and do not have a "decompiler". It can help you with understanding how code in a higher language may be more efficient when coded one way compared to another. It allows you to better understand buffer overruns and the risks associated with uncheck buffers. If you plan to go into embedded firmware, there is a shrinking market for asm (as a result of the growth in other areas of embedded devices.)

      Comment


      • #4
        Yea pretty much, these are the main reasons why I'm learning assembly rather than some other higher level language...

        - gain a better understanding of cpu architecture, memory, and so much more.
        - its challenging(more than other languages), I guess I could put it on a resume or something?
        - reverse engineering, for fun I guess(fun? lol)
        - fun (lol I got to be kidding myself)
        - understanding certain exploits better and how to avoid them

        Comment


        • #5
          Assembly programming is a great skill to have. Few people know it.

          I don't know if this is the one you're reading or not, but probably the best book on Assembly programming is Assembly Language Step-by-step by Jeff Duntemann. It's been a best-seller in technical books for years, and has been updated a number of times. In fact, I see it's now updated to include Linux. Looks like I need to get a new copy.
          Thorn
          "If you can't be a good example, then you'll just have to be a horrible warning." - Catherine Aird

          Comment


          • #6
            People always tell me I'm insane because I love to code in Assembly....don't listen to them. Check out many of the EE departments in universities, and you'll see more and more the NEED for engineers of many types to understand assembly. There has always been a gap between the hardware and software people, and I regard assembly as the bridge. Many ICs are all about the properly coded assembly these days- programmable chips, etc. How many embedded devices do you see around you every day? While learning assembly, don't limit yourself to a particlular architecture- look at as many as you can. Everyone that I know who has learned to code in assembly says that it changes the way they code in C (or C++), because they have a some what deeper understanding of what the compiler is doing.

            Real world? Device drivers. Bioses (in some cases), microcontrollers, the list is endless. Assembly forces you to make your code clean and efficient.

            A good chip to play with is the Motorolla 68HC11. Not *too* limiting, but not *too* powerful (as far as microcontrollers go)-

            It really depends on what your end goals are; i.e. why do you want to learn assembly? It tends to be the gateway to the world of hardware for many. In many schools CS majors don't see assembly, while CSEs do. And as I said before, many EE departments are starting to teach assembly- a low level way to talk to your hardware....

            Don't know if that's what you were looking for...

            LosT

            Comment


            • #7
              If you're getting bored with the examples from the book you're reading, you may want to try compiling C/C++ stuff to the assembly source, without actual assembling. (-S for gcc) .. try to figure out what the compiler did to the program you wrote to generate the code, try to cut the code size in half (w/ gcc should be easy) .. just an idea to get a feel for what is going on normally.

              Keep in mind, that'll generate AT&T syntax asm, where you might prefer nasm/intel syntax. There is a flag in gcc for that as well, but I can't remember it and I'm too lazy to look it up.
              a pc-0x90 by any other name is a nummish..
              Bigger 1:23

              Comment


              • #8
                Originally posted by pc-0x90
                If you're getting bored with the examples from the book you're reading, you may want to try compiling C/C++ stuff to the assembly source, without actual assembling. (-S for gcc) .. try to figure out what the compiler did to the program you wrote to generate the code, try to cut the code size in half (w/ gcc should be easy) .. just an idea to get a feel for what is going on normally.

                Keep in mind, that'll generate AT&T syntax asm, where you might prefer nasm/intel syntax. There is a flag in gcc for that as well, but I can't remember it and I'm too lazy to look it up.

                This is a really great idea. I do this occasionally when I'm bored and feeling unoriginal. Even if you don't have your own code to try compiling (ie, when I'm feeling too unoriginal to code something myself), you can try with (preferably smaller) software you find online. Doing it that way you also get the added encentive of having to figure out exactly what the C/C++ does first. Learning ++

                -zac-
                %54%68%69%73%20%69%73%20%6E%6F%74%20%68%65%78

                Comment


                • #9
                  Would you recommend learning Assembly right off, or should I get the hang of some other language(s) first, and what other language(s) would you recommend (if any at all) ?
                  The only stupid question is the one that you dont ask.
                  Or the one that ends up in dev/null.

                  Comment


                  • #10
                    Originally posted by enCode
                    Would you recommend learning Assembly right off, or should I get the hang of some other language(s) first, and what other language(s) would you recommend (if any at all) ?
                    you can learn assembly straight, although it may take a bit more self control, because it takes longer to see results.

                    Generally, learning C doesn't hurt because it's so common, and can be helpful in learning assembly.

                    Alternatively, some people prefer the level of abstraction provided by languages such as Python, Java or C# (*bias warning* I'm a C# guy, it's not necessarily great for everyone, but I like it)

                    It really depends on what you want to do, and how much time you want to spend working on it. So there's really no definitive answer in terms of languages.
                    a pc-0x90 by any other name is a nummish..
                    Bigger 1:23

                    Comment


                    • #11
                      There's certainly plenty of job opportunities for assembly programmers, but of course it all ultimately comes down to what ISAs you know.

                      If you learn PPC/AltiVec assembly well you can seek out a job anywhere in the creative software market. This would include companies like Adobe, Quark, Steinberg, Avid, DigiDesign, Apple, Propellerhead, etc. All of these companies seek to optimize their software as much as possible on the PowerPC platform, and assembly is one chief way to do it. Optimizing inner loops is always key here, but often times the math is going to get pretty involved. Implementing a Fast Fourier Transform in assembly is not fun :(

                      Game programming firms, at least those developing games exclusive to a platform, will usually program as close to the metal as they can to eek out all the performance they can possibly get and stress the platform to its limits. Many American game designers, such as Naughty Dog, Insomniac, and Sucker Punch are posting job openings though, but in creative places where they expect to find good programmers such as Franz's Allegro Lisp forums.

                      Then there's the exciting world of microcontroller programming, although it's getting to the point where a complete x86-compatible microcontroller package is costing less than a dollar. If you've learned x86 assembly, this is definitely an area you may want to get into.
                      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B0
                      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B1
                      [ redacted ]

                      Comment


                      • #12
                        bascule, are you speaking for recent experiences? My casual observation of the current environment is a strong tendency away from assembly programming (as you point out in your last paragraph).

                        The platforms have gotten fast enough that many game companies don't optimize at the assembly level and some even utilize virtualizing platforms to aid in cross-platform compatibility.

                        Apple will continue to hire assembly programmers, but they are also responsible for an operating system. Are they actively seeking low-level programmers for the next version of Final Cut Pro?

                        There is a corollary here, though: as assembly jobs dry up and programmers move onto other areas, the remaining assembly programmers will be able to demand higher salaries.

                        Comment


                        • #13
                          Originally posted by Voltage Spike
                          bascule, are you speaking for recent experiences? My casual observation of the current environment is a strong tendency away from assembly programming (as you point out in your last paragraph).

                          The platforms have gotten fast enough that many game companies don't optimize at the assembly level and some even utilize virtualizing platforms to aid in cross-platform compatibility.
                          The studios I listed all develop for a single platform (PS2) and were actively seeking assembly programmers. Here's a paragraph from Naughty Dog's job listing. Naughty Dog, if you're not aware, is the developer behind the popular Jak & Daxter series:

                          Do you shake your head in disgust when someone claims that today's C++ compilers make assembler coding unnecessary? Do you consider an idling processor in a multi-processor system to be a shameful waste of a resource? Do you count clock cycles? Do you think about parallel instruction dispatching? Do you worry incessantly about data & code caches misses, and agonize about how slow RAM is these days? Experience with rendering, pixel shaders, animation systems, and multi-processor systems are all a big plus. The more rendering or assembler experience the better. We are looking for only the serious, hard-core low-level programmer; so don't bother applying unless you are truly gifted in this area.
                          45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B0
                          45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B1
                          [ redacted ]

                          Comment


                          • #14
                            Originally posted by dark2k1
                            Here is my delima, I've been learning assembly language for quite some time now. I've spent the past few weeks messing with it, even read up to page 250 in this step-by-step assembly book. My main concern is when will I be able to apply this knowledge in any type of real-world sense? I have a lot of experience with other higher level languages(including c++) and the even higher level languages xD(php :/).

                            I'm getting bored with these trival examples that the book gives me, and the ones I come up with by myself to help me better understand certain instructions. Is there anything interesting I can write in assembly, just to get my feet wet. I'm not asking to write some huge piece, just something to keep my curiousity content and the knowledge flowing.

                            Any ideas?

                            Thanks
                            John

                            Edit:
                            On another note, I've been reading up on asm for the z80 chipset. It looks interesting, after all writing applications that would be able to run on my ti calculator does sound interesting. Any input?
                            Take a look at www.masmforum.com and www.win32asmcommunity.net .. Maybe they can give you some inspiration..
                            -- dev_zero@

                            Comment

                            Working...
                            X