Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
	NOLIST
2
 
3
; rev 1.2       4/06/92
4
; rev 1.3		4/15/94	removed HIGH and LOW
5
;***************************************************************
6
; define special function registers:
7
 
8
	#define W 0
9
	#define w 0
10
	#define true    1
11
	#define false   0
12
	#define TRUE    1
13
	#define FALSE   0
14
;
15
	#define LSB     0
16
	#define MSB     7
17
;
18
_INC    equ     1
19
_NO_INC equ     0
20
_LOW    equ     0
21
_HIGH   equ     1
22
;
23
	cblock 0x00
24
	       bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7
25
	endc
26
 
27
	cblock 0x00     ; define banks
28
	       bank0,bank1,bank2,bank3
29
	endc
30
 
31
	cblock 0x00             ; unbanked registers
32
	       indf0,fsr0,pcl,pclath,alusta,rtcsta,cpusta,intsta
33
	  indf1,fsr1,wreg,rtccl,rtcch,tblptrl,tblptrh,bsr
34
	endc
35
 
36
	cblock 0x10             ; bank0 registers
37
	       porta,ddrb,portb,rcsta,rcreg,txsta,txreg,spbrg
38
	endc
39
 
40
	cblock 0x10             ; bank1 registers       
41
			ddrc,portc,ddrd,portd,ddre,porte,pir,pie
42
	endc
43
 
44
	cblock 0x10             ; bank2 registers
45
		    tmr1,tmr2,tmr3l,tmr3h,pr1,pr2,pr3l,pr3h
46
	endc
47
 
48
ca1l    equ     0x16            ; alternate function def
49
ca1h    equ     0x17
50
 
51
	cblock  0x10     ; define bank3 variables
52
		     pw1dcl,pw2dcl,pw1dch,pw2dch,ca2l,ca2h,tcon1,tcon2
53
	endc
54
 
55
;***************************************************************
56
; define commonly used bits:
57
 
58
; ALUSTA bit definitions
59
 
60
	#define _carry  alusta,0
61
	#define _c      alusta,0
62
	#define _cy     alusta,0
63
	#define _dc     alusta,1
64
	#define _z      alusta,2
65
	#define _ov     alusta,3
66
	#define _fs0    alusta,4
67
	#define _fs1    alusta,5
68
	#define _fs2    alusta,6
69
	#define _fs3    alusta,7
70
 
71
; RTCSTA bit definitions
72
 
73
	#define _rtps0  rtcsta,1
74
	#define _rtps1  rtcsta,2
75
	#define _rtps2  rtcsta,3
76
	#define _rtps3  rtcsta,4
77
	#define _tc     rtcsta,5
78
	#define _rtedg  rtcsta,6
79
	#define _intedg rtcsta,7
80
 
81
; CPUSTA bit definitions
82
 
83
	#define _npd    cpusta,2
84
	#define _nto    cpusta,3
85
	#define _gint   cpusta,4
86
	#define _glintd cpusta,4
87
	#define _stkavl cpusta,5
88
 
89
; INTSTA bit definitions
90
 
91
	#define _intie  intsta,0
92
	#define _rtcie  intsta,1
93
	#define _rtxie  intsta,2
94
	#define _peie   intsta,3
95
	#define _intir  intsta,4
96
	#define _rtcir  intsta,5
97
	#define _rtxir  intsta,6
98
	#define _peir   intsta,7
99
 
100
; PIR Bit definitions
101
 
102
	#define _rbfl   pir,0
103
	#define _tbmt   pir,1
104
	#define _ca1ir	pir,2
105
	#define _ca2ir 	pir,3
106
	#define _tm1ir 	pir,4
107
	#define _tm2ir 	pir,5
108
	#define _tm3ir 	pir,6
109
	#define _irb    pir,7
110
 
111
; PIE Bit definitions
112
 
113
	#define _rcie   pie,0
114
	#define _txie   pie,1
115
	#define _ca1ie 	pie,2
116
	#define _ca2ie 	pie,3
117
	#define _tm1ie 	pie,4
118
	#define _tm2ie 	pie,5
119
	#define _tm3ie 	pie,6
120
	#define _ieb    pie,7
121
 
122
; RCSTA bit definitions
123
 
124
	#define _rcd8   rcsta,0
125
	#define _oerr	rcsta,1
126
	#define _ferr   rcsta,2
127
	#define _cren   rcsta,4
128
	#define _sren   rcsta,5
129
	#define _rc89 	rcsta,6
130
	#define _spen   rcsta,7
131
 
132
; TXSTA bit definitions
133
 
134
	#define _txd8   txsta,0
135
	#define _trmt   txsta,1
136
	#define _sync   txsta,4
137
	#define _txen   txsta,5
138
	#define _tx89   txsta,6
139
	#define _csrc   txsta,7
140
 
141
; TCON1 bit definitions
142
 
143
	#define _tmr1c  tcon1,0
144
	#define _tmr2c  tcon1,1
145
	#define _tmr3c  tcon1,2
146
	#define _tmr16  tcon1,3
147
	#define _ca1ed0 tcon1,4
148
	#define _ca1ed1 tcon1,5
149
	#define _ca2ed0 tcon1,6
150
	#define _ca2ed1 tcon1,7
151
 
152
; TCON2 bit definitions
153
 
154
	#define _tmr1on  tcon2,0
155
	#define _tmr2on  tcon2,1
156
	#define _tmr3on  tcon2,2
157
	#define _ca1pr3  tcon2,3
158
	#define _pwm1on  tcon2,4
159
	#define _pwm2on  tcon2,5
160
	#define _ca1ovf  tcon2,6
161
	#define _ca2ovf  tcon2,7
162
 
163
	LIST
164
 
165