aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/h8300/mova.s
blob: a4bcfd6ee0bd22a270a7f58053c3f6ba4abff26d (plain)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
# Hitachi H8 testcase 'mova'
# 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
foo:	.long	0x01010101
	.long	0x10101010
	.long	0x11111111

	start

movabl16_reg8:
	set_grs_a5a5
	set_ccr_zero

	mova/b.l	@(1:16, r2l.b), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0xa6 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movabl16_reg16:
	set_grs_a5a5
	set_ccr_zero

	mova/b.l	@(1:16, r2.w), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0xa5a6 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movabl32_reg8:
	set_grs_a5a5
	set_ccr_zero

	mova/b.l	@(1:32, r2l.b), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0xa6 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movabl32_reg16:
	set_grs_a5a5
	set_ccr_zero

	mova/b.l	@(1:32, r2.w), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0xa5a6 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movawl16_reg8:
	set_grs_a5a5
	set_ccr_zero

	mova/w.l	@(1:16, r2l.b), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x14b er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movawl16_reg16:
	set_grs_a5a5
	set_ccr_zero

	mova/w.l	@(1:16, r2.w), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x14b4b er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movawl32_reg8:
	set_grs_a5a5
	set_ccr_zero

	mova/w.l	@(1:32, r2l.b), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x14b er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movawl32_reg16:
	set_grs_a5a5
	set_ccr_zero

	mova/w.l	@(1:32, r2.w), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x14b4b er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movall16_reg8:
	set_grs_a5a5
	set_ccr_zero

	mova/l.l	@(1:16, r2l.b), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x295 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movall16_reg16:
	set_grs_a5a5
	set_ccr_zero

	mova/l.l	@(1:16, r2.w), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x29695 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movall32_reg8:
	set_grs_a5a5
	set_ccr_zero

	mova/l.l	@(1:32, r2l.b), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x295 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

movall32_reg16:
	set_grs_a5a5
	set_ccr_zero

	mova/l.l	@(1:32, r2.w), er3

	test_cc_clear
	test_gr_a5a5	0	; Make sure other regs not affected
	test_gr_a5a5	1
	test_gr_a5a5	2
	test_h_gr32	0x29695 er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

t02_mova:
	set_grs_a5a5
	set_ccr_zero

	mov.l	#0x01010101, er1
	mova/b.c @(0x1234:16,r1l.b),er1 ; 7A891234
	test_h_gr32	0x1235, er1 ; 1s
	mov.l	#0x01010101, er1
	mova/b.c @(0x1234:16,r1.w),er1 ; 7A991234
	test_h_gr32	0x1335, er1 ; 2s
	mov.l	#0x01010101, er1
	mova/w.c @(0x1234:16,r1l.b),er1 ; 7AA91234
	test_h_gr32	0x1236, er1 ; 3s
	mov.l	#0x01010101, er1
	mova/w.c @(0x1234:16,r1.w),er1 ; 7AB91234
	test_h_gr32	0x1436, er1 ; 4s
	mov.l	#0x01010101, er1
	mova/l.c @(0x1234:16,r1l.b),er1 ; 7AC91234
	test_h_gr32	0x1238, er1 ; 5s
	mov.l	#0x01010101, er1
	mova/l.c @(0x1234:16,r1.w),er1 ; 7AD91234
	test_h_gr32	0x1638, er1 ; 6s
	mov.l	#0x01010101, er1
	mova/b.c @(0x12345678:32,r1l.b),er1 ; 7A8112345678
	test_h_gr32	0x12345679, er1	; 7s
	mov.l	#0x01010101, er1
	mova/b.c @(0x12345678:32,r1.w),er1 ; 7A9112345678
	test_h_gr32	0x12345779, er1	; 8s
	mov.l	#0x01010101, er1
	mova/w.c @(0x12345678:32,r1l.b),er1 ; 7AA112345678
	test_h_gr32	0x1234567a, er1	; 9s
	mov.l	#0x01010101, er1
	mova/w.c @(0x12345678:32,r1.w),er1 ; 7AB112345678
	test_h_gr32	0x1234587a, er1	; 10s
	mov.l	#0x01010101, er1
	mova/l.c @(0x12345678:32,r1l.b),er1 ; 7AC112345678
	test_h_gr32	0x1234567c, er1	; 11s
	mov.l	#0x01010101, er1
	mova/l.c @(0x12345678:32,r1.w),er1 ; 7AD112345678
	test_h_gr32	0x12345a7c, er1	; 12s

t02b:	
	mov.l	#0x01010101, er3
	mova/b.l @(0x1234:16,r3l.b),er1 ; 78B87A891234
	test_h_gr32	0x1235, er1 ; 1
	mova/b.l @(0x1234:16,r3.w),er1 ; 78397A991234
	test_h_gr32	0x1335, er1 ; 2
	mova/w.l @(0x1234:16,r3l.b),er1 ; 78B87AA91234
	test_h_gr32	0x1236, er1 ; 3
	mova/w.l @(0x1234:16,r3.w),er1 ; 78397AB91234
	test_h_gr32	0x1436, er1 ; 4
	mova/l.l @(0x1234:16,r3l.b),er1 ; 78B87AC91234
	test_h_gr32	0x1238, er1 ; 5
	mova/l.l @(0x1234:16,r3.w),er1 ; 78397AD91234
	test_h_gr32	0x1638, er1 ; 6
	mova/b.l @(0x12345678:32,r3l.b),er1 ; 78B87A8112345678
	test_h_gr32	0x12345679, er1	; 7
	mova/b.l @(0x12345678:32,r3.w),er1 ; 78397A9112345678
	test_h_gr32	0x12345779, er1	; 8
	mova/w.l @(0x12345678:32,r3l.b),er1 ; 78B87AA112345678
	test_h_gr32	0x1234567a, er1	; 9
	mova/w.l @(0x12345678:32,r3.w),er1 ; 78397AB112345678
	test_h_gr32	0x1234587a, er1	; 10
	mova/l.l @(0x12345678:32,r3l.b),er1 ; 78B87AC112345678
	test_h_gr32	0x1234567c, er1	; 11
	mova/l.l @(0x12345678:32,r3.w),er1 ; 78397AD112345678
	test_h_gr32	0x12345a7c, er1	; 12
	test_h_gr32	0x01010101, er3
t02c:	
	mov.l	#foo, er2
	mova/b.l @(0x1234:16,@er2.b),er1              ;017F02811234
	test_h_gr32	0x1235, er1 ; 13
	test_h_gr32	foo, er2
	mova/b.l @(0x1234:16,@(0x1:2,er2).b),er1       ;017F12811234
	test_h_gr32	0x1235, er1 ; 18
	test_h_gr32	foo, er2
	mova/b.l @(0x1234:16,@er2+.b),er1             ;017F82811234
	test_h_gr32	0x1235, er1 ; 14
	test_h_gr32	foo+1, er2 
	mova/b.l @(0x1234:16,@-er2.b),er1             ;017FB2811234
	test_h_gr32	0x1235, er1 ; 17
	test_h_gr32	foo, er2
	mova/b.l @(0x1234:16,@+er2.b),er1             ;017F92811234
	test_h_gr32	0x1235, er1 ; 16
	test_h_gr32	foo+1, er2
	mova/b.l @(0x1234:16,@er2-.b),er1             ;017FA2811234
	test_h_gr32	0x1235, er1 ; 15
	test_h_gr32	foo, er2
t02d:
	mov.l	#4, er2
	mova/b.l @(0x1234:16, @(foo:16, er2).b), er1
	test_h_gr32	0x1244, er1 ; 19
	mova/b.l @(0x1234:16, @(foo:16, r2L.b).b), er1
	test_h_gr32	0x1244, er1 ; 21
	mova/b.l @(0x1234:16, @(foo:16, r2.w).b), er1
	test_h_gr32	0x1244, er1 ; 22
	mova/b.l @(0x1234:16, @(foo:16, er2.l).b), er1
	test_h_gr32	0x1244, er1 ; 23

	mov.l	#4, er2
	mova/b.l @(0x1234:16, @(foo:32, er2).b), er1
	test_h_gr32	0x1244, er1 ; 20
	mova/b.l @(0x1234:16, @(foo:32, r2L.b).b), er1
	test_h_gr32	0x1244, er1 ; 24
	mova/b.l @(0x1234:16, @(foo:32, r2.w).b), er1
	test_h_gr32	0x1244, er1 ; 25
	mova/b.l @(0x1234:16, @(foo:32, er2.l).b), er1
	test_h_gr32	0x1244, er1 ; 26

	mova/b.l @(0x1234:16,@foo:16.b),er1
	test_h_gr32	0x1235, er1 ; 27
	mova/b.l @(0x1234:16,@foo:32.b),er1
	test_h_gr32	0x1235, er1 ; 28

t02e:
	mov.l	#foo, er2
	mova/b.l @(0x1234:16,@er2.w),er1              ;015F02911234
	test_h_gr32	0x1335, er1 ; 29
	test_h_gr32	foo, er2
	mova/b.l @(0x1234:16,@(0x2:2,er2).w),er1    ;015F12911234
	test_h_gr32	0x1335, er1 ; 34
	test_h_gr32	foo, er2
	mova/b.l @(0x1234:16,@er2+.w),er1             ;015F82911234
	test_h_gr32	0x1335, er1 ; 30
	test_h_gr32	foo+2, er2
	mova/b.l @(0x1234:16,@-er2.w),er1             ;015FB2911234
	test_h_gr32	0x1335, er1 ; 33
	test_h_gr32	foo, er2
	mova/b.l @(0x1234:16,@+er2.w),er1             ;015F92911234
	test_h_gr32	0x1335, er1 ; 32
	test_h_gr32	foo+2, er2
	mova/b.l @(0x1234:16,@er2-.w),er1             ;015FA2911234
	test_h_gr32	0x1335, er1 ; 31
	test_h_gr32	foo, er2

	mov.l	#4, er2
	mova/b.l @(0x1234:16, @(foo:16, er2).w), er1
	test_h_gr32	0x2244, er1 ; 35
	shar.l	er2
	mova/b.l @(0x1234:16, @(foo:16, r2L.b).w), er1
	test_h_gr32	0x2244, er1 ; 37
	mova/b.l @(0x1234:16, @(foo:16, r2.w).w), er1
	test_h_gr32	0x2244, er1 ; 38
	mova/b.l @(0x1234:16, @(foo:16, er2.l).w), er1
	test_h_gr32	0x2244, er1 ; 39

	mov.l	#4, er2
	mova/b.l @(0x1234:16, @(foo:32, er2).w), er1
	test_h_gr32	0x2244, er1 ; 36
	shar.l	er2
	mova/b.l @(0x1234:16, @(foo:32, r2L.b).w), er1
	test_h_gr32	0x2244, er1 ; 40
	mova/b.l @(0x1234:16, @(foo:32, r2.w).w), er1
	test_h_gr32	0x2244, er1 ; 41
	mova/b.l @(0x1234:16, @(foo:32, er2.l).w), er1
	test_h_gr32	0x2244, er1 ; 42

	mova/b.l @(0x1234:16,@foo:16.w),er1        ;015F40919ABC1234
	test_h_gr32	0x1335, er1 ; 43
	mova/b.l @(0x1234:16,@foo:32.w),er1        ;015F48919ABCDEF01234
	test_h_gr32	0x1335, er1 ; 44

t02f:
	mov.l	#foo, er2
	mova/w.l @(0x1234:16,@er2.b),er1           ;017F02A11234
	test_h_gr32	0x1236, er1 ; 45
	mova/w.l @(0x1234:16,@(0x1:2,er2).b),er1    ;017F12A11234
	test_h_gr32	0x1236, er1 ; 50
	mova/w.l @(0x1234:16,@er2+.b),er1          ;017F82A11234
	test_h_gr32	0x1236, er1 ; 46
	test_h_gr32	foo+1, er2
	mova/w.l @(0x1234:16,@-er2.b),er1          ;017FB2A11234
	test_h_gr32	0x1236, er1 ; 49
	test_h_gr32	foo, er2
	mova/w.l @(0x1234:16,@+er2.b),er1          ;017F92A11234
	test_h_gr32	0x1236, er1 ; 48
	test_h_gr32	foo+1, er2
	mova/w.l @(0x1234:16,@er2-.b),er1          ;017FA2A11234
	test_h_gr32	0x1236, er1 ; 47
	test_h_gr32	foo, er2

t02g:
	mov.l	#4, er2
	mova/w.l @(0x1234:16, @(foo:16, er2).b), er1
	test_h_gr32	0x1254, er1 ; 51
	mova/w.l @(0x1234:16, @(foo:16, r2L.b).b), er1
	test_h_gr32	0x1254, er1 ; 53
	mova/w.l @(0x1234:16, @(foo:16, r2.w).b), er1
	test_h_gr32	0x1254, er1 ; 54
	mova/w.l @(0x1234:16, @(foo:16, er2.l).b), er1
	test_h_gr32	0x1254, er1 ; 55

	mov.l	#4, er2
	mova/w.l @(0x1234:16, @(foo:32, er2).b), er1
	test_h_gr32	0x1254, er1 ; 52
	mova/w.l @(0x1234:16, @(foo:32, r2L.b).b), er1
	test_h_gr32	0x1254, er1 ; 56
	mova/w.l @(0x1234:16, @(foo:32, r2.w).b), er1
	test_h_gr32	0x1254, er1 ; 57
	mova/w.l @(0x1234:16, @(foo:32, er2.l).b), er1
	test_h_gr32	0x1254, er1 ; 58

	mova/w.l @(0x1234:16,@foo:16.b),er1        ;017F40A19ABC1234
	test_h_gr32	0x1236, er1 ; 59 (can't test -- points into the woods)
	mova/w.l @(0x1234:16,@foo:32.b),er1        ;017F48A19ABCDEF01234
	test_h_gr32	0x1236, er1 ; 60 (can't test -- points into the woods)

t02h:
	mov.l	#foo, er2
	mova/w.l @(0x1234:16,@er2.w),er1           ;015F02B11234
	test_h_gr32	0x1436, er1 ; 61
	mova/w.l @(0x1234:16,@(0x2:2,er2).w),er1 ;015F12B11234
	test_h_gr32	0x1436, er1 ; 66, 0x1234 + (@(4+foo).w << 1
	mova/w.l @(0x1234:16,@er2+.w),er1          ;015F82B11234
	test_h_gr32	0x1436, er1 ; 62
	test_h_gr32	foo+2, er2
	mova/w.l @(0x1234:16,@-er2.w),er1          ;015FB2B11234
	test_h_gr32	0x1436, er1 ; 63
	test_h_gr32	foo, er2 
	mova/w.l @(0x1234:16,@+er2.w),er1          ;015F92B11234
	test_h_gr32	0x1436, er1 ; 64
	test_h_gr32	foo+2, er2
	mova/w.l @(0x1234:16,@er2-.w),er1          ;015FA2B11234
	test_h_gr32	0x1436, er1 ; 65
	test_h_gr32	foo, er2 
t02i:
	mov.l	#4, er2
	mova/w.l @(0x1234:16, @(foo:16, er2).w), er1
	test_h_gr32	0x3254, er1 ; 67
	shar.l	er2
	mova/w.l @(0x1234:16, @(foo:16, r2L.b).w), er1
	test_h_gr32	0x3254, er1 ; 69
	mova/w.l @(0x1234:16, @(foo:16, r2.w).w), er1
	test_h_gr32	0x3254, er1 ; 70
	mova/w.l @(0x1234:16, @(foo:16, er2.l).w), er1
	test_h_gr32	0x3254, er1 ; 71

	mov.l	#4, er2
	mova/w.l @(0x1234:16, @(foo:32, er2).w), er1
	test_h_gr32	0x3254, er1 ; 68
	shar.l	er2
	mova/w.l @(0x1234:16, @(foo:32, r2L.b).w), er1
	test_h_gr32	0x3254, er1 ; 72
	mova/w.l @(0x1234:16, @(foo:32, r2.w).w), er1
	test_h_gr32	0x3254, er1 ; 73
	mova/w.l @(0x1234:16, @(foo:32, er2.l).w), er1
	test_h_gr32	0x3254, er1 ; 74

	mova/w.l @(0x1234:16,@foo:16.w),er1        ;015F40B19ABC1234
	test_h_gr32	0x1436, er1 ; 75 (can't test -- points into the woods)
	mova/w.l @(0x1234:16,@foo:32.w),er1        ;015F48B19ABCDEF01234
	test_h_gr32	0x1436, er1 ; 76 (can't test -- points into the woods)

t02j:
	mov.l	#foo, er2
	mova/l.l @(0x1234:16,@er2.b),er1           ;017F02C11234
	test_h_gr32	0x1238, er1 ; 77
	mova/l.l @(0x1234:16,@(0x1:2,er2).b),er1    ;017F12C11234
	test_h_gr32	0x1238, er1 ; 82
	mova/l.l @(0x1234:16,@er2+.b),er1          ;017F82C11234
	test_h_gr32	0x1238, er1 ; 78
	test_h_gr32	foo+1, er2
	mova/l.l @(0x1234:16,@-er2.b),er1          ;017FB2C11234
	test_h_gr32	0x1238, er1 ; 79
	test_h_gr32	foo, er2
	mova/l.l @(0x1234:16,@+er2.b),er1          ;017F92C11234
	test_h_gr32	0x1238, er1 ; 80
	test_h_gr32	foo+1, er2
	mova/l.l @(0x1234:16,@er2-.b),er1          ;017FA2C11234
	test_h_gr32	0x1238, er1 ; 81
	test_h_gr32	foo, er2

t02k:
	mov.l	#4, er2
	mova/l.l @(0x1234:16, @(foo:16, er2).b), er1
	test_h_gr32	0x1274, er1 ; 83
	mova/l.l @(0x1234:16, @(foo:16, r2L.b).b), er1
	test_h_gr32	0x1274, er1 ; 85
	mova/l.l @(0x1234:16, @(foo:16, r2.w).b), er1
	test_h_gr32	0x1274, er1 ; 86
	mova/l.l @(0x1234:16, @(foo:16, er2.l).b), er1
	test_h_gr32	0x1274, er1 ; 87

	mov.l	#4, er2
	mova/l.l @(0x1234:16, @(foo:32, er2).b), er1
	test_h_gr32	0x1274, er1 ; 84
	mova/l.l @(0x1234:16, @(foo:32, r2L.b).b), er1
	test_h_gr32	0x1274, er1 ; 88
	mova/l.l @(0x1234:16, @(foo:32, r2.w).b), er1
	test_h_gr32	0x1274, er1 ; 89
	mova/l.l @(0x1234:16, @(foo:32, er2.l).b), er1
	test_h_gr32	0x1274, er1 ; 90

	mova/l.l @(0x1234:16,@foo:16.b),er1        ;017F40C19ABC1234
	test_h_gr32	0x1238, er1 ; 91 (can't test -- points into the woods)
	mova/l.l @(0x1234:16,@foo:32.b),er1        ;017F48C19ABCDEF01234
	test_h_gr32	0x1238, er1 ; 92 (can't test -- points into the woods)

t02l:
	mov.l	#foo, er2
	mova/l.l @(0x1234:16,@er2.w),er1           ;015F02D11234
	test_h_gr32	0x1638, er1 ; 93
	mova/l.l @(0x1234:16,@(0x2:2,er2).w),er1   ;015F12D11234
	test_h_gr32	0x1638, er1 ; 98 
	mova/l.l @(0x1234:16,@er2+.w),er1          ;015F82D11234
	test_h_gr32	0x1638, er1 ; 94
	test_h_gr32	foo+2, er2
	mova/l.l @(0x1234:16,@-er2.w),er1          ;015FB2D11234
	test_h_gr32	0x1638, er1 ; 97
	test_h_gr32	foo, er2
	mova/l.l @(0x1234:16,@+er2.w),er1          ;015F92D11234
	test_h_gr32	0x1638, er1 ; 96
	test_h_gr32	foo+2, er2
	mova/l.l @(0x1234:16,@er2-.w),er1          ;015FA2D11234
	test_h_gr32	0x1638, er1 ; 95
	test_h_gr32	foo, er2

t02o:
	mov.l	#4, er2
	mova/l.l @(0x1234:16, @(foo:16, er2).w), er1
	test_h_gr32	0x5274, er1 ; 99
	shar.l	er2
	mova/l.l @(0x1234:16, @(foo:16, r2L.b).w), er1
	test_h_gr32	0x5274, er1 ; 101
	mova/l.l @(0x1234:16, @(foo:16, r2.w).w), er1
	test_h_gr32	0x5274, er1 ; 102
	mova/l.l @(0x1234:16, @(foo:16, er2.l).w), er1
	test_h_gr32	0x5274, er1 ; 103

	mov.l	#4, er2
	mova/l.l @(0x1234:16, @(foo:32, er2).w), er1
	test_h_gr32	0x5274, er1 ; 100
	shar.l	er2
	mova/l.l @(0x1234:16, @(foo:32, r2L.b).w), er1
	test_h_gr32	0x5274, er1 ; 104
	mova/l.l @(0x1234:16, @(foo:32, r2.w).w), er1
	test_h_gr32	0x5274, er1 ; 105
	mova/l.l @(0x1234:16, @(foo:32, er2.l).w), er1
	test_h_gr32	0x5274, er1 ; 106

	mova/l.l @(0x1234:16,@foo:16.w),er1        ;015F40D19ABC1234
	test_h_gr32	0x1638, er1 ; 107 (can't test -- points into the woods)
	mova/l.l @(0x1234:16,@foo:32.w),er1        ;015F48D19ABCDEF01234
	test_h_gr32	0x1638, er1 ; 108 (can't test -- points into the woods)

t02p:
	mov.l	#foo, er2
	mova/b.l @(0x12345678:32,@er2.b),er1              ;017F028912345678
	test_h_gr32	0x12345679, er1	; 109
	mova/b.l @(0x12345678:32,@(0x1:2,er2).b),er1      ;017F128912345678
	test_h_gr32	0x12345679, er1	; 114
	mova/b.l @(0x12345678:32,@er2+.b),er1             ;017F828912345678
	test_h_gr32	0x12345679, er1	; 110
	test_h_gr32	foo+1, er2
	mova/b.l @(0x12345678:32,@-er2.b),er1             ;017FB28912345678
	test_h_gr32	0x12345679, er1	; 113
	test_h_gr32	foo, er2
	mova/b.l @(0x12345678:32,@+er2.b),er1             ;017F928912345678
	test_h_gr32	0x12345679, er1	; 112
	test_h_gr32	foo+1, er2
	mova/b.l @(0x12345678:32,@er2-.b),er1             ;017FA28912345678
	test_h_gr32	0x12345679, er1	; 111
	test_h_gr32	foo, er2

t02q:
	mov.l	#4, er2
	mova/b.l @(0x12345678:32, @(foo:16, er2).b), er1
	test_h_gr32	0x12345688, er1 ; 115
	mova/b.l @(0x12345678:32, @(foo:16, r2L.b).b), er1
	test_h_gr32	0x12345688, er1 ; 117
	mova/b.l @(0x12345678:32, @(foo:16, r2.w).b), er1
	test_h_gr32	0x12345688, er1 ; 118
	mova/b.l @(0x12345678:32, @(foo:16, er2.l).b), er1
	test_h_gr32	0x12345688, er1 ; 119

	mov.l	#4, er2
	mova/b.l @(0x12345678:32, @(foo:32, er2).b), er1
	test_h_gr32	0x12345688, er1 ; 116
	mova/b.l @(0x12345678:32, @(foo:32, r2L.b).b), er1
	test_h_gr32	0x12345688, er1 ; 120
	mova/b.l @(0x12345678:32, @(foo:32, r2.w).b), er1
	test_h_gr32	0x12345688, er1 ; 121
	mova/b.l @(0x12345678:32, @(foo:32, er2.l).b), er1
	test_h_gr32	0x12345688, er1 ; 122

	mova/b.l @(0x12345678:32,@foo:16.b),er1
	test_h_gr32	0x12345679, er1 ; 123
	mova/b.l @(0x12345678:32,@foo:32.b),er1
	test_h_gr32	0x12345679, er1 ; 124

t02r:
	mov.l	#foo, er2
	mova/b.l @(0x12345678:32,@er2.w),er1              ;015F029912345678
	test_h_gr32	0x12345779, er1	; 125
	mova/b.l @(0x12345678:32,@(0x2:2,er2).w),er1      ;015F129912345678
	test_h_gr32	0x12345779, er1 ; 130
	mova/b.l @(0x12345678:32,@er2+.w),er1             ;015F829912345678
	test_h_gr32	0x12345779, er1	; 126
	test_h_gr32	foo+2, er2
	mova/b.l @(0x12345678:32,@-er2.w),er1             ;015FB29912345678
	test_h_gr32	0x12345779, er1	; 129
	test_h_gr32	foo, er2
	mova/b.l @(0x12345678:32,@+er2.w),er1             ;015F929912345678
	test_h_gr32	0x12345779, er1 ; 128
	test_h_gr32	foo+2, er2
	mova/b.l @(0x12345678:32,@er2-.w),er1             ;015FA29912345678
	test_h_gr32	0x12345779, er1 ; 127
	test_h_gr32	foo, er2

	mov.l	#4, er2
	mova/b.l @(0x12345678:32, @(foo:16, er2).w), er1
	test_h_gr32	0x12346688, er1 ; 131
	shar.l	er2
	mova/b.l @(0x12345678:32, @(foo:16, r2L.b).w), er1
	test_h_gr32	0x12346688, er1 ; 133
	mova/b.l @(0x12345678:32, @(foo:16, r2.w).w), er1
	test_h_gr32	0x12346688, er1 ; 134
	mova/b.l @(0x12345678:32, @(foo:16, er2.l).w), er1
	test_h_gr32	0x12346688, er1 ; 135

	mov.l	#4, er2
	mova/b.l @(0x12345678:32, @(foo:32, er2).w), er1
	test_h_gr32	0x12346688, er1 ; 132
	shar.l	er2
	mova/b.l @(0x12345678:32, @(foo:32, r2L.b).w), er1
	test_h_gr32	0x12346688, er1 ; 136
	mova/b.l @(0x12345678:32, @(foo:32, r2.w).w), er1
	test_h_gr32	0x12346688, er1 ; 137
	mova/b.l @(0x12345678:32, @(foo:32, er2.l).w), er1
	test_h_gr32	0x12346688, er1 ; 138

	mova/b.l @(0x12345678:32,@foo:16.w),er1
	test_h_gr32	0x12345779, er1 ; 139
	mova/b.l @(0x12345678:32,@foo:32.w),er1
	test_h_gr32	0x12345779, er1 ; 140

t02s:
	mov.l	#foo, er2
	mova/w.l @(0x12345678:32,@er2.b),er1           ;017F02A912345678
	test_h_gr32	0x1234567a, er1	; 141
	mova/w.l @(0x12345678:32,@(0x1:2,er2).b),er1   ;017F12A912345678
	test_h_gr32	0x1234567a, er1	; 146
	mova/w.l @(0x12345678:32,@er2+.b),er1          ;017F82A912345678
	test_h_gr32	0x1234567a, er1	; 142
	test_h_gr32	foo+1, er2
	mova/w.l @(0x12345678:32,@-er2.b),er1          ;017FB2A912345678
	test_h_gr32	0x1234567a, er1	; 145
	test_h_gr32	foo, er2
	mova/w.l @(0x12345678:32,@+er2.b),er1          ;017F92A912345678
	test_h_gr32	0x1234567a, er1	; 144
	test_h_gr32	foo+1, er2
	mova/w.l @(0x12345678:32,@er2-.b),er1          ;017FA2A912345678
	test_h_gr32	0x1234567a, er1	; 143
	test_h_gr32	foo, er2

	mov.l	#4, er2
	mova/w.l @(0x12345678:32, @(foo:16, er2).b), er1
	test_h_gr32	0x12345698, er1 ; 147
	mova/w.l @(0x12345678:32, @(foo:16, r2L.b).b), er1
	test_h_gr32	0x12345698, er1 ; 149
	mova/w.l @(0x12345678:32, @(foo:16, r2.w).b), er1
	test_h_gr32	0x12345698, er1 ; 150
	mova/w.l @(0x12345678:32, @(foo:16, er2.l).b), er1
	test_h_gr32	0x12345698, er1 ; 151

	mov.l	#4, er2
	mova/w.l @(0x12345678:32, @(foo:32, er2).b), er1
	test_h_gr32	0x12345698, er1 ; 148
	mova/w.l @(0x12345678:32, @(foo:32, r2L.b).b), er1
	test_h_gr32	0x12345698, er1 ; 152
	mova/w.l @(0x12345678:32, @(foo:32, r2.w).b), er1
	test_h_gr32	0x12345698, er1 ; 153
	mova/w.l @(0x12345678:32, @(foo:32, er2.l).b), er1
	test_h_gr32	0x12345698, er1 ; 154

	mova/w.l @(0x12345678:32,@foo:16.b),er1
	test_h_gr32	0x1234567a, er1 ; 155
	mova/w.l @(0x12345678:32,@foo:32.b),er1
	test_h_gr32	0x1234567a, er1 ; 156

t02t:
	mov.l	#foo, er2
	mova/w.l @(0x12345678:32,@er2.w),er1           ;015F02B912345678
	test_h_gr32	0x1234587a, er1	; 157
	mova/w.l @(0x12345678:32,@(0x2:2,er2).w),er1   ;015F12B912345678
	test_h_gr32	0x1234587a, er1	; 162
	mova/w.l @(0x12345678:32,@er2+.w),er1          ;015F82B912345678
	test_h_gr32	0x1234587a, er1	; 158
	test_h_gr32	foo+2, er2
	mova/w.l @(0x12345678:32,@-er2.w),er1          ;015FB2B912345678
	test_h_gr32	0x1234587a, er1	; 161
	test_h_gr32	foo, er2
	mova/w.l @(0x12345678:32,@+er2.w),er1          ;015F92B912345678
	test_h_gr32	0x1234587a, er1	; 160
	test_h_gr32	foo+2, er2
	mova/w.l @(0x12345678:32,@er2-.w),er1          ;015FA2B912345678
	test_h_gr32	0x1234587a, er1	; 159
	test_h_gr32	foo, er2

	mov.l	#4, er2
	mova/w.l @(0x12345678:32, @(foo:16, er2).w), er1
	test_h_gr32	0x12347698, er1 ; 163
	shar.l	er2
	mova/w.l @(0x12345678:32, @(foo:16, r2L.b).w), er1
	test_h_gr32	0x12347698, er1 ; 165
	mova/w.l @(0x12345678:32, @(foo:16, r2.w).w), er1
	test_h_gr32	0x12347698, er1 ; 166
	mova/w.l @(0x12345678:32, @(foo:16, er2.l).w), er1
	test_h_gr32	0x12347698, er1 ; 167

	mov.l	#4, er2
	mova/w.l @(0x12345678:32, @(foo:32, er2).w), er1
	test_h_gr32	0x12347698, er1 ; 164
	shar.l	er2
	mova/w.l @(0x12345678:32, @(foo:32, r2L.b).w), er1
	test_h_gr32	0x12347698, er1 ; 168
	mova/w.l @(0x12345678:32, @(foo:32, r2.w).w), er1
	test_h_gr32	0x12347698, er1 ; 169
	mova/w.l @(0x12345678:32, @(foo:32, er2.l).w), er1
	test_h_gr32	0x12347698, er1 ; 170

	mova/w.l @(0x12345678:32,@foo:16.w),er1
	test_h_gr32	0x1234587a, er1 ; 171
	mova/w.l @(0x12345678:32,@foo:32.w),er1
	test_h_gr32	0x1234587a, er1 ; 172

t02u:
	mov.l	#foo, er2
	mova/l.l @(0x12345678:32,@er2.b),er1           ;017F02C912345678
	test_h_gr32	0x1234567c, er1	; 173
	mova/l.l @(0x12345678:32,@(0x1:2,er2).b),er1   ;017F12C912345678
	test_h_gr32	0x1234567c, er1	; 178
	mova/l.l @(0x12345678:32,@er2+.b),er1          ;017F82C912345678
	test_h_gr32	0x1234567c, er1	; 174
	test_h_gr32	foo+1, er2
	mova/l.l @(0x12345678:32,@-er2.b),er1          ;017FB2C912345678
	test_h_gr32	0x1234567c, er1	; 177
	test_h_gr32	foo, er2
	mova/l.l @(0x12345678:32,@+er2.b),er1          ;017F92C912345678
	test_h_gr32	0x1234567c, er1	; 176
	test_h_gr32	foo+1, er2
	mova/l.l @(0x12345678:32,@er2-.b),er1          ;017FA2C912345678
	test_h_gr32	0x1234567c, er1	; 175
	test_h_gr32	foo, er2

	mov.l	#4, er2
	mova/l.l @(0x12345678:32, @(foo:16, er2).b), er1
	test_h_gr32	0x123456b8, er1 ; 179
	mova/l.l @(0x12345678:32, @(foo:16, r2L.b).b), er1
	test_h_gr32	0x123456b8, er1 ; 181
	mova/l.l @(0x12345678:32, @(foo:16, r2.w).b), er1
	test_h_gr32	0x123456b8, er1 ; 182
	mova/l.l @(0x12345678:32, @(foo:16, er2.l).b), er1
	test_h_gr32	0x123456b8, er1 ; 183

	mov.l	#4, er2
	mova/l.l @(0x12345678:32, @(foo:32, er2).b), er1
	test_h_gr32	0x123456b8, er1 ; 180
	mova/l.l @(0x12345678:32, @(foo:32, r2L.b).b), er1
	test_h_gr32	0x123456b8, er1 ; 184
	mova/l.l @(0x12345678:32, @(foo:32, r2.w).b), er1
	test_h_gr32	0x123456b8, er1 ; 185
	mova/l.l @(0x12345678:32, @(foo:32, er2.l).b), er1
	test_h_gr32	0x123456b8, er1 ; 186

	mova/l.l @(0x12345678:32,@foo:16.b),er1
	test_h_gr32	0x1234567c, er1 ; 187
	mova/l.l @(0x12345678:32,@foo:32.b),er1
	test_h_gr32	0x1234567c, er1 ; 188

t02v:
	mov.l	#foo, er2
	mova/l.l @(0x12345678:32,@er2.w),er1           ;015F02D912345678
	test_h_gr32	0x12345a7c, er1	; 189
	mova/l.l @(0x12345678:32,@(0x2:2,er2).w),er1   ;015F12D912345678
	test_h_gr32	0x12345a7c, er1	; 194
	mova/l.l @(0x12345678:32,@er2+.w),er1          ;015F82D912345678
	test_h_gr32	0x12345a7c, er1	; 190
	test_h_gr32	foo+2, er2
	mova/l.l @(0x12345678:32,@-er2.w),er1          ;015FB2D912345678
	test_h_gr32	0x12345a7c, er1	; 193
	test_h_gr32	foo, er2
	mova/l.l @(0x12345678:32,@+er2.w),er1          ;015F92D912345678
	test_h_gr32	0x12345a7c, er1	; 192
	test_h_gr32	foo+2, er2
	mova/l.l @(0x12345678:32,@er2-.w),er1          ;015FA2D912345678
	test_h_gr32	0x12345a7c, er1	; 191
	test_h_gr32	foo, er2

	mov.l	#4, er2
	mova/l.l @(0x12345678:32, @(foo:16, er2).w), er1
	test_h_gr32	0x123496b8, er1 ; 195
	shar.l	er2
	mova/l.l @(0x12345678:32, @(foo:16, r2L.b).w), er1
	test_h_gr32	0x123496b8, er1 ; 197
	mova/l.l @(0x12345678:32, @(foo:16, r2.w).w), er1
	test_h_gr32	0x123496b8, er1 ; 198
	mova/l.l @(0x12345678:32, @(foo:16, er2.l).w), er1
	test_h_gr32	0x123496b8, er1 ; 199

	mov.l	#4, er2
	mova/l.l @(0x12345678:32, @(foo:32, er2).w), er1
	test_h_gr32	0x123496b8, er1 ; 195
	shar.l	er2
	mova/l.l @(0x12345678:32, @(foo:32, r2L.b).w), er1
	test_h_gr32	0x123496b8, er1 ; 197
	mova/l.l @(0x12345678:32, @(foo:32, r2.w).w), er1
	test_h_gr32	0x123496b8, er1 ; 198
	mova/l.l @(0x12345678:32, @(foo:32, er2.l).w), er1
	test_h_gr32	0x123496b8, er1 ; 199

	mova/l.l @(0x12345678:32,@foo:16.w),er1
	test_h_gr32	0x12345a7c, er1 ; 203
	mova/l.l @(0x12345678:32,@foo:32.w),er1
	test_h_gr32	0x12345a7c, er1 ; 204

	test_gr_a5a5	0
	test_h_gr32	2, er2
	test_h_gr32	0x01010101, er3
	test_gr_a5a5	4
	test_gr_a5a5	5
	test_gr_a5a5	6
	test_gr_a5a5	7

	pass

	exit 0