180 likes | 358 Views
ECT 357. Ch 3 Instruction Set. Today’s Quote: Decisions can take you out of God’s will but never out of His reach. If we are faithless, he will remain faithful, for he cannot disown himself. 2 Timothy 2:13. Accumulator. A multipurpose register capable of: Bit Shifting
E N D
ECT 357 Ch 3 Instruction Set
Today’s Quote: Decisions can take you out of God’s will but never out of His reach. If we are faithless, he will remain faithful, for he cannot disown himself. 2 Timothy 2:13
Accumulator A multipurpose register capable of: • Bit Shifting • Incrementing/Decrementing • Complementing • Adding/Subtracting • Swapping Nibbles • Boolean Operations
Accumulator Operations The 128 Access Bank RAM locations plus all of the Special Function Registers act as accumulators. If two operands are needed, then one will be moved to the working register.
F/W Operands If F or W are included as a possible operand for an instruction, they indicate that the final result will be placed in the original location (F) or the working register (W).
Number Formats Hex 0x7f Hex H’7f’ (alternative) Hex 20 (default) Binary B’10011100’ Decimal D’32’ Octal O’777’ ASCII A’C’ ASCII ‘C’ (alternative)
Letter Indications • L Literal • F Memory • W Working Register • B Bank Select Register • C Carry • NC No Carry • SC Skip Clear • SS Skip Set
Instruction Types Move Bit Boolean Arithmetic Branch Conditional Skip Subroutine Other
Move Instructions • movlw • movwf • movff • movf (flag changes) • lfsr • movlb • swapf
Bit Instructions • bsf • bcf • btg • rrncf • rlncf • rrcf • rlcf
Boolean Instructions • andlw • andwf • iorlw • iorwf • xorlw • xorwf
Arithmetic Instructions • addlw • addwf • addwfc • sublw • subwf • subwfb • subfwb • mullw • mulwf
Branch Instructions • bc • bnc • bz • bnz • bn • bnn • bov • bnov • goto • bra
Conditional Skip Instructions • btfsc • btfss • cpfslt • cpfseq • cpfsgt • tstfsz • decfsz • dcfsnz • incfsz • infsnz
Subroutine Instructions • call • rcall • retlw • return
Other Instructions • clrf • setf • incf • decf • comf • negf • daw
Other Instructions Continued • retfie • push • pop • clrwdt • sleep • reset • nop
Table Instructions • tblrd* • tblrd*+ • tblrd*- • tblrd+* • tblwt x 4 same as tblrd