Blame | Last modification | View Log | Download | RSS feed
ifndef stddef16inc ; avoid multiple inclusionstddef16inc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File STDDEF16.INC *;* *;* Contains SFR and Macro Definitions for PIC 16C5x MCUs *;* *;****************************************************************************if (MOMCPU<93268)&&(MOMCPU>93271)fatal "wrong target selected: only 16C54..16C57 supported"endifif MOMPASS=1message "PIC16C5x Definitions (C) 1993 Alfred Arnold"endif;----------------------------------------------------------------------------; Special RegistersIndirect SFR 0 ; Indirect AddressierungPCLo SFR 2 ; Program Counter LSBRTCC SFR 1 ; CounterStatus SFR 3 ; Status RegisterFSR SFR 4 ; File Select RegisterPort_A SFR 5 ; PortsPort_B SFR 6Port_C SFR 7;----------------------------------------------------------------------------; Bits in Status RegisterFlag_C EQU 0 ; CarryFlag_DC EQU 1 ; Digit CarryFlag_Z EQU 2 ; ZeroPA1 EQU 5 ; Bank-Select Bit 9PA2 EQU 6 ; " " " 10;----------------------------------------------------------------------------; Set/Clear Flagsclrc macro ; Clear Carrybcf Status,Flag_Cendmsetc macro ; Set Carrybsf Status,Flag_Cendmclrdc macro ; Clear Digit Carrybcf Status,Flag_DCendmsetdc macro ; Set Digit Carrybsf Status,Flag_DCendmclrz macro ; Clear Zero Flagbcf Status,Flag_Zendmsetz macro ; Set Zero Flagbsf Status,Flag_Zendm;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Simplified Skip Instructionsskpc macro ; Skip if C=1btfss Status,Flag_Cendmskpnc macro ; Skip if C=0btfsc Status,Flag_Cendmskpdc macro ; Skip if DC=1btfss Status,Flag_DCendmskpndc macro ; Skip if DC=0btfsc Status,Flag_DCendmskpz macro ; Skip if Z=1btfss Status,Flag_Zendmskpnz macro ; Skip if Z=0btfsc Status,Flag_Zendm;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Conditional Branches; CAUTION: Multi-Word Instructions, can not be skipped!!!!b macro target ; Unconditional Branchgoto targetendmbc macro target ; Branch if C=1btfsc Status,Flag_Cgoto targetendmbnc macro target ; Branch if C=0btfss Status,Flag_Cgoto targetendmbdc macro target ; Branch if DC=1btfsc Status,Flag_DCgoto targetendmbndc macro target ; Branch if DC=0btfss Status,Flag_DCgoto targetendmbz macro target ; Branch if Z=1btfss Status,Flag_Zgoto targetendmbnz macro target ; Branch if Z=0btfsc Status,Flag_Zgoto targetendm;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Carry Arithmetic; see above for CAUTIONaddcf macro reg,dest ; Add Carry to Registerbtfsc Status,Flag_Cincf reg,destendmadddcf macro reg,dest ; Add Digit Carry to Registerbtfsc Status,Flag_DCincf reg,destendmsubcf macro reg,dest ; Subtract Carry from Registerbtfsc Status,Flag_Cdecf reg,destendmsubdcf macro reg,dest ; Substract Digit Carry from Registerbtfsc Status,Flag_DCdecf reg,destendm;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Miscellaneousmovfw macro reg ; Transfer Register-->Wmovf reg,0endmnegf macro reg,dest ; Two's Complementcomf reg,1incf reg,destendmtstf macro reg ; Set Flags according to Register Contentmovf reg,1endm;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -restore ; allow listing againendif ; stddef16inc