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: 
```
mov x8,xzr
mov x8,#0
mov x8,0

```

produces

```
0000000000000000 <.text>:
   0:   aa1f03e8    mov x8, xzr
   4:   d2800008    mov x8, #0x0                    // #0
   8:   d2800008    mov x8, #0x0                    // #0

```

No real surprise there other than it allowed an immediate without the pound sign. It is not an instruction size issue (again no surprise, with x86 for example xor rax,rax is cheaper than mov rax,0), perhaps there is a pipeline performance gain (despite popular belief instructions take more than one clock start to finish).

Most likely it is a personal preference thing we have this cool mips like always zero register thing lets use it just for fun.
**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)

```