These instructions are used for unions. Following instructions are covered in this article:
- [
movas] - [
del]
To declare a new union, do this:
.data
union myUnion: nil ; or anything elseUnions are semi-dynamic, which means you can assign any value type to them, but also you have to reallocate (free) memory every time you change their value:
; to set their value
movas intg ; since it is `nil`
del &myUnion ; delete the memory
movas string ; new type
mov &myUnion, "Some text" ; now myUnion is a string "Some text", while it was just a number 0- When we declare an union as
nilit is actually saved in memory as an integer with value of 0. - We use the
movasinstruction to tell the system how we will treat unions.