Subversion Repositories svnkaklik

Rev

Go to most recent revision | Blame | Last modification | View Log | Download

;
; Definice registru a zakladnich maker pro 16C84
;
                processor       16f84
                radix   D

__16C84__:      ; Priznak modulu 16C84

; Definice registru

IND0            equ     00H     ; 0&1 Pristup na neprimou adresu
TMR0            equ     01H     ; 0   Real Time clock counter
PCL             equ     02H     ; 0&1 Spodni cast PC
STATUS          equ     03H     ; 0&1 Stavove bity
_CARRY                          equ     0
_DC                             equ     1
_ZERO                           equ     2
_PD                             equ     3
_TO                             equ     4
_RP0                            equ     5
_RP1                            equ     6
_IRP                            equ     7
FSR             equ     04H     ; 0&1 Ukazatel pro neprime adresovani
PORTA           equ     05H     ; 0&1 Data a rizeni portu A
PORTB           equ     06H     ; 0&1 Data a rizeni portu B
EEDATA_0        equ     08H     ; 0   Data EEPROM
EECON1_1        equ     08H     ;   1 Rizeni EEPROM
_EERD                           equ     0
_EEWR                           equ     1
_EEWREN                         equ     2
_EEWRERR                        equ     3
_EEIF                           equ     4
EEADR_0         equ     09H     ; 0   Adresa EEPROM
EECON2_1        equ     09H     ;   1 Aktivacni pseudoregistr
PCLATH          equ     0AH     ; 0&1 Horni cast PC pro move
INTCON          equ     0BH     ; 0&1 Rizeni preruseni
_RBIF                           equ     0        ;
_INTF                           equ     1
_T0IF                           equ     2
_RBIE                           equ     3
_INTE                           equ     4
_T0IE                           equ     5
_EEIE                           equ     6
_GIE                            equ     7

page0   macro
        bcf     STATUS,_RP0
        endm

page1   macro
        bsf     STATUS,_RP0
        endm
;
; Sada maker pro porovnani a skoky
;

;--- Compare ---
CMP     macro   ZNAK, PROCEDURA         ; if W=ZNAK then goto PROCEDURA
        xorlw   ZNAK                    ; if W#ZNAK then zachovej W a neskakej
        btfsc   STATUS,_ZERO
        goto    PROCEDURA
        xorlw   ZNAK
        endm

;--- Skip if Carry ---
SC      macro
        btfss   STATUS,_CARRY
        endm

;--- Skip if not Carry ---
SNC     macro
        btfsc   STATUS,_CARRY
        endm

;--- Skip if Zero ---
SZ      macro
        btfss   STATUS,_ZERO
        endm

;--- Skip if not Zero ---
SNZ     macro
        btfsc   STATUS,_ZERO
        endm

;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB      macro
        btsfsc  STATUS,_CARRY
        endm
SN      macro
        btfsc   STATUS,_CARRY
        endm

;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB     macro
        btfss   STATUS,_CARRY
        endm
SP      macro
        btfss   STATUS,_CARRY
        endm

        cblock  0CH             ; Prvni volny registr
        endc