Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

view most significant bit

Status
Not open for further replies.

ibwev

Member
How do I view the most significant byte of a 2 byte variable? I have attached a section of code that I am using. The variable "RPM" under View:Watch of MPLAB is only1 byte long.
 

Attachments

  • helpac.txt
    1 KB · Views: 130
would that be under "view" then "watch" ? i'm curiouse also, i've been just movfw then movwf of say portc????
 
Thanks for the response.

When I declared the 2 byte variable, I set it up this way:

variable res 2

To be able to view the variable, should I set it up this way:

variableLOW res 1
variableHIGH res 1
 
View variables under View:Watch of MPLAB then "Add SFR" (Special Function Register) and/or "add GPR" (General Purpose Register). Apparently, only 1 byte of a variable can be viewed.
 
With MPLAB (using assembler) you can view and modify from a single bit to 4byte floating point numbers. Add the variable to Watch, right click it, popup allow you to select format.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top