Welcome to the Creatures Wiki! Log in and join the community.

NOTV

From Creatures Wiki
Revision as of 22:48, 19 April 2022 by Allekha (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

NOTV is a DS-only CAOS command for a bitwise operation.

Usage[edit]

Syntax: NOTV var (variable)

Performs a bitwise NOT operation on var. This means that every binary digit (bit) in 32-bit var is reversed. In C this is expressed var = ~var. var must be integer.

Examples[edit]

This negates va00 (equivalent to NEGV va00 for integers):

NOTV va00
ADDV va00 1

See how this works with va00 = 16:

16 =    0000 0000 0000 0000 0000 0000 0001 0000
NOTV:   1111 1111 1111 1111 1111 1111 1110 1111
ADDV 1: 1111 1111 1111 1111 1111 1111 1111 0000

...and this is -16 in two's complement form.

See also[edit]