beautypg.com

Not (not) – Echelon Neuron User Manual

Page 102

background image

NOT (Not)

The NOT instruction performs a logical NOT operation on the value in TOS. The

NOT instruction uses the implicit addressing mode. This instruction clears the

Carry flag.
The NOT instruction applies to Series 3100, 5000, and 6000 devices.

Syntax:
The NOT instruction requires no operands:

NOT

Table 35 describes the attributes of the NOT instruction.

Table 35. NOT Instruction

Instruction

Hexadecimal

Opcode

Instruction

Size (Bytes)

CPU Cycles

Required

Affect on

Carry Flag

NOT

3D

1

2

Cleared


Example:
The following example defines a clear_flags function. This function assumes that

flag values to be cleared are in TOS. This function uses the NOT instruction to

invert the passed flag values, then pushes a saved set of flags onto the stack,

performs a logical AND of the inverted flags and the saved flags so that the

passed flag values are cleared, then pops the updated flags to memory.

%clear_flags APEXP ; ( clrMe -- )

not ; ( !clrMe -- )

push flags ; ( flags, !clrMe -- )

and

pop flags ; ( -- )

ret ; return to caller

92

Neuron Assembly Language Instruction Statements