Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/numeric/xor/index.md
6520 views
---
title: XOR slug: WebAssembly/Reference/Numeric/XOR
---

{{WebAssemblySidebar}}

The xor instructions, are used for performing a bitwise XOR, similar to the ^ operator in other languages.

{{EmbedInteractiveExample("pages/wat/xor.html", "tabbed-taller")}}

Syntax

;; load two numbers onto the stack i32.const 5 ;; 00000101 i32.const 3 ;; 00000011 ;; perform a bitwise XOR i32.xor ;; the top item on the stack will now be 6 (00000110)
InstructionBinary opcode
i32.xor0x73
i64.xor0x85