Rotate test bench

From Zet
Jump to: navigation, search

This example tests these instructions:

  • rcl 1 (w:1,r), 2 (w:1,m), 3 (w:cl,r), 4 (w:cl,m), 5 (b:1,r), 6 (b:1,m), 7 (b:cl,r), 8 (b:cl,m)
  • rcr 9 (w:1,r), 10(w:1,m), 11(w:cl,r), 12(w:cl,m), 13(b:1,r), 14(b:1,m), 15(b:cl,r), 16(b:cl,m)
  • rol 17(w:1,r), 18(w:1,m), 19(w:cl,r), 20(w:cl,m), 21(b:1,r), 22(b:1,m), 23(b:cl,r), 24(b:cl,m)
  • ror 25(w:1,r), 26(w:1,m), 27(w:cl,r), 28(w:cl,m), 29(b:1,r), 30(b:1,m), 31(b:cl,r), 32(b:cl,m)

Code

<embed_code>12_rotate.s</embed_code>

Results

Memory contents at the end should be:

0x00:  0x40e4  0xe791  0xad2f  0x6f36  0x4d5b  0xc28b  0x5214  0x28e0
0x10:  0x51ba  0x74ad  0x1680  0x4874  0x80a8  0x7723  0xaed9  0xc7ef
0x20:  0x76bc  0xc8a7  0xd914  0xa7e4  0x7d7c  0x5941  0x0aeb  0x8307
0x30:  0x183e  0x7418  0x1d8d  0x7ea9  0x041a  0x8d5a  0x46ad  0xd5a8
0x40:  0x9348  0x9d84  0x792f  0x2eb5  0x5d6a  0x52eb  0xc5ab  0x4211
0x50:  0x0003  0x0002  0x0803  0x0003  0x0802  0x0802  0x0802  0x0803
0x60:  0x0803  0x0802  0x0002  0x0802  0x0002  0x0003  0x0803  0x0802
0x70:  0x0803  0x0002  0x0002  0x0002  0x0002  0x0802  0x0802  0x0002
0x80:  0x0002  0x0802  0x0002  0x0803  0x0803  0x0002  0x0002  0x0002
0x90:  0x0003  0x0803  0x0003  0x0802  0x0003  0x0002  0x0002  0x0002