Incrementing Upper Nibble Only (HighNibble)


Closed Thread
Results 1 to 4 of 4

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Incrementing Upper Nibble Only (HighNibble)

    how to set just the high bits to some number?
    number var byte
    somenumber var byte

    number =$11
    somenumber =2

    number =(number&$f) |( somenumber<<4 );note (for a meaningful result somenumber <16)

    result number=$21
    Last edited by richard; - 6th March 2015 at 22:37. Reason: add some more brackets just in case

  2. #2
    Join Date
    Jul 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: Incrementing Upper Nibble Only (HighNibble)

    Richard,

    Wonderful! Works beautifully!

    number var byte
    number=number+16 will increment high nibble

    Again, very clean and easy.

    Thank you very much!

    Jay Zebryk
    Zebryk Engineering
    Southbridge, Massachusetts
    www.zebryk.com

Similar Threads

  1. 32 bit seconds math (how do I include the upper 16 bits?)
    By Heckler in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 5th February 2015, 04:46
  2. Combining 4 nibble to 16bits
    By isaac in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th November 2006, 22:40
  3. Accessing the upper 64Kbytes with READCODE
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th March 2006, 22:22
  4. Incrementing Help
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st April 2005, 22:57
  5. writecode at upper half of 128K parts?
    By Tomasm in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd November 2004, 20:02

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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