bcd¶
bcd A¶
指令格式¶
bcd A
影响标志¶
C
伪指令¶
1 2 3 4 5 6 | bit T bit[4] H4, L4 {T, L4} = (A[3:0] > 9 or AC == 1) ? A[3:0] + 6 : A[3:0] {T, H4} = A[7:4] + T {C, H4} = ({T, H4} > 9 or C == 1) ? H4 + 6 : H4 A = {H4, L4} |
指令描述¶
对累加器A进行BCD调整,结果存回累加器A;
范例¶
1 2 3 4 | //0x8D的BCD调整 //C = 1, AC = 0, Z = 0, OV = 0 mov A, #0x8D //A = 0x8D bcd A //A = 0xF3, C = 1, AC = 0, Z = 0, OV = 0 |
bcd R, A¶
指令格式¶
bcd R, A
影响标志¶
C
伪指令¶
1 2 3 4 5 6 | bit T bit[4] H4, L4 {T, L4} = (A[3:0] > 9 or AC == 1) ? A[3:0] + 6 : A[3:0] {T, H4} = A[7:4] + T {C, H4} = ({T, H4} > 9 or C == 1) ? H4 + 6 : H4 R = {H4, L4} |
指令描述¶
对累加器A进行BCD调整,结果存储到寄存器R;
范例¶
1 2 3 4 | //0xB7的BCD调整 //C = 0, AC = 0, Z = 0, OV = 0 mov A, #0xB7 //A = 0xB7 bcd 0xA2, A //[0xA2] = 0x17, C = 1, AC = 0, Z = 0, OV = 0 |