Skip to content

Bitwise Operations without opcodes #97

@x87

Description

@x87

CLEO Plugin IntOperations brings in an easy way to perform common bitwise operations over integer values. However memorizing opcodes and keywords is not easy. So the compiler should be able to figure the opcode in a similar fashion CLEO arithmetic operations are supported.

Proposed Syntax:

Operation Opcode Expression
AND 0B10 0@ = 1@ & 2@
OR 0B11 0@ = 1@ | 2@
XOR 0B12 0@ = 1@ ^ 2@
NOT 0B13 0@ = ~1@
MOD 0B14 0@ = 1@ % 2@
Shift Right 0B15 0@ = 1@ >> 2@
Shift Left 0B16 0@ = 1@ << 2@
AND (compound assignment) 0B17 0@ &= 1@
OR (compound assignment) 0B18 0@ |= 1@
XOR (compound assignment) 0B19 0@ ^= 1@
NOT (mutable) 0B1A ~0@
MOD (compound assignment) 0B1B 0@ %= 1@
Shift Right (compound assignment) 0B1C 0@ >>= 1@
Shift Left (compound assignment) 0B1D 0@ <<= 1@

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions