Keil Logo

Expression Examples

The following expressions were entered in the Command page of the Output Window. All applicable output is included with each example. The MEASURE example program were used for all examples.

Constant
>0x1234                               /* Simple constant */
0x1234                                /* Output */
>EVAL 0x1234
4660T 11064Q 1234H '...4'             /* Output in several number bases */
Register
>R1                                   /* Interrogate value of register R1 */
0x000A                                /* Address from ACC = 0xE0, mem type = D: */
>R1 = --R7                            /* Set R1 and R7 equal to value R7-1 */
Function Symbol
>main                                 /* Get address of main() from MEASURE.C */
0x00233DA                             /* Reply, main starts at 0x233DA */

>&main                                /* Same as before */
0x00233DA

>d main                               /* Display: address = main */
0x0233DA: 76 E2 00 04 76 E3 00 04 - 66 E3 FF F7 E6 B6 80 00 v...v...f......
0x0233EA: E6 B7 00 00 E6 5A 40 00 - E6 D8 11 80 E6 2A 3C F6 .....Z@......*<
0x0233FA: E6 28 3C F6 E6 CE 44 00 - BF 88 E6 A8 40 00 BB D8 .(<...D.....@..
0x02340A: E6 F8 7A 40 CA 00 CE 39 - E6 F8 18 44 CA 00 CE 39 ..z@...9...D...
Address Utilization Examples
>&\measure\main\cmdbuf[0] + 10                         /* Address calculation */
0x23026

>_RBYTE (0x233DA)                                      /* Read byte from code address 0x233DA */
0x76 /* Reply */
Symbol Output Examples
>dir \measure\main                                     /* Output symbols from main() in module MEASURE */
  R14 idx . . . uint                                   /* Output */
  R13 i . . . uint
  0x0002301C cmdbuf . . . array[15] of char
Program Counter Examples
>$ = main                                             /* Set program counter to main() */
>dir                                                  /* points to local mem sym. from main() */
    R14 idx . . . uint                                /* Output */
    R13 i . . . uint
    0x0002301C cmdbuf . . . array[15] of char
Program Variable Examples
>cmdbuf                                               /* Interrogate address from cmdbuf */
0x0002301C                                            /* Output of address due to aggregate type (Array)*/
>cmdbuf[0]                                            /* Output contents of first array element */
0x00
>i                                                    /* Output contents from i */
0x00
>idx                                                  /* Output contents from idx */
0x0000
>idx = DPP2                                           /* Set contents from index equal to register DPP2 */
>idx                                                  /* Output contents from idx */
0x0008
Line Number Examples
>\163                                                 /* Address of the line number #104 */
0x000230DA                                            /* Reply */
>\MCOMMAND\91                                         /* A line number of module MCOMMAND */
0x000231F6
Operator Examples
>--R5                                                 /* Auto-decrement also for CPU registers */
0xFE
>mdisplay                                             /* Output a PUBLIC bit variable */
0
>mdisplay = 1                                         /* Change */
>mdisplay                                             /* Check result */
1
Structure Examples
>save_record[0]                                       /* Address of a record */
0x002100A
>save_record[0].time.hour = DPP3                      /* Change struct element of records */

>save_record[0].time.hour /* Interrogation */
0x03
µVision3 Debug Function Invocation Examples
>printf ("µVision3 is coming!\n")                     /* String constant within printf() */
µVision3 is coming!                                   /* Output */
>_WBYTE(0x20000, _RBYTE(0x20001))                     /* Read & Write Memory Byte */
>                                                     /* example useful in debug functions */
>interval.min = getint ("enter integer: ");
Fully Qualified Symbol Examples
>--\measure\main\idx /* Auto INC/DEC valid for qualified symbol */
0xFFFF
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.