1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

hardware is still coded with machine/assembly language for efficiency, speed, etc.

Discussion in 'General Electronics Chat' started by PG1995, Mar 25, 2012.

Thread Status:
Not open for further replies.
  1. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    So it is better to spend more money to do the development in ASM and have a competitor release first ?
    I do not think so.
     
  2. WTP Pepper

    WTP Pepper Active Member

    Joined:
    Jan 24, 2012
    Messages:
    648
    Likes:
    41
    Location:
    UK
    When it comes to debugging, a decent ASM programmer in my experience can do it much faster if the code is modular written.
    The mind of such a good programmer is fixed on looking for stack call irregularities and corrupt/used registers.
    A C programmer can be very ignorant to whats actually going on and assume what they have written is correct.
    The Silabs USB routines are a good example.
     
  3. nsaspook

    nsaspook Well-Known Member

    Joined:
    Mar 24, 2010
    Messages:
    1,141
    Likes:
    219
    Location:
    Fairview, Or
    The C language can be structured in a modular fashion but you have to plan it that way just like a good ASM programmer would.

    http://www.eetimes.com/design/embedded/4023876/Modular-Programming-in-C

    I find it easier to write the C code first in a large file with this in mind then spilt the source into functional sections later. With a modular language (like Modula-2) you usually have to define the interfaces first with code stubs and fill in the actual implementation code later.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ratchit

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,934
    Likes:
    78

    To the Ineffable All,

    I am a control freak when it comes to programming. High level languages really turn me off, and Assembler turns me on. It appears to me that many of the things folks are disparaging here about Assembler can be overcome. So I invite everyone to state why they prefer high level to low level. I will then try to put forth a counter argument. Ready?

    Ratch
     
    Last edited: Apr 6, 2012
  6. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    The ultimate truth is that writing solid code on time allows one to spend more time with family and friends.

    In industry programmers and engineers seldom have language choice.

    True beauty flows from the mind of the programmer, not the language tools.

    A good programmer can and will program in any language required or requested.

    Use what turns your crank, but think twice prior to pushing your choice on others.

    If this thread takes a turn for the worse it will be closed. (me as moderator)
     
    Last edited: Apr 6, 2012
  7. Ratchit

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,934
    Likes:
    78
    3vo,

    And a good tool like Assembler helps the programmer do that.

    Yes, that is what industry should follow.

    Good tools help implement the innovation.

    All good things eventually come to an end.

    Ratch
     
  8. Mosaic

    Mosaic Well-Known Member

    Joined:
    Jun 3, 2010
    Messages:
    2,569
    Likes:
    128
    Location:
    Caribbean
    You're correct there spooky. The academically educated seem to be missing something. I had a young Elec Eng. produce simulated solutions of large systems but doesn't know that an LM7805 requires a DC supply. He insisted that small 3 pin reglators can go from 120VAC to 5VDC in one step. Sad, but that is what new graduates seem to be capable of.
     
    Last edited: Apr 6, 2012
  9. Mosaic

    Mosaic Well-Known Member

    Joined:
    Jun 3, 2010
    Messages:
    2,569
    Likes:
    128
    Location:
    Caribbean
    On the matter of Hi lvl vs low lvl languages. It's a matter of resources and scope and application.

    Certain questions need to be answered. What are the order of priorities?

    1) How fast the app can be produced?
    2) How much resources (ram, CPU speed, I/O) the app uses?
    3) How maintainable or portable is the code?
    4) Are you required to document the code.?

    Weigh in on those with a score and u can develop a matrix that guides the selection of the language type. Of course, if u are only comfortable with one you can always make do.
    The difference here is if u only gonna know one it's best to go with asm as it is capable of more than a hi lvl language. Especially when it comes to microsecond sensitive applications and timing precision/response.
     
    Last edited: Apr 6, 2012
  10. Ratchit

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,934
    Likes:
    78
    Mosiac,

    That depends on the skill of the programmer. I think I can write as fast in Assembler using templates, procs, previous code, cut and paste, APIs, and a well stocked library of routines. In other words, it is not fair to give an identical task to a high level (HL) programmer and a Assembler programmer, especially two neophytes, and tell them to go at it while you compare the time to code. The HL already has those "helps" within it. But a well oiled Assembler shop should also have developed those aids and be competitive with respect to speed.

    If you code in good assembly, you are doing the best that can be done. HL is bound to be slower.

    Now you have me in a pinch. No doubt about it, portability is easier with HL, but not as good as some claim. It all depends on the difference in platforms. If the high level program performs bit fiddling, then you will probably have to dig deep into the code to match the function on the destination machine.

    Always, always, always, and especially with Assembler. HL has a certain amount of documentation built into its syntax, but it still can be confusing looking at it cold.

    I already made my preference known. If I need to support several platforms, I would assign a coder, not a programmer, to translate the assembly code to another platform. Yes, assembly is the fastest that can be done, but sometimes HL fast is good enough. That has to be considered also when weighing the pros and cons.

    Ratch
     
  11. nsaspook

    nsaspook Well-Known Member

    Joined:
    Mar 24, 2010
    Messages:
    1,141
    Likes:
    219
    Location:
    Fairview, Or
    When I interviewed for the job I'm currently at 20+ years ago I had my secret weapon in the bag. After all the questions about qualifications and education I was asked about hobbies so I showed the guy my S100 wirewrap 8080 cpu and TLL logic ntsc video card I designed and built for a DIY game machine that played mastermind. (yes, it was coded in 8080 assembly) http://en.wikipedia.org/wiki/Mastermind_(board_game)
    http://mysite.verizon.net/res02dad/sitebuildercontent/sitebuilderpictures/ht_pictures_012.jpg

    I was given an offer and after a little back and forth on a few issues was accepted that day. The value of building things seems to be lost on some in academia with the massive push of theory and math problems instead of practical applications created from real hardware and software. I was on the electronics technicians advisory board for the San Diego CC district and was always pushing for more lab time for students instead of just stupid tricky questions that only show you can take a test.
     
    Last edited: Apr 6, 2012
  12. colin55

    colin55 Well-Known Member

    Joined:
    Feb 14, 2009
    Messages:
    3,534
    Likes:
    82
    Location:
    Melbourne Australia
    nsaspook . . . I suggest you go to "Resume Dilema" and relate your story. What you have said is exactly what I related. A project is worth a thousand words.
     
  13. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    I prefer C, which is not a high level language. I really hate things like the "Arduino IDE".
     
  14. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,228
    Likes:
    641
    Location:
    Derbyshire, UK

    Except C IS a high level language - how can you suggest otherwise?.
     
  15. nsaspook

    nsaspook Well-Known Member

    Joined:
    Mar 24, 2010
    Messages:
    1,141
    Likes:
    219
    Location:
    Fairview, Or
    C is only a high level language to a assembly language programmer. ;) C has minimalism as it's base principle.
    http://cm.bell-labs.com/cm/cs/who/dmr/chist.html

     
    Last edited: Apr 7, 2012
  16. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,228
    Likes:
    641
    Location:
    Derbyshire, UK
  17. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    From your perspective yes.

    One problem with this thread is that people posting to it have different perspectives.

    I doubt saying anything here will change anyone's mind.
     
    Last edited: Apr 7, 2012
  18. cr0sh

    cr0sh Member

    Joined:
    Jul 10, 2010
    Messages:
    928
    Likes:
    17
    Location:
    Phoenix, Arizona
    The IDE itself could use some improvement, definitely - but for it's core audience, it works extremely well, and those improvements would likely only cause further confusion for that audience.
     
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    The 'C' language has been referenced as a high language ever since assembly superseded typing in machine code from a hand written hex/object code list.

    Basic which uses a compiler is considered a high language and C is just another form of that original Basic family.

    http://www.webopedia.com/TERM/H/high_level_language.html
     
    Last edited: Apr 7, 2012
  20. Ratchit

    Ratchit Well-Known Member

    Joined:
    Mar 12, 2008
    Messages:
    1,934
    Likes:
    78
    I consider any computer language, which emanates an instruction sequence that cannot be duplicated by "procs" or "macros", a high level language. I believe C is in that catagory because it can generate instructions to implement a high level construct that cannot be duplicated by procs or macros no matter how skillful the programmer is. This is especially true of array manipulation, when HL automatically requests more storage from the OS.

    Ratch
     
  21. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,187
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi Ratch,
    If I am understanding correctly what you saying regarding 'complexity' , its a fact that 'C' libs are written using assembler.

    So surely someone must be able to write these 'complex' libs using assembler.

    Your post #119 is a little ambiguous. [ to me] are you defining the actual program or the compiler directives.?

    E.
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page