Question: I have a string array like this

```
string[] BranchIds = {"1","2","3"};

```

and then stored it into a session 

```
Session["BranchIds"] = BranchIds;

```

Now how can I retrieve this values as integers from session?

Answer: 
I think the `mov x8, xzr` vs `mov x8, #0` comparison is something of a red herring.

As @old\_timer's answer shows, there is no encoding gain to be made, and quite likely (although admittedly I haven't checked) little or no pipeline performance gain.

What `xzr` gives us, however - in addition to a dummy register as per @InfinitelyManic's answer - is access to a zero-valued operand *without having to load and occupy a real register*. This has the dual benefit of one less instruction, and one more register available to hold 'real' data.

I think this is an important characteristic that the original ['some content from ARM' referred to in the OP](https://community.arm.com/processors/f/discussions/3185/wzr-xzr-register-s-purpose) neglects to point out.

That's what I mean by `mov x8, xzr` vs `mov x8, #0` being a red herring. If we're zeroing `x8` with the intention of then modifying it, then using `xzr` or `#0` is pretty arbitrary (although I'd tend to favour `#0` as the more obvious). But if we're zeroing `x8` purely in order to supply a zero operand to a subsequent instruction, then we'd be better off using - where permitted - `xzr` instead of `x8` as the operand in *that* instruction, and not zeroing `x8` at all.
**TL;DR**

It takes multiple instructions to load a 64 bit literal into a register, but only a single instruction to set to 0 using zxr. Therefore the code is shorter and faster.

---

To move a literal to a register you would use the MOVL instruction, see this from the arm reference:

> 
> MOVL pseudo-instruction
> 
> 
> Load a register with either:
> 
> 
> 
> ```
> A 32-bit or 64-bit immediate value.
> 
> Any address.
> 
> ```
> 
> MOVL generates either two or four instructions... a MOV, MOVK pair.
> 
> 
> 

So loading a literal into a register is a multi step process. If you just want to clear a register then they have a shortcut. zxr is a pseudo register that always reads zero, which is a common value that you would need, and moving a register to a register can be done in a single instruction.

In Microchip assembly they have a similar concept. To set a register to a literal you would do something like:

```
MOVLW   10       (Move 10 to the working register) 
MOVWF   0x1234   (Move the working register to address 0x1234)

```

But to set to zero they have the instruction:

```
CLRF    0x1234   (Set 0x1234 to zero)

```