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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
.include "t-macros.i"
.section .rodata
.text
.globl main
.type main,@function
main:
mvfc r0, PSW || ldi.s r14, #0
ldi.l r2, 0x100 ; MOD_E
ldi.l r3, 0x108 ; MOD_S
test_mod_dec_ld:
mvtc r2, MOD_E || bseti r0, #7
mvtc r3, MOD_S
mvtc r0, PSW ; modulo mode enable
mv r1,r3 ; r1=0x108
ld r4, @r1- || nop ; r1=0x106
ld r4, @r1- || nop ; r1=0x104
ld r4, @r1- || nop ; r1=0x102
ld r4, @r1- || nop ; r1=0x100
ld r4, @r1- || nop ; r1=0x108
ld r4, @r1- || nop ; r1=0x106
cmpeqi r1,#0x106
brf0f _ERR ; branch to error
test_mod_inc_ld:
mvtc r2, MOD_S
mvtc r3, MOD_E
mv r1,r2 ; r1=0x100
ld r4, @r1+ || nop ; r1=0x102
ld r4, @r1+ || nop ; r1=0x104
ld r4, @r1+ || nop ; r1=0x106
ld r4, @r1+ || nop ; r1=0x108
ld r4, @r1+ || nop ; r1=0x100
ld r4, @r1+ || nop ; r1=0x102
cmpeqi r1,#0x102
brf0f _ERR
test_mod_dec_ld2w:
mvtc r2, MOD_E
mvtc r3, MOD_S
mv r1,r3 ; r1=0x108
ld2W r4, @r1- || nop ; r1=0x104
ld2W r4, @r1- || nop ; r1=0x100
ld2W r4, @r1- || nop ; r1=0x108
ld2W r4, @r1- || nop ; r1=0x104
cmpeqi r1,#0x104
brf0f _ERR ; <= branch to error
test_mod_inc_ld2w:
mvtc r2, MOD_S
mvtc r3, MOD_E || BCLRI r0, #7
mv r1,r2 ; r1=0x100
ld2W r4, @r1+ || nop ; r1=0x104
ld2W r4, @r1+ || nop ; r1=0x108
ld2W r4, @r1+ || nop ; r1=0x100
ld2W r4, @r1+ || nop ; r1=0x104
cmpeqi r1,#0x104
brf0f _ERR
test_mod_dec_ld_dis:
mvtc r0, PSW ; modulo mode disable
mvtc r2, MOD_E
mvtc r3, MOD_S
mv r1,r3 ; r1=0x108
ld r4, @r1- || nop ; r1=0x106
ld r4, @r1- || nop ; r1=0x104
ld r4, @r1- || nop ; r1=0x102
ld r4, @r1- || nop ; r1=0x100
ld r4, @r1- || nop ; r1=0xFE
ld r4, @r1- || nop ; r1=0xFC
cmpeqi r1,#0xFC
brf0f _ERR
test_mod_inc_ld_dis:
mvtc r2, MOD_S
mvtc r3, MOD_E
mv r1,r2 ; r1=0x100
ld r4, @r1+ || nop ; r1=0x102
ld r4, @r1+ || nop ; r1=0x104
ld r4, @r1+ || nop ; r1=0x106
ld r4, @r1+ || nop ; r1=0x108
ld r4, @r1+ || nop ; r1=0x10A
ld r4, @r1+ || nop ; r1=0x10C
cmpeqi r1,#0x10C
brf0f _ERR
test_mod_dec_ld2w_dis:
mvtc r2, MOD_E
mvtc r3, MOD_S
mv r1,r3 ; r1=0x108
ld2W r4, @r1- || nop ; r1=0x104
ld2W r4, @r1- || nop ; r1=0x100
ld2W r4, @r1- || nop ; r1=0xFC
ld2W r4, @r1- || nop ; r1=0xF8
cmpeqi r1,#0xF8
brf0f _ERR
test_mod_inc_ld2w_dis:
mvtc r2, MOD_S
mvtc r3, MOD_E
mv r1,r2 ; r1=0x100
ld2W r4, @r1+ || nop ; r1=0x104
ld2W r4, @r1+ || nop ; r1=0x108
ld2W r4, @r1+ || nop ; r1=0x10C
ld2W r4, @r1+ || nop ; r1=0x110
cmpeqi r1,#0x110
brf0f _ERR
_OK:
exit0
_ERR:
exit47
|