Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/variables/global_set/index.md
6529 views
---
title: Global set slug: WebAssembly/Reference/Variables/Global_set
---

{{WebAssemblySidebar}}

The global.set instruction sets the values of a global variable.

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

Syntax

;; load the number 2 onto the stack i32.const 2 ;; store the number 2 in the variable $val global.set $val
InstructionBinary opcode
global.set0x24