Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
;
2
; Definice registru a zakladnich maker pro 16C84
3
;
4
		processor	16C84
5
		radix	D
6
 
7
__16C84__:	; Priznak modulu 16C84
8
 
9
; Definice registru
10
 
11
IND0		equ	00H	; 0&1 Pristup na neprimou adresu
12
TMR0		equ	01H	; 0   Real Time clock counter
13
PCL		equ	02H	; 0&1 Spodni cast PC
14
STATUS		equ	03H	; 0&1 Stavove bity
15
_CARRY				equ	0
16
_DC				equ	1
17
_ZERO				equ	2
18
_PD				equ	3
19
_TO				equ	4
20
_RP0				equ	5
21
_RP1				equ	6
22
_IRP				equ	7
23
FSR		equ	04H	; 0&1 Ukazatel pro neprime adresovani
24
PORTA		equ	05H	; 0&1 Data a rizeni portu A
25
PORTB		equ	06H	; 0&1 Data a rizeni portu B
26
EEDATA_0	equ	08H	; 0   Data EEPROM
27
EECON1_1	equ	08H	;   1 Rizeni EEPROM
28
_EERD				equ	0
29
_EEWR				equ	1
30
_EEWREN				equ	2
31
_EEWRERR			equ	3
32
_EEIF				equ	4
33
EEADR_0		equ	09H	; 0   Adresa EEPROM
34
EECON2_1	equ	09H	;   1 Aktivacni pseudoregistr
35
PCLATH		equ	0AH	; 0&1 Horni cast PC pro move
36
INTCON		equ	0BH	; 0&1 Rizeni preruseni
37
_RBIF				equ	0	;
38
_INTF				equ	1
39
_T0IF				equ	2
40
_RBIE				equ	3
41
_INTE				equ	4
42
_T0IE				equ	5
43
_EEIE				equ	6
44
_GIE				equ	7
45
 
46
page0	macro
47
	bcf	STATUS,_RP0
48
	endm
49
 
50
page1	macro
51
	bsf	STATUS,_RP0
52
	endm
53
;
54
; Sada maker pro porovnani a skoky
55
;
56
 
57
;--- Compare ---
58
CMP	macro	ZNAK, PROCEDURA		; if W=ZNAK then goto PROCEDURA
59
	xorlw	ZNAK			; if W#ZNAK then zachovej W a neskakej
60
	btfsc	STATUS,_ZERO
61
	goto	PROCEDURA
62
	xorlw	ZNAK
63
	endm
64
 
65
;--- Skip if Carry ---
66
SC	macro
67
	btfss	STATUS,_CARRY
68
	endm
69
 
70
;--- Skip if not Carry ---
71
SNC	macro
72
	btfsc	STATUS,_CARRY
73
	endm
74
 
75
;--- Skip if Zero ---
76
SZ	macro
77
	btfss	STATUS,_ZERO
78
	endm
79
 
80
;--- Skip if not Zero ---
81
SNZ	macro
82
	btfsc	STATUS,_ZERO
83
	endm
84
 
85
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
86
SB	macro
87
	btsfsc	STATUS,_CARRY
88
	endm
89
SN	macro
90
	btfsc	STATUS,_CARRY
91
	endm
92
 
93
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
94
SNB	macro
95
	btfss	STATUS,_CARRY
96
	endm
97
SP	macro
98
	btfss	STATUS,_CARRY
99
	endm
100
 
101
	cblock	0CH		; Prvni volny registr
102
	endc