rev¶
rev R¶
指令格式¶
rev R
影响标志¶
无
伪代码描述¶
1 2 | R = (R >> 4) & 0x0f | (R << 4) & 0xf0; |
指令描述¶
寄存器R内容的高4位和低4位交换,结果存储到寄存器R中。
指令执行前:
7 6 5 4 3 2 1 0
+----+----+----+----+----+----+----+----+
R = | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 |
+----+----+----+----+----+----+----+----+
指令执行后:
7 6 5 4 3 2 1 0
+----+----+----+----+----+----+----+----+
R = | b3 | b2 | b1 | b0 | b7 | b6 | b5 | b4 |
+----+----+----+----+----+----+----+----+
rev A, R¶
指令格式¶
rev A, R
影响标志¶
无
伪代码描述¶
1 2 | A = (R >> 4) & 0x0f | (R << 4) & 0xf0; |
指令描述¶
寄存器R内容的高4位和低4位交换,结果存储到累加器A中。
指令执行前:
7 6 5 4 3 2 1 0
+----+----+----+----+----+----+----+----+
R = | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 |
+----+----+----+----+----+----+----+----+
指令执行后:
7 6 5 4 3 2 1 0
+----+----+----+----+----+----+----+----+
A = | b3 | b2 | b1 | b0 | b7 | b6 | b5 | b4 |
+----+----+----+----+----+----+----+----+
范例¶
1 2 3 | mov A, #0xC5 //A = 0xC5 mov R, A //R = 0xC5 rev A, R //A = 0x5C |