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
127
128
129
|
# Hitachi H8 testcase 'movmd'
# mach(): h8sx
# as(h8300): --defsym sim_cpu=0
# as(h8300h): --defsym sim_cpu=1
# as(h8300s): --defsym sim_cpu=2
# as(h8sx): --defsym sim_cpu=3
# ld(h8300h): -m h8300helf
# ld(h8300s): -m h8300self
# ld(h8sx): -m h8300sxelf
.include "testutils.inc"
.data
byte_src:
.byte 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
byte_dst:
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.align 2
word_src:
.word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
word_dst:
.word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
.align 4
long_src:
.long 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
long_dst:
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
start
.if (sim_cpu == h8sx)
movmd_b:#
# Byte block transfer
#
set_grs_a5a5
mov #byte_src, er5
mov #byte_dst, er6
mov #10, r4
set_ccr_zero
;; movmd.b
movmd.b
;;; .word 0x7b94
test_cc_clear
test_gr_a5a5 0
test_gr_a5a5 1
test_gr_a5a5 2
test_gr_a5a5 3
test_h_gr32 0xa5a50000 er4
test_h_gr32 byte_src+10 er5
test_h_gr32 byte_dst+10 er6
test_gr_a5a5 7
#
# Now make sure exactly 10 bytes were transferred.
memcmp byte_src byte_dst 10
cmp.b #0, @byte_dst+10
beq .L0
fail
.L0:
movmd_w:#
# Word block transfer
#
set_grs_a5a5
mov #word_src, er5
mov #word_dst, er6
mov #10, r4
set_ccr_zero
;; movmd.w
movmd.w
;;; .word 0x7ba4
test_cc_clear
test_gr_a5a5 0
test_gr_a5a5 1
test_gr_a5a5 2
test_gr_a5a5 3
test_h_gr32 0xa5a50000 er4
test_h_gr32 word_src+20 er5
test_h_gr32 word_dst+20 er6
test_gr_a5a5 7
#
# Now make sure exactly 20 bytes were transferred.
memcmp word_src word_dst 20
cmp.w #0, @word_dst+20
beq .L1
fail
.L1:
movmd_l:#
# Long block transfer
#
set_grs_a5a5
mov #long_src, er5
mov #long_dst, er6
mov #10, r4
set_ccr_zero
;; movmd.b
movmd.l
;;; .word 0x7bb4
test_cc_clear
test_gr_a5a5 0
test_gr_a5a5 1
test_gr_a5a5 2
test_gr_a5a5 3
test_h_gr32 0xa5a50000 er4
test_h_gr32 long_src+40 er5
test_h_gr32 long_dst+40 er6
test_gr_a5a5 7
#
# Now make sure exactly 40 bytes were transferred.
memcmp long_src long_dst 40
cmp.l #0, @long_dst+40
beq .L2
fail
.L2:
.endif
pass
exit 0
|