rolc¶
rolc R¶
指令格式¶
rolc R
影响标志¶
C
Z
伪代码描述¶
1 2 3 4 | TEMP = R; R = ((R << 1) & 0xff) | C; C = TEMP >> 7; Z = R == 0 ? 1 : 0; |
指令描述¶
寄存器R内容带C标志循环左移1位,结果存储到寄存器R中。
指令执行前:
R.7 R.6 R.5 R.4 R.3 R.2 R.1 R.0 C
+----+----+----+----+----+----+----+----+ +----+
+---| b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 |<---| c |<---+
| +----+----+----+----+----+----+----+----+ +----+ |
| |
+----------------------------------------------------------+
指令执行后:
R.7 R.6 R.5 R.4 R.3 R.2 R.1 R.0 C
+----+----+----+----+----+----+----+----+ +----+
| b6 | b5 | b4 | b3 | b2 | b1 | b0 | c | | b7 |
+----+----+----+----+----+----+----+----+ +----+
范例¶
1 2 3 4 5 | //0x74 << 1 //C = 1, AC = 0, Z = 0, OV = 0 mov A, #0x74 //A = 0x74 mov 0xE0, A //[0xE0] = 0x74 rolc 0xE0 //[0xE0] = 0xE9, C = 0, AC = 0, Z = 0, OV = 0 |
rolc A, R¶
指令格式¶
rolc A, R
影响标志¶
C
Z
伪代码描述¶
1 2 3 | A = ((R << 1) & 0xff) | C; C = R >> 7; Z = A == 0 ? 1 : 0; |
指令描述¶
寄存器R内容带C标志循环左移1位,结果存储到累加器A中。
指令执行前:
R.7 R.6 R.5 R.4 R.3 R.2 R.1 R.0 C
+----+----+----+----+----+----+----+----+ +----+
+---| b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 |<---| c |<---+
| +----+----+----+----+----+----+----+----+ +----+ |
| |
+----------------------------------------------------------+
指令执行后:
A.7 A.6 A.5 A.4 A.3 A.2 A.1 A.0 C
+----+----+----+----+----+----+----+----+ +----+
| b6 | b5 | b4 | b3 | b2 | b1 | b0 | c | | b7 |
+----+----+----+----+----+----+----+----+ +----+
范例¶
1 2 3 4 5 | //0x85 << 1 //C = 0, AC = 0, Z = 0, OV = 0 mov A, #0x85 //A = 0x85 mov 0xF2, A //[0xF2] = 0x85 rolc A, 0xF2 //A = 0x0A, C = 1, AC = 0, Z = 0, OV = 0 |