Is assembly language a universal uC programming tool ?

Discussion in 'General Electronics Chat' started by LETITROLL, May 26, 2014.

  1. LETITROLL

    Thread Starter Member

    Oct 9, 2013
    218
    2
    Hello everyone here .

    While reading on multiple micro-controllers datasheets but mainly in PICs family , i see that the majority of their manuals use assembly as a main programming language to explain the usage.

    Can this language be used to program all kinds of micro-controllers ?
    Is it some sort of micro-controller standard industrial programming language aimed for a strong performance ?
    Is it more reliable than other languages like C and Pascal for instance ??

    Am asking this because i would like to know witch road to follow in this specific field .
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    There is no standard.

    Every microcontroller (mcu) manufacturer creates their own mcu architecture and assembly (asm) language.

    Knowledge of one mcu asm language transfers well to another mcu. If your goal is to get a project up and running you don't need to know asm. C is the preferred programming language.

    If you want to be an expert at embedded systems design, learn asm first.
     
  3. LETITROLL

    Thread Starter Member

    Oct 9, 2013
    218
    2
    Am starting to think about going on the ASM road , its just seems more professional .

    Is this a god book btw ?
    [​IMG]
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    It is well known that I do not like Microchip PIC ASM.

    My choices would be Atmel AVR, Freescale HC11 or HC12 or 6805 derivatives, or TI MSP430.
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,542
    2,369
    If you decide to go the Assy/Picmicro route there is a really good tutorial by Nigel Goodwin http://www.winpicprog.co.uk/pic_tutorial.htm
    Also http://www.gooligum.com.au/
    There is a lot of projects out there for the 16f series, but if pursuing assy, I would recommend gravitating over to the 18F series, the instruction set is improved.
    There is a really good book by Han-Way Huang (Minn Univ) covering both Assy and some C for the 18F, it is out there in PDF or I got a brand new copy with an unsealed CD from AbeBooks clearing house for a few $'s.
    If you need the PDF book, PM an email.
    Max.
     
  6. Art

    Distinguished Member

    Sep 10, 2007
    785
    61
    A higher level language like C or BASIC can help you learn assembler so long as you can find
    a tool to disassemble the file produced by a compiler.
    That way you can make small changes in the higher level languages and see what it does with assembler.
    From there you can start to see what it doesn't get right and optimise from there.

    Most if not all compilers should allow the free use of assembler inline too,
    so you don't have to discard an entire high level language program just because you'd
    prefer to do a little of it in assembler.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Assembly is used by a very small minority of programmers in very special areas.

    I know assembly, I use it in only a very small minority of programs for very special reasons.
    God doesn't write books. I've never read it. If you post a link (or even write the title) I'll take a peek.
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,142
    1,790
    I think you will get a significant argument on this score. You can write good code in any language, but assembly language makes it incredibly easy to write truly awful code. In a professional environment you have to think about reliability, documentation, and maintenance. These three things and may others are very difficult to manage with code written in assembly language.
     
    ErnieM likes this.
  9. LETITROLL

    Thread Starter Member

    Oct 9, 2013
    218
    2
    Thanks max for the book suggestion , i sent you an email BTW .

    As for witch microcontroller i ll be using its not just PICs but also other brands like Intel or Samsung,winbond,tochiba , witch don't use C language i guess ??
     
    Last edited: May 26, 2014
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Not to mention time to market. It does not make sense to have person coding weeks in asembler then coding in C will bring a solution in one week.
     
    Papabravo likes this.
  11. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,542
    2,369
    If you compile code in relative rather than absolute, routines can be called from one's own library just as in C.
    Max.
     
  12. Fibonacci

    New Member

    May 23, 2014
    25
    5
    I agree with other members. I taught for 30 years 6809 first and then 8051 family using assembly language. However things had changed from 10 years ago, toward use of high level languages for microcontroller programming, like C. It depends the application, all microcontrollers are good, but you must learn using friendly platforms like Arduino IDE, programming in a language based in Wiring, (C, but easiest). If you need more processing tools, the giant INTEL introduced Galileo board in this year, a powerful IDE, hardware and software full compatible with Arduino. Last semester, here at ITESM campus Juarez, in México, I taught 8051 Microcontroller assembly language and C ,as in the last 15 years, but when my students implemented final proyects, everybody used Arduino IDE. Proyects like robotic arm, 8X8X8 LED cube, vumeter, intelligent alarm, pulsemeter, etc. Something is happening.
     
  13. Papabravo

    Expert

    Feb 24, 2006
    10,142
    1,790
    I thought that was too obvious to even mention.:D
     
  14. LETITROLL

    Thread Starter Member

    Oct 9, 2013
    218
    2
    Well looks like C is the chosen one after all , ASM for optimization .
     
  15. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,542
    2,369
    If you go to the Microchip forum site et-al, there are still many programmers that program in assembly, many like me who were introduced to it with the Intel 8085 etc.
    The subject has been done to death, and of course you are always going to hear negativity from those that are more comfortable in C etc.
    It simply comes down to personal preference.
    Max.
     
  16. LETITROLL

    Thread Starter Member

    Oct 9, 2013
    218
    2
    Actually am leaning more towards the ASM mainly because it should give a deep look inside the MCU composition , and then makes it more controllable in every part of the architecture .

    I don't know if this is the right sentence , but programming in ASM is like building a car without robots involved .:)
     
  17. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I would say, if this is just for learning or hobbyist work. It will not matter much what you use. Just use the approach you like best, and have fun
     
  18. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    Which language is better for the uC?
    I think it depends on what you want to be, a professional programmer or a hobbyist or just a part time player.

    The asm language can be reach to the very deep for every kinds of hardware, and you can get the speed more fast, and just using less space of the eeprom memory, it also easy to get a wrong code, but it can be reduce when you got more experience.

    As the 8051 also has the BASIC version, that is more easier to study, but it will also spend more space of eeprom memory and lower speed.

    You can also using the C as the main program and call the asm as a C function, when you writing the asm subroutine as a C function then you writing the asm will be similar as C.
     
  19. LETITROLL

    Thread Starter Member

    Oct 9, 2013
    218
    2
    Indeed am hoping to be a professional embedded systems programmer and also designer .
     
  20. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,542
    2,369
    Knowing how to converse with the processor in its 'native' language is not all that bad, and the vocabulary only consists of around 50 some odd words.:cool:
    Max.
     
Loading...