TAILIEUCHUNG - GIÁO TRÌNH VI ĐIỀU KHIỂN part 9

Tham khảo tài liệu 'giáo trình vi điều khiển part 9', 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ả | Giáo trình Vi điều khiển Phụ lục 4 - Mô tả tập lệnh The first two operands allow four addressing mode combinations the Accumulator may be compared with any directly addressed byte or immediate data and any indirect RAM location or working register can be compared with an immediate constant. Example The Accumulator contains 34H. Register 7 contains 56H. The first instruction in the sequence CJNE R7 60H NOT_EQ . R7 60H. NOT_EQ JC REQ_LOW IF R7 60H. . . R7 60H. sets the carry flag and branches to the instruction at label NOT_EQ. By testing the carry flag this instruction determines whether R7 is greater or less than 60H. If the data being presented to Port 1 is also 34H then the following instruction WAIT CJNE A P1 WAIT clears the carry flag and continues with the next instruction in sequence since the Accumulator does equal the data read from P1. If some other value was being input on P1 the program loops at this point until the P1 data changes to 34H. . CJNE A direct rel Bytes 3 Cycles 2 Encoding . 1 0 1 1 0 1 0 1 direct address relative address Operation PC PC 3 IF A direct tHeN PC PC relative offset IF A direct THEN C 1 ELSE C 0 . CJNE A data rel Bytes 3 Cycles 2 Encoding . 1 0 1 1 0 1 0 0 immediate data relative address Operation PC PC 3 IF A data THEN PC PC relative offset IF A data THEN C 1 ELSE C 0 . CJNE Rn data rel Phạm Hùng Kim Khánh Trang 201 Sưu tầm bởi Giáo trình Vi điều khiển Phụ lục 4 - Mô tả tập lệnh Bytes 3 Cycles 2 Encoding 1 0 1 1 1 r r r immediate data relative address Operation PC PC 3 IF Rn data THEN PC PC relative offset IF Rn data THEN C 1 ELSE C 0 . CJNE @Ri data rel Bytes 3 Cycles 2 Encoding . 1 0 1 1 0 1 1 i immediate data relative address Operation PC PC 3 IF Ri data tHeN PC PC relative offset IF Ri data THEN C 1 ELSE C 0 8. CLR A Function Clear Accumulator Description CLR A clears the Accumulator all bits set to 0 . No flags are affected Example The Accumulator contains 5CH 01011100B . The following .

TỪ KHÓA LIÊN QUAN