1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# NB: In the below, the 64bit values are embeded into the
# machine code. The address of which being determined
# by a jal (after a jump to an aligned address).
.macro load reg hi lo
j 1f
nop
.align 3
1: jal 2f
nop
.quad \hi
.quad \lo
2:
ld \reg, 0($31)
pcpyld \reg, \reg, $0
ld \reg, 8($31)
.endm
.macro check10 hi lo
j 1f
nop
.align 3
1: jal 2f
nop
.quad \hi
.quad \lo
2: pcpyud $11, $10, $0
ld $5, 0($31)
beq $11, $5, 3f
nop
li $4, 47
break 1023
nop
3: nop
ld $5, 8($31)
beq $10, $5, 3f
nop
li $4, 47
break 1023
nop
3: nop
.endm
.macro checkHI hi lo
j 1f
nop
.align 3
1: jal 2f
nop
.quad \hi
.quad \lo
2: mfhi1 $11
ld $5, 0($31)
beq $11, $5, 3f
nop
li $4, 47
break 1023
nop
3: nop
mfhi $11
ld $5, 8($31)
beq $11, $5, 3f
nop
li $4, 47
break 1023
nop
3: nop
.endm
.macro checkLO hi lo
j 1f
nop
.align 3
1: jal 2f
nop
.quad \hi
.quad \lo
2: mflo1 $11
ld $5, 0($31)
beq $11, $5, 3f
nop
li $4, 47
break 1023
nop
3: nop
mflo $11
ld $5, 8($31)
beq $11, $5, 3f
nop
li $4, 47
break 1023
nop
3: nop
.endm
.macro start
.text
.globl _start
.set noreorder
_start:
.endm
.macro exit0
li $4, 0
break 1023
nop
.endm
|