GIÁO TRÌNH VI ĐIỀU KHIỂN part 10
Số trang: 14
Loại file: pdf
Dung lượng: 239.01 KB
Lượt xem: 8
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Tham khảo tài liệu giáo trình vi điều khiển part 10, công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả
Nội dung trích xuất từ tài liệu:
GIÁO TRÌNH VI ĐIỀU KHIỂN part 10Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhCycles: 2Encoding: 1110001iOperation: MOVX(A) ← ((Ri)) 32.2. MOVX A,@DPTRBytes: 1Cycles: 2Encoding: 11100000Operation: MOVX(A) ← ((DPTR)) 32.3. MOVX @Ri,ABytes: 1Cycles: 2Encoding: 1111001iOperation: MOVX((Ri)) ← (A) 32.4. MOVX @DPTR,ABytes: 1Cycles: 2Encoding: 11110000Operation: MOVX(DPTR) ← (A) 33. MUL ABFunction: MultiplyDescription: MUL AB multiplies the unsigned 8-bit integers in the Accumulator andregister B. The low-order byte of the 16-bit product is left in the Accumulator, and thehigh-order byte in B. If the product is greater than 255 (0FFH), the overflow flag isset; otherwise it is cleared. The carry flag is always cleared.Example: Originally the Accumulator holds the value 80 (50H). Register B holds thevalue 160 (0A0H). The instruction, MUL ABwill give the product 12,800 (3200H), so B is changed to 32H (00110010B) and theAccumulator is cleared. The overflow flag is set, carry is cleared.Bytes: 1Cycles: 4Phạm Hùng Kim Khánh Trang 221 Sưu t m b i: www.daihoc.com.vnGiáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhEncoding: 10100100Operation: MUL(A)7-0 ← (A) X (B)(B)15-8 34. NOPFunction: No OperationDescription: Execution continues at the following instruction. Other than the PC, noregisters or flags are affected.Example: A low-going output pulse on bit 7 of Port 2 must last exactly 5 cycles. Asimple SETB/CLR sequence generates a one-cycle pulse, so four additional cyclesmust be inserted. This may be done (assuming no interrupts are enabled) with thefollowing instruction sequence, CLR P2.7 NOP NOP NOP NOP SETB P2.7Bytes: 1Cycles: 1Encoding: 00000000Operation: NOP(PC) ← (PC) + 1 35. ORL,Function: Logical-OR for byte variablesDescription: ORL performs the bitwise logical-OR operation between the indicatedvariables, storing the results in the destination byte. No flags are affected.The two operands allow six addressing mode combinations. When the destination isthe Accumulator, the source can use register, direct, register-indirect, or immediateaddressing; when the destination is a direct address, the source can be theAccumulator or immediate data.Note: When this instruction is used to modify an output port, the value used as theoriginal port data is read from the output data latch, not the input pins.Example: If the Accumulator holds 0C3H (11000011B) and R0 holds 55H(01010101B) then the following instruction, ORL A,R0leaves the Accumulator holding the value 0D7H (1101011lB).When the destination isa directly addressed byte, the instruction can set combinations of bits in any RAMlocation or hardware register. The pattern of bits to be set is determined by a maskbyte, which may be either a constant data value in the instruction or a variablePhạm Hùng Kim Khánh Trang 222 Sưu t m b i: www.daihoc.com.vnGiáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhcomputed in the Accumulator at run-time. The instruction, ORL P1,#00110010Bsets bits 5, 4, and 1 of output Port 1. 35.1. ORL A,RnBytes: 1Cycles: 1Encoding: 01001rrrOperation: ORL(A) ← (A) ∨ (Rn) 35.2. ORL A,directBytes: 2Cycles: 1Encoding: 0 1 0 0 0 1 0 1 direct addressOperation: ORL(A) ← (A) ∨ (direct) 35.3. ORL A,@RiBytes: 1Cycles: 1Encoding: 0100011iOperation: ORL(A) ← (A) ∨ ((Ri)) 35.4. ORL A,#dataBytes: 2Cycles: 1Encoding: 0 1 0 0 0 1 0 0 immediate dataOperation: ORL(A) ← (A) ∨ #data 35.5. ORL direct,ABytes: 2Cycles: 1Encoding: 0 1 0 0 0 0 1 0 direct addressOperation: ORL(direct) ← (direct) ∨ (A)Phạm Hùng Kim Khánh Trang 223 Sưu t m b i: www.daihoc.com.vnGiáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnh 35.6. ORL direct,#dataBytes: 3Cycles: 2Encoding: 0 1 0 0 0 0 1 1 direct address immediate dataOperation: ORL(direct) ← (direct) ∨ #data 36. ORL C,Function: Logical-OR for bit variablesDescription: Set the carry flag if the Boolean value is a logical 1; leave the carry in itscurrent state otherwise. A slash ( / ) preceding the ...
Nội dung trích xuất từ tài liệu:
GIÁO TRÌNH VI ĐIỀU KHIỂN part 10Giáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhCycles: 2Encoding: 1110001iOperation: MOVX(A) ← ((Ri)) 32.2. MOVX A,@DPTRBytes: 1Cycles: 2Encoding: 11100000Operation: MOVX(A) ← ((DPTR)) 32.3. MOVX @Ri,ABytes: 1Cycles: 2Encoding: 1111001iOperation: MOVX((Ri)) ← (A) 32.4. MOVX @DPTR,ABytes: 1Cycles: 2Encoding: 11110000Operation: MOVX(DPTR) ← (A) 33. MUL ABFunction: MultiplyDescription: MUL AB multiplies the unsigned 8-bit integers in the Accumulator andregister B. The low-order byte of the 16-bit product is left in the Accumulator, and thehigh-order byte in B. If the product is greater than 255 (0FFH), the overflow flag isset; otherwise it is cleared. The carry flag is always cleared.Example: Originally the Accumulator holds the value 80 (50H). Register B holds thevalue 160 (0A0H). The instruction, MUL ABwill give the product 12,800 (3200H), so B is changed to 32H (00110010B) and theAccumulator is cleared. The overflow flag is set, carry is cleared.Bytes: 1Cycles: 4Phạm Hùng Kim Khánh Trang 221 Sưu t m b i: www.daihoc.com.vnGiáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhEncoding: 10100100Operation: MUL(A)7-0 ← (A) X (B)(B)15-8 34. NOPFunction: No OperationDescription: Execution continues at the following instruction. Other than the PC, noregisters or flags are affected.Example: A low-going output pulse on bit 7 of Port 2 must last exactly 5 cycles. Asimple SETB/CLR sequence generates a one-cycle pulse, so four additional cyclesmust be inserted. This may be done (assuming no interrupts are enabled) with thefollowing instruction sequence, CLR P2.7 NOP NOP NOP NOP SETB P2.7Bytes: 1Cycles: 1Encoding: 00000000Operation: NOP(PC) ← (PC) + 1 35. ORL,Function: Logical-OR for byte variablesDescription: ORL performs the bitwise logical-OR operation between the indicatedvariables, storing the results in the destination byte. No flags are affected.The two operands allow six addressing mode combinations. When the destination isthe Accumulator, the source can use register, direct, register-indirect, or immediateaddressing; when the destination is a direct address, the source can be theAccumulator or immediate data.Note: When this instruction is used to modify an output port, the value used as theoriginal port data is read from the output data latch, not the input pins.Example: If the Accumulator holds 0C3H (11000011B) and R0 holds 55H(01010101B) then the following instruction, ORL A,R0leaves the Accumulator holding the value 0D7H (1101011lB).When the destination isa directly addressed byte, the instruction can set combinations of bits in any RAMlocation or hardware register. The pattern of bits to be set is determined by a maskbyte, which may be either a constant data value in the instruction or a variablePhạm Hùng Kim Khánh Trang 222 Sưu t m b i: www.daihoc.com.vnGiáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnhcomputed in the Accumulator at run-time. The instruction, ORL P1,#00110010Bsets bits 5, 4, and 1 of output Port 1. 35.1. ORL A,RnBytes: 1Cycles: 1Encoding: 01001rrrOperation: ORL(A) ← (A) ∨ (Rn) 35.2. ORL A,directBytes: 2Cycles: 1Encoding: 0 1 0 0 0 1 0 1 direct addressOperation: ORL(A) ← (A) ∨ (direct) 35.3. ORL A,@RiBytes: 1Cycles: 1Encoding: 0100011iOperation: ORL(A) ← (A) ∨ ((Ri)) 35.4. ORL A,#dataBytes: 2Cycles: 1Encoding: 0 1 0 0 0 1 0 0 immediate dataOperation: ORL(A) ← (A) ∨ #data 35.5. ORL direct,ABytes: 2Cycles: 1Encoding: 0 1 0 0 0 0 1 0 direct addressOperation: ORL(direct) ← (direct) ∨ (A)Phạm Hùng Kim Khánh Trang 223 Sưu t m b i: www.daihoc.com.vnGiáo trình Vi điều khiển Phụ lục 4 – Mô tả tập lệnh 35.6. ORL direct,#dataBytes: 3Cycles: 2Encoding: 0 1 0 0 0 0 1 1 direct address immediate dataOperation: ORL(direct) ← (direct) ∨ #data 36. ORL C,Function: Logical-OR for bit variablesDescription: Set the carry flag if the Boolean value is a logical 1; leave the carry in itscurrent state otherwise. A slash ( / ) preceding the ...
Tìm kiếm theo từ khóa liên quan:
giáo trinh vi điều khiển tài liệu vi điều khiển bài giảng vi điều khiển đề cương vi điều khiển tài liệu điện tửTà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 286 0 0 -
Cơ Sở Điện Học Truyền Thông - Tín Hiệu Số part 1
9 trang 184 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 156 0 0 -
Tài liệu thực hành Vi điều khiển 8051
55 trang 106 0 0 -
Điều khiển số (Digital Control Systems) - ĐH Bách Khoa Hà Nội
110 trang 58 0 0 -
Giáo trình Vi điều khiển - ThS. Phạm Hùng Kim Khánh
194 trang 52 0 0 -
Giáo trình hoàn chỉnh vi điều khiển PIC 14
8 trang 48 0 0 -
93 trang 43 0 0
-
Giáo trình Thí nghiệm điện tử công suất - ĐH Công Nghiệp Tp HCM
238 trang 42 0 0 -
Công tác bổ sung tài liệu tại Thư viện Khoa học Xã hội
6 trang 41 0 0