LCDOUT Question? Please Help


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2011
    Posts
    4

    Default LCDOUT Question? Please Help

    Hi,
    I am new in this wonderful forum.
    I was wondering if someone can help me on this one:

    d VAR BYTE
    d=%00010110
    LCDOUT BIN (d)

    The LCD displays "10110", cause the leading zeroes are omited!
    So, How to make it to always show the whole thing? - i.e. "00010110"

    Thanks in advance!

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: LCDOUT Question? Please Help

    I think you will find what you are looking for in the manual listing under serout2, I know, that's not where you would expect to find it but it's there. It (the manual) explains it better than I can.
    From the manual:
    Code:
    BIN, DEC and HEX may be preceded or followed by several optional parameters.  If any of them are preceded by an I (for indicated), the output will be preceded by either a A%@, A#@ or A$@ to indicate the following value is binary, decimal or hexadecimal.
    If any are preceded by an S (for signed), the output will be sent preceded by a A-A  if the high order bit of the data is set.  This allows the transmission  of negative numbers.  Keep in mind that all of the math and comparisons  in PBP are unsigned.  However, unsigned math can yield signed results.   For example, take the case of B0 = 9 - 10.   The result of DEC B0 would be A255".  Sending SDEC B0 would give A-1" since the high order bit is sent.  So with a little trickery, the unsigned math of PBP can yield signed results.
    BIN, DEC and HEX  may also be followed by a number.  Normally, these modifiers display  exactly as many digits as are necessary, zero blanked (leading zeros are  not sent).  However, if a number follows the modifier, SEROUT2  will always send that number of digits, adding leading zeros as  necessary.  It will also trim of any extra high order digits.  For  example, BIN6 8 would send A001000" and BIN2 8 would send A00".
    Any or all of the modifier combinations may be used at once.  For example, ISDEC4 B0.

    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Apr 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: LCDOUT Question? Please Help

    Thank you so much!
    This really helped me a lot!

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts