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

adding all digits in a number, MCU 8051

Discussion in '8051/8951' started by PG1995, Mar 31, 2012.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    It appears from the error warning that it can use -120 for a constant....BUT!!! the constant is an integer ie... it complains that the decimal "65416" is TOO big..

    You may have to define constant's as 8 bit!

    I'll also check the labeling as I think the underscore "_" isn't allowed in the middle of an identifier.... It can be at the front, but nowhere else!
     
  2. Jon Wilder

    Jon Wilder Active Member

    Joined:
    Oct 22, 2010
    Messages:
    859
    Likes:
    82
    Location:
    Fresno, CA
    Part of the fun in coding in assembly is learning how to do the conversions yourself! If you want to code in a language that does the math for you, you should be coding in C.
     
    Last edited: Jun 18, 2012
  3. Jon Wilder

    Jon Wilder Active Member

    Joined:
    Oct 22, 2010
    Messages:
    859
    Likes:
    82
    Location:
    Fresno, CA
    And we're probably the only two with MCS-51 knowledge that do! lol
     
  4. dave

    Dave New Member

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


     
  5. PG1995

    PG1995 Active Member

    Joined:
    Apr 18, 2011
    Messages:
    1,645
    Likes:
    13

    Hi Jon

    See now I have created a new thread but I'm not getting any reply! :( I'm sure I would have received a reply so far had I posted that question here.

    Regards
    PG
     
  6. Jon Wilder

    Jon Wilder Active Member

    Joined:
    Oct 22, 2010
    Messages:
    859
    Likes:
    82
    Location:
    Fresno, CA
    OK...you need to understand that we people have lives outside of this forum. We're not constantly monitoring it 24/7 and we are not obligated to just drop everything whenever you need help. You want fast answers, try logging onto the ETO chat via the chat link above. But even then we're not 24/7 tech support.

    I'm responding to your other thread now.
     
  7. PG1995

    PG1995 Active Member

    Joined:
    Apr 18, 2011
    Messages:
    1,645
    Likes:
    13
    Hi Jon

    I'm sorry. Perhaps, I should have phrased it differently. I understand that everyone of you has a lot of other stuff to do in personal lives and I'm very grateful for the help I receive from you guys. You should reply only when you have time and feeling comfortable. Actually my last post wasn't meant to be very serious one! Many thanks for being there to help me with many queries.

    Best wishes
    PG
     
    Last edited: Jun 18, 2012
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    The other thing you should note.... If I read your post, or anyone else's post, If there is code involved I tend to copy and paste it into my simulator to try it... test it... observe it. Then I will reply.

    I have actually written a program in VB6 ( with simulated LED's ) to show truth tables... simple switches. It was specifically designed so I could work out LCD graphical animation and what to expect, but it works as a great boolean algebra tool....
     

Share This Page