Move seperate bytes into a word


Results 1 to 19 of 19

Threaded View

  1. #1

    Default Move seperate bytes into a word

    How can I combine these bytes into a word size variable? I am using only four bits of the bytes "0-3" and would like to place them into a word in such a way that "Z" holds A= 0-3, B= 4-7, C=8-11,and D=12-15.
    Example:

    A=%00000001
    B=%00000010
    C=%00000011
    D=%00000100

    Z=0100001100100001

    I was thinking of using Aliases in the manual but not sure if that was a way to do it.

    I really didn't want to do this:
    z.0=a.0
    z.1=a.1
    etc.
    Thanks
    Last edited by tazntex; - 11th November 2008 at 19:23.

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. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

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