Giáo trình Vi điều khiển - Phụ lục 4: Mô tả tập lệnh
Số trang: 40
Loại file: pdf
Dung lượng: 312.10 KB
Lượt xem: 19
Lượt tải: 0
Xem trước 4 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
ACALL addr11: Function: Absolute Call Description: ACALL unconditionally calls a subroutine located at the indicated address. The instruction increments the PC twice to obtain the address of the following instruction, then pushes the 16-bit result onto the stack (low-order byte first) and increments the Stack Pointer twice. The destination address is obtained by successively concatenating the five high-order bits of the incremented PC, opcode bits 7 through 5, and the second byte of the instruction. ...
Nội dung trích xuất từ tài liệu:
Giáo trình Vi điều khiển - Phụ lục 4: Mô tả tập lệnh Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnh Phụ lục 4: MÔ TẢ TẬP LỆNH 1. ACALL addr11Function: Absolute CallDescription: ACALL unconditionally calls a subroutine located at the indicatedaddress. The instruction increments the PC twice to obtain the address of thefollowing instruction, then pushes the 16-bit result onto the stack (low-order byte first)and increments the Stack Pointer twice. The destination address is obtained bysuccessively concatenating the five high-order bits of the incremented PC, opcode bits7 through 5, and the second byte of the instruction. The subroutine called musttherefore start within the same 2 K block of the program memory as the first byte ofthe instruction following ACALL. No flags are affected.Example: Initially SP equals 07H. The label SUBRTN is at program memory location0345 H. After executing the following instruction, ACALL SUBRTNat location 0123H, SP contains 09H, internal RAM locations 08H and 09H willcontain 25H and 01H, respectively, and the PC contains 0345H.Bytes: 2Cycles: 2Encoding: A10 A9 A8 1 0 0 0 1 A7 A6 A5 A4 A3 A2 A1 A0Operation: ACALL(PC) ← (PC) + 2(SP) ← (SP) + 1((SP)) ← (PC7-0)(SP) ← (SP) + 1((SP)) ← (PC15-8)(PC10-0) ← page address 2. ADD A,Function: AddDescription: ADD adds the byte variable indicated to the Accumulator, leaving theresult in the Accumulator. The carry and auxiliary-carry flags are set, respectively, ifthere is a carry-out from bit 7 or bit 3, and cleared otherwise. When adding unsignedintegers, the carry flag indicates an overflow occurred.OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 butnot bit 6; otherwise, OV is cleared. When adding signed integers, OV indicates anegative number produced as the sum of two positive operands, or a positive sumfrom two negative operands.Four source operand addressing modes are allowed: register, direct, register-indirect,or immediate.Phạm Hùng Kim Khánh Trang 195Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhExample: The Accumulator holds 0C3H (1100001lB), and register 0 holds 0AAH(10101010B). The following instruction, ADD A,R0leaves 6DH (01101101B) in the Accumulator with the AC flag cleared and both thecarry flag and OV set to 1. 2.1. ADD A,RnBytes: 1Cycles: 1Encoding: 0 0 1 0 1 r r rOperation: ADD(A) ← (A) + (Rn) 2.2. ADD A,directBytes: 2Cycles: 1Encoding: 0 0 1 0 0 1 0 1 direct addressOperation: ADD(A) ← (A) + (direct) 2.3. ADD A,@RiBytes: 1Cycles: 1Encoding: 0 0 1 0 0 1 1 iOperation: ADD(A) ← (A) + ((Ri)) 2.4. ADD A,#dataBytes: 2Cycles: 1Encoding: 0 0 1 0 0 1 0 0 immediate dataOperation: ADD(A) ← (A) + #data 3. ADDC A, Function: Add with CarryDescription: ADDC simultaneously adds the byte variable indicated, the carry flagand the Accumulator contents, leaving the result in the Accumulator. The carry andauxiliary-carry flags are set respectively, if there is a carry-out from bit 7 or bit 3, andPhạm Hùng Kim Khánh Trang 196Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhcleared otherwise. When adding unsigned integers, the carry flag indicates anoverflow occurred.OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 butnot out of bit 6; otherwise OV is cleared. When adding signed integers, OV indicates anegative number produced as the sum of two positive operands or a positive sum fromtwo negative operands.Four source operand addressing modes are allowed: register, direct, register-indirect,or immediate.Example: The Accumulator holds 0C3H (11000011B) and register 0 holds 0AAH(10101010B) with the carry flag set. The following instruction, ADDC A,R0leaves 6EH (01101110B) in the Accumulator with AC cleared and both the Carry flagand OV set to 1. 3.1. ADDC A,RnBytes: 1Cycles: 1Encoding: 0 0 1 1 1 r r rOperation: ADDC(A) ← (A) + (C) + (Rn) 3.2. ADDC A,directBytes: 2Cycles: 1Encoding: 0 0 1 1 0 1 0 1 direct addressOperation: ADDC(A) ← (A) + (C) + (direct) 3.3. ADDC A,@RiBytes: 1Cycles: 1Encoding: 0 0 1 1 0 1 1 iOperation: ADDC(A) ← (A) + (C) + ((Ri)) 3.4. ADDC A,#dataBytes: 2Cycles: 1Encoding: 0 0 1 1 0 1 0 0 immediate dataPhạm Hùng Kim Khánh Trang 197Giáo trình Vi ...
Nội dung trích xuất từ tài liệu:
Giáo trình Vi điều khiển - Phụ lục 4: Mô tả tập lệnh Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnh Phụ lục 4: MÔ TẢ TẬP LỆNH 1. ACALL addr11Function: Absolute CallDescription: ACALL unconditionally calls a subroutine located at the indicatedaddress. The instruction increments the PC twice to obtain the address of thefollowing instruction, then pushes the 16-bit result onto the stack (low-order byte first)and increments the Stack Pointer twice. The destination address is obtained bysuccessively concatenating the five high-order bits of the incremented PC, opcode bits7 through 5, and the second byte of the instruction. The subroutine called musttherefore start within the same 2 K block of the program memory as the first byte ofthe instruction following ACALL. No flags are affected.Example: Initially SP equals 07H. The label SUBRTN is at program memory location0345 H. After executing the following instruction, ACALL SUBRTNat location 0123H, SP contains 09H, internal RAM locations 08H and 09H willcontain 25H and 01H, respectively, and the PC contains 0345H.Bytes: 2Cycles: 2Encoding: A10 A9 A8 1 0 0 0 1 A7 A6 A5 A4 A3 A2 A1 A0Operation: ACALL(PC) ← (PC) + 2(SP) ← (SP) + 1((SP)) ← (PC7-0)(SP) ← (SP) + 1((SP)) ← (PC15-8)(PC10-0) ← page address 2. ADD A,Function: AddDescription: ADD adds the byte variable indicated to the Accumulator, leaving theresult in the Accumulator. The carry and auxiliary-carry flags are set, respectively, ifthere is a carry-out from bit 7 or bit 3, and cleared otherwise. When adding unsignedintegers, the carry flag indicates an overflow occurred.OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 butnot bit 6; otherwise, OV is cleared. When adding signed integers, OV indicates anegative number produced as the sum of two positive operands, or a positive sumfrom two negative operands.Four source operand addressing modes are allowed: register, direct, register-indirect,or immediate.Phạm Hùng Kim Khánh Trang 195Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhExample: The Accumulator holds 0C3H (1100001lB), and register 0 holds 0AAH(10101010B). The following instruction, ADD A,R0leaves 6DH (01101101B) in the Accumulator with the AC flag cleared and both thecarry flag and OV set to 1. 2.1. ADD A,RnBytes: 1Cycles: 1Encoding: 0 0 1 0 1 r r rOperation: ADD(A) ← (A) + (Rn) 2.2. ADD A,directBytes: 2Cycles: 1Encoding: 0 0 1 0 0 1 0 1 direct addressOperation: ADD(A) ← (A) + (direct) 2.3. ADD A,@RiBytes: 1Cycles: 1Encoding: 0 0 1 0 0 1 1 iOperation: ADD(A) ← (A) + ((Ri)) 2.4. ADD A,#dataBytes: 2Cycles: 1Encoding: 0 0 1 0 0 1 0 0 immediate dataOperation: ADD(A) ← (A) + #data 3. ADDC A, Function: Add with CarryDescription: ADDC simultaneously adds the byte variable indicated, the carry flagand the Accumulator contents, leaving the result in the Accumulator. The carry andauxiliary-carry flags are set respectively, if there is a carry-out from bit 7 or bit 3, andPhạm Hùng Kim Khánh Trang 196Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhcleared otherwise. When adding unsigned integers, the carry flag indicates anoverflow occurred.OV is set if there is a carry-out of bit 6 but not out of bit 7, or a carry-out of bit 7 butnot out of bit 6; otherwise OV is cleared. When adding signed integers, OV indicates anegative number produced as the sum of two positive operands or a positive sum fromtwo negative operands.Four source operand addressing modes are allowed: register, direct, register-indirect,or immediate.Example: The Accumulator holds 0C3H (11000011B) and register 0 holds 0AAH(10101010B) with the carry flag set. The following instruction, ADDC A,R0leaves 6EH (01101110B) in the Accumulator with AC cleared and both the Carry flagand OV set to 1. 3.1. ADDC A,RnBytes: 1Cycles: 1Encoding: 0 0 1 1 1 r r rOperation: ADDC(A) ← (A) + (C) + (Rn) 3.2. ADDC A,directBytes: 2Cycles: 1Encoding: 0 0 1 1 0 1 0 1 direct addressOperation: ADDC(A) ← (A) + (C) + (direct) 3.3. ADDC A,@RiBytes: 1Cycles: 1Encoding: 0 0 1 1 0 1 1 iOperation: ADDC(A) ← (A) + (C) + ((Ri)) 3.4. ADDC A,#dataBytes: 2Cycles: 1Encoding: 0 0 1 1 0 1 0 0 immediate dataPhạm Hùng Kim Khánh Trang 197Giáo trình Vi ...
Tìm kiếm theo từ khóa liên quan:
Giáo trình Vi điều khiển Mô tả tập lệnh ACALL addr11 AJMP addr11 DEC byteTài liệu liên quan:
-
Giáo trình Vi điều khiển (Nghề: Cơ điện tử - Trình độ: Cao đẳng) - Trường Cao đẳng nghề Ninh Thuận
127 trang 282 0 0 -
Giáo trình Vi điều khiển (Nghề: Điện công nghiệp - Cao đẳng) - Trường Cao đẳng Cơ giới (2022)
144 trang 155 0 0 -
Điều khiển số (Digital Control Systems) - ĐH Bách Khoa Hà Nội
110 trang 57 0 0 -
Giáo trình Vi điều khiển - ThS. Phạm Hùng Kim Khánh
194 trang 52 0 0 -
93 trang 43 0 0
-
Giáo trình Vi điều khiển - CĐ Cơ Điện Hà Nội
216 trang 36 0 0 -
15 trang 35 0 0
-
93 trang 34 0 0
-
Giáo trình kỹ thuật vi điều khiển - ĐH SPKT Hưng Yên
96 trang 32 0 0 -
Giáo trình Vi điều khiển (Nghề: Tự động hoá - Trung cấp) - Trường Cao đẳng Cơ giới (2022)
76 trang 31 0 0