Learning assembly

Discussion in 'Programmer's Corner' started by guitarguy12387, Apr 6, 2010.

  1. guitarguy12387

    Thread Starter Active Member

    Apr 10, 2008
    359
    12
    Anyone have or know of any good resources for learning assembly language? Particularly for DSP applications?

    Thanks!
     
  2. kohlrak

    New Member

    Apr 7, 2010
    14
    0
    The preferred resources depend on the CPU you plan on programming for. For example, if you're working on an x86, you might want to consider AMD's or Intel's programmer manuals. The reason for this is because each family has it's own instruction sets.
     
  3. guitarguy12387

    Thread Starter Active Member

    Apr 10, 2008
    359
    12
    Ohh okay that makes sense. Well its for DSP applications so something more along the lines of TI's C55xx series chips or something rather than x86.

    So should there be a TI assembly programming manual type of thing?

    I am a bit concerned that they will assume some knowledge of assembly, which i have none...
     
  4. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    most DSP applications/Programs written for microcontrollers are usually better written in C or another high level programming language other than assembly, especially when running FFT algorithms or routines..... there just isn't a very efficient way of doing those calculations in assembly...


    My .02

    B. Morse
     
  5. kohlrak

    New Member

    Apr 7, 2010
    14
    0
    Believe me, this isn't a problem. Assembly is entirely different between chips. However, something you may need to understand is the arch... That is, what all it assumes it has, what it's registers are, etc. You need as much as possible about your chip itself, which helps greatly in learning the instruction set.
     
  6. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
  7. guitarguy12387

    Thread Starter Active Member

    Apr 10, 2008
    359
    12
    Hmm can you be more specific? Cuz this seems to go against everything i've found/been told on the subject... in fact, TI's DSPLib functions are all in assembly for efficiency...

    Ooohhh okay cool! Good to know. I will dig around a bit more. So the assembly programming manual should be included with all the other datasheets for the chip i assume, right? Thanks again for the tips!

    Interesting! Yeah, i've seen the source code and whatnot... i just don't have the slightest clue what i am looking at haha. I don't know assembly syntax even... other than a semi-colon means a comment haha! Good resource though, thanks!
     
  8. kohlrak

    New Member

    Apr 7, 2010
    14
    0
    Except scripting languages, languages with emulated machine code (java), and basic (considered by some to be an assembly dialect) are compiled into assembly. Therefore, assembly makes nice glue between various other languages. Many languages, including C/C++, have an __asm directive to include assembly code in it. Once something is in assembly, it's hard to identify what language it originated in. Though, for all intents and purposes, since it's written in asesmbly, it theoretically would be no problem to interface those libs with assembly, too. It depends a bit on the libs, though.

    Usually it's a separate manual, but yes, it SHOULD be among them (reality is much different, however, as many devices are closed and so forth).

    Assembly syntax varies between assembler, not even the cpu. Compare GAS and FASM syntaxes for the x86, and you'll find that the "destination oprand" and the "source oprand" are swapped.

    Code ( (Unknown Language)):
    1.  
    2. ;Copy ebx into eax
    3. mov eax, ebx ;Fasm/masm/(in fact, most common syntax)
    4. movd %ebx, %eax ;GAS (I hate gas, so i'm not 100% sure on the specifics here.)
    5.  
     
Loading...