diff options
author | 2018-03-15 23:49:42 +0700 | |
---|---|---|
committer | 2018-03-27 02:06:25 +1100 | |
commit | 34be272b36f73346e6736d5ff724b1c19e870829 (patch) | |
tree | 3c58d0d3ce3fe52652671563c18b67a1cc6570f6 /docs | |
parent | ebcd71b7f163c7732ab082d43a4a165e67c3353b (diff) |
Document debugger expression number syntax
Diffstat (limited to 'docs')
-rw-r--r-- | docs/source/debugger/expressions.rst | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/docs/source/debugger/expressions.rst b/docs/source/debugger/expressions.rst index 5014eeb1791..cc6ad27377a 100644 --- a/docs/source/debugger/expressions.rst +++ b/docs/source/debugger/expressions.rst @@ -25,6 +25,36 @@ Expressions can be used anywhere a numeric parameter is expected. The syntax for | | +Numbers +------- + +Numbers are prefixed according to their bases: + +- Hexadecimal (base-16) numbers are prefixed with :code:`$` or :code:`0x`. + +- Decimal (base-10) numbers are prefixed with :code:`#`. + +- Octal (base-8) numbers are prefixed with :code:`0o`. + +- Binary (base-2) numbers are prefixed with :code:`0b`. + +- Unprefixed numbers are hexadecimal (base-16). + +Examples: + +- :code:`123` is 123 hexadecimal (291 decimal). + +- :code:`$123` is 123 hexadecimal (291 decimal). + +- :code:`0x123` is 123 hexadecimal (291 decimal). + +- :code:`#123` is 123 decimal. + +- :code:`0o123` is 123 octal (83 decimal). + +- :code:`0b1001` is 9 decimal. + +- :code:`0b123` is invalid. Differences from C Behaviors ---------------------------- @@ -45,4 +75,3 @@ Differences from C Behaviors The memory operators can be used as both lvalues and rvalues, so you can write **b\@100 = ff** to store a byte in memory. By default these operators read from the program memory space, but you can override that by prefixing them with a 'd' or an 'i'. As such, **dw\@300** refers to data memory word at address 300 and **id\@400** refers to an I/O memory dword at address 400. - |