HOW DOES PBP handle bits varables to bytes


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,722


    Did you find this post helpful? Yes | No

    Default Re: HOW DOES PBP handle bits varables to bytes

    bit_byte1 var byte
    bit0 var bit_byte1.0
    bit1 var bit_byte1.1
    bit2 var bit_byte1.2
    bit3 var bit_byte1.3
    bit4 var bit_byte1.4
    bit5 var bit_byte1.5
    bit6 var bit_byte1.6
    bit7 var bit_byte1.7


    uses 1 byte

    mybit var Bit

    uses 1 byte

    mybit0 var Bit
    mybit1 var Bit


    I think uses 2 bytes .

    you can verify this by checking your ????.lst file after compiling ????.pbp

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,177


    Did you find this post helpful? Yes | No

    Default Re: HOW DOES PBP handle bits varables to bytes

    Quote Originally Posted by richard View Post
    [COLOR="#00FF00"]bit_byte1 var byte
    mybit0 var Bit
    mybit1 var Bit


    I think uses 2 bytes .
    Not necessarily. Compiler makes best use of memory and packs the bits in bytes when possible.

    So if you declare the above bit variable, they are going to be in one byte. The ninth bit will be in new byte location.

    Ioannis

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Configuation bits setting in PBP
    By Max_Gauss in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th September 2010, 18:25
  3. Pickit 2 saving varables?
    By jessey in forum Off Topic
    Replies: 5
    Last Post: - 7th June 2010, 09:14
  4. 16/32 bits PIC support in PBP?
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th May 2010, 15:40
  5. Bits & Bytes
    By electronicsuk in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th April 2006, 11:52

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