4.9.5 Expression Formatting

The Microchip Studio debugger includes expression evaluators that work when entering an expression in the QuickWatch and Watches, Memory View, Watch Window or Immediate window. The expression evaluators are also at work in the Breakpoints window and many other places in the debugger.

General Syntax:

Val, formatString

Format Specifier for Values

The following tables show the format specifiers recognized by the debugger.

Table 4-3. Debug Format Specifiers for Values

Specifier

Format

Expression

Value Displayed

d,i

Signed decimal integer

0xF000F065, d

-268373915

u

Unsigned decimal integer

0x0065, u

101

b

Unsigned binary number

0xaa,b2

0b10101010

o

Unsigned octal integer

0xF065, o

0170145

x,X

Hexadecimal integer

61541, x

0x0000F065

1,2,4,8

As a suffix specifying number of bytes for: d, i, u, o, x, X.

00406042,x2

0x0c22

s

String

0x2000, s

'Hello World'

f

Signed floating point

(3./2.), f

1.500000

e

Signed scientific notation

(3./2.), e

1.500000e+000

g

Signed floating point or signed scientific notation, whichever is shorter

(3./2.), g

1.5

c

Single character

0x0065, c

101 'e'

Size Specifier for Pointers as Arrays

If you have a pointer to an object you want to view as an array, you can use an integer to specify the number of array elements:

ptr,10 or array,20

Memory Type Specifier

The following memory type specifiers will force the memory reference to a specific memory type. To be used in the memory window in the address field, you should have a pointer to an object you want to view as an array. You can use an integer to specify the number of the array elements:

Table 4-4. Debug Memory Type Specifiers

Specifier

Expression

Value Displayed

Flash or program

Program memory

0,Flash

data

Data memory

0x2000,data

sram

SRAM

0x100,sram

reg or registers

Registers

1,reg

io, eeprom, fusebytes, lockbytes, signature, usersign, prodsign

Memory types with same names