...
1 package asm
2
3 import (
4 "fmt"
5 )
6
7
8 type Register uint8
9
10
11 const R0 Register = 0
12
13
14 const (
15 R1 Register = R0 + 1 + iota
16 R2
17 R3
18 R4
19 R5
20 )
21
22
23 const (
24 R6 Register = R5 + 1 + iota
25 R7
26 R8
27 R9
28 )
29
30
31 const (
32 R10 Register = R9 + 1
33 RFP = R10
34 )
35
36
37 const (
38 PseudoMapFD = R1
39 PseudoMapValue = R2
40 PseudoCall = R1
41 PseudoFunc = R4
42 )
43
44 func (r Register) String() string {
45 v := uint8(r)
46 if v == 10 {
47 return "rfp"
48 }
49 return fmt.Sprintf("r%d", v)
50 }
51
View as plain text