1## Command registers ##
2
3The `registers` command will print all the registers and dereference any
4pointers.
5
6Example on a MIPS host:
7
8```
9gef➤ reg
10$zero     : 0x00000000
11$at       : 0x00000001
12$v0       : 0x7fff6cd8 -> 0x77e5e7f8 -> <__libc_start_main+200>: bnez v0,0x77e5e8a8
13$v1       : 0x77ff4490
14$a0       : 0x00000001
15$a1       : 0x7fff6d94 -> 0x7fff6e85 -> "/root/demo-mips"
16$a2       : 0x7fff6d9c -> 0x7fff6e91 -> "SHELL=/bin/bash"
17$a3       : 0x00000000
18$t0       : 0x77fc26a0 -> 0x0
19$t1       : 0x77fc26a0 -> 0x0
20$t2       : 0x77fe5000 -> "_dl_fini"
21$t3       : 0x77fe5000 -> "_dl_fini"
22$t4       : 0xf0000000
23$t5       : 0x00000070
24$t6       : 0x00000020
25$t7       : 0x7fff6bc8 -> 0x0
26$s0       : 0x00000000
27$s1       : 0x00000000
28$s2       : 0x00000000
29$s3       : 0x00500000
30$s4       : 0x00522f48
31$s5       : 0x00522608
32$s6       : 0x00000000
33$s7       : 0x00000000
34$t8       : 0x0000000b
35$t9       : 0x004008b0 -> <main>: addiu sp,sp,-32
36$k0       : 0x00000000
37$k1       : 0x00000000
38$s8       : 0x00000000
39$status   : 0x0000a413
40$badvaddr : 0x77e7a874 -> <__cxa_atexit>: lui gp,0x15
41$cause    : 0x10800024
42$pc       : 0x004008c4 -> <main+20>: li v0,2
43$sp       : 0x7fff6ca0 -> 0x77e4a834 -> 0x29bd
44$hi       : 0x000001a5
45$lo       : 0x00005e17
46$fir      : 0x00739300
47$fcsr     : 0x00000000
48$ra       : 0x77e5e834 -> <__libc_start_main+260>: lw gp,16(sp)
49$gp       : 0x00418b20
50```
51
52### Filtering registers ###
53
54If one or more register names are passed to the `registers` command as optional
55arguments, then only those will be shown:
56
57```
58gef➤ reg $rax $rip $rsp
59$rax   : 0x0000555555555169  →  <main+0> endbr64
60$rsp   : 0x00007fffffffe3e8  →  0x00007ffff7df40b3  →  <__libc_start_main+243> mov edi, eax
61$rip   : 0x0000555555555169  →  <main+0> endbr64
62```
63