Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:01:17+00:00 2026-06-14T21:01:17+00:00

If a 16 bit value is stored (in a pic microcontroller) as a High

  • 0

If a 16 bit value is stored (in a pic microcontroller) as a High byte and Low byte, how do you go about dividing them by 2? How can a 16 bit number be rotated right?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:01:17+00:00Added an answer on June 14, 2026 at 9:01 pm

    Dividing a 16-bit number by two is equivalent to shifting the number right by a single bit*. Clear the carry flag, rotate the higher byte right through the carry, and then rotate the lower byte right through the carry. You can find code for it here:

    LSR16   MACRO   VAR16
        BCF     STATUS, C       ; Clear carry
        RRF     (VAR16)+1,F     ; Rotate high byte right
        RRF     (VAR16),F       ; Rotate low byte right
        ENDM
    

    * Of course this is an integer division: when odd numbers are divided by two, the 0.5 is truncated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why is the smallest value that can be stored a Byte(8bit) & not a
I try to determine the right most nth bit set if (value & (1
How do I print a signed integer value stored in an 8-bit register declared
I'm trying to write a stored procedure that will have 6 bit value flags
I have a 16 bit luminance value stored in two bytes, and I want
I want to take the value stored in a 32 bit unsigned int, put
In ARM assembly immediates are encoded by an 8-bit rotated value which means we
I've decimal value 18.8. Values that are stored in this variable can be of
I have values that are 64-bit unsigned ints, and I need to store them
Is it possible to copy a 32 bit value into an array of 8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.