13.74 NEG pseudo-instruction

Negate the value in a register.

Syntax

NEG{cond} Rd, Rm

where:

cond
is an optional condition code.
Rd
is the destination register.
Rm
is the register containing the value that is subtracted from zero.

Operation

The NEG pseudo-instruction negates the value in one register and stores the result in a second register.

NEG{cond} Rd, Rm assembles to RSBS{cond} Rd, Rm, #0.

Architectures

The 32-bit encoding of this pseudo-instruction is available in A32 and T32.

There is no 16-bit encoding of this pseudo-instruction available T32.

Register restrictions

In A32 instructions, using SP or PC for Rd or Rm is deprecated. In T32 instructions, you cannot use SP or PC for Rd or Rm.

Condition flags

This pseudo-instruction updates the condition flags, based on the result.

Non-ConfidentialPDF file icon PDF versionARM 100069_0608_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.