NEG
Negate Accumulator
7-122
Syntax NEG
Operands None
Opcode
0123456789101112131415
0100000001111101
Execution Increment PC, then ...
(ACC) × –1 → ACC
Status Bits
Affected by Affects
OVM C and OV
Description The content of the accumulator is replaced with its arithmetic complement (2s
complement). The OV bit is set when taking the NEG of 8000 0000h. If OVM
= 1, the accumulator content is replaced with 7FFF FFFFh. If OVM = 0, the
result is 8000 0000h. The carry bit (C) is cleared to 0 by this instruction for all
nonzero values of the accumulator, and is set to 1 if the accumulator equals
zero.
Words 1
Cycles for a Single NEG Instruction
ROM DARAM SARAM External
1 1 1 1+p
Cycles for a Repeat (RPT) Execution of an NEG Instruction
ROM DARAM SARAM External
n n n n+p
Example 1 NEG ;(OVM = X) Convert –3544 to +3544
Before Instruction After Instruction
ACC X 0FFFFF228h ACC 0 0DD8h
CC
XX
OV OV
Example 2 NEG ;(OVM = 0)
Before Instruction After Instruction
ACC X 080000000h ACC 0 080000000h
CC
X1
OV OV
Cycles