Name:
togglebit
Syntax:

TOGGLEBIT var, bit

Var - is the target variable.

Bit - is the target bit (0-7 for byte variables, 0-15 for word variables)

Description:

Toggle (invert) a specific bit in the variable.

This command toggles (inverts) a specific bit in the target variable.

Applies To:
20X2, 28X1, 28X2, 40X1, 40X2
See Also:
Related Create:
    Share:
    Print:

    Toggle a bit in a variable

    Toggle bit 0 in byte variable b6 and bit 15 in word variable w4

    Code Example:
    	togglebit b6, 0
    	togglebit w4, 15
    Copy Code Submit an Example

    Submit Your Own Code!

    You must be logged in to submit code examples. Login now.

    Comments

    • Login to leave a comment.