Remote Processing CAMBASIC User Manual

Page 173

Advertising
background image

Comm ands - 140

XOR

Numeric Fun ction

SYNTAX:

n = a XOR b

PURPOSE:

P e r fo r m s b it w is e X O R op e ra ti on o n t w o n u mb e rs . X O R' i n g is us ua ll y p e rf or m e d d u ri ng I/ O
operations to toggle a line.

REMARK S:

Variables a and b are in the range of 0 to 65,535 (&FF FF). When printed, numbers greater than
32768 are negative.

RELATED:

O R , A N D

EXAMPLE:

10

A = INP(0)

:'get current status of port

20

A = A XOR 2 :'Toggle bit number 1

30

OUT 0,A

:'output new status

40

PRINT A

RUN
8

ERROR:

none

Advertising