You copied the Doc URL to your clipboard.

# Differences between expressions in embedded assembler and C or C++

There are a number of differences between embedded assembly and C or C++.

Specifically:

• Assembly expressions are always unsigned. The same expression might have different values between assembly and C or C++. For example:

```MOV r0, #(-33554432 / 2) â€ƒâ€ƒâ€ƒâ€ƒ// result is 0x7f000000
MOV r0, #__cpp(-33554432 / 2) â€ƒ// result is 0xff000000
```
• Assembly numbers with leading zeros are still decimal. For example:

```MOV r0, #0700 â€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒ// decimal 700
MOV r0, #__cpp(0700) â€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒ// octal 0700 == decimal 448
```
• Assembly operator precedence differs from C and C++. For example:

```MOV r0, #(0x23 :AND: 0xf + 1)â€ƒâ€ƒ  // ((0x23 & 0xf) + 1) => 4
MOV r0, #__cpp(0x23 & 0xf + 1)â€ƒâ€ƒâ€ƒ// (0x23 & (0xf + 1)) => 0```
• Assembly strings are not `NUL`-terminated:

```DCB "Hello world!" â€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒâ€ƒ// 12 bytes (no trailing NUL)
DCB __cpp("Hello world!")         // 13 bytes (trailing NUL)```
Note

The embedded assembly rules apply outside `__cpp`, and the C or C++ rules apply inside `__cpp.`