Subversion Repositories MB01 Project

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 - 1
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  1
2
 
3
 
4
LOC  OBJECT CODE     LINE SOURCE TEXT
5
  VALUE
6
 
7
                      00001
8
                      00002         list p=18f4420
9
                      00003         #include p18f4420.inc
10
                      00001         LIST
11
                      00002
12
                      00003 ;==========================================================================
13
                      00004 ;  MPASM PIC18F4420 processor include
14
                      00005 ;
15
                      00006 ;  (c) Copyright 1999-2012 Microchip Technology, All rights reserved
16
                      00007 ;==========================================================================
17
                      00008
18
                      01446         LIST
19
                      00004         #include defs.inc
20
                      00327         LIST
21
                      00005         #include equ.inc
22
                      00145         LIST
23
                      00006
24
                      00007
25
                      00008 Startup         code    0x0000
26
000000 EF?? F???      00009         goto    Start
27
000004 0000           00010         nop
28
                      00011
29
                      00012 HighISR         code    0x0008
30
000008 B2F2           00013         btfsc   INTCON, INT0IF
31
00000A D???           00014         rcall   KbdInt                  ; INT0 -> dato da tastiera
32
00000C B2F0           00015         btfsc   INTCON3, INT2IF
33
00000E 00FF           00016         reset                                   ; INT2 -> reset
34
000010 92F2           00017         bcf             INTCON, INT0IF  ; resetta flag INT0
35
000012 0011           00018         retfie  FAST
36
                      00019
37
                      00020 LowISR          code    0x0018
38
000018 A0F0           00021         btfss   INTCON3, INT1IF
39
00001A 0010           00022         retfie                                  ; INT non generato da INT1 (linea DRQ)
40
00001C 90F0           00023         bcf             INTCON3, INT1IF
41
00001E 8E??           00024         bsf             KFRFlag, KFRFULL        ; segnala registri da leggere
42
000020 0010           00025         retfie
43
                      00026
44
                      00027
45
                      00028         code
46
                      00029
47
000000                00030 KbdInt:
48
000000 D???           00031         rcall   RxKeyb                  ; riceve byte da tastiera
49
                      00032         SCLOCKL                                 ; disabilita TX da tastiera
50
000002 988A               M         bcf             LATB, KCLKO
51
000004 B0??           00033         btfsc   KStatus, KRESET ; test reset
52
000006 00FF           00034         reset                                   ; ricevuto reset in -> reset
53
000008 B2??           00035         btfsc   KStatus, KTIMEO ; test timeout
54
00000A 0012           00036         return                                  ; scarta dato ricevuto se timeout
55
00000C AE??           00037         btfss   KStatus, KBRX   ; test ricezione full
56
00000E 0012           00038         return                                  ; ricezione incompleta -> scarta dato
57
                      00039         ldw             KStatus                 ; test errore ricezione
58
000010 50??               M         movf    KStatus, w
59
000012 0B0C           00040         andlw   KBRXERR
60
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  2
61
 
62
 
63
LOC  OBJECT CODE     LINE SOURCE TEXT
64
  VALUE
65
 
66
000014 E0??           00041         bz              KbdInt10                ; dato ricevuto OK
67
000016 0EFE           00042         movlw   KBD_RESEND              ; richiesta di re-invio alla tastiera
68
000018 D???           00043         rcall   TxKeyb
69
00001A B0??           00044         btfsc   KStatus, KRESET ; test reset
70
00001C 00FF           00045         reset                                   ; ricevuto reset in -> reset
71
00001E 0012           00046         return                                  ; ignora altri errori
72
                      00047
73
000020                00048 KbdInt10:
74
000020 0E00           00049         movlw   0x00                    ; scarta codice 00 (overrun)
75
000022 5C??           00050         subwf   KBuf, W
76
000024 E0??           00051         bz              KbdInt99
77
000026 0EFF           00052         movlw   0xFF                    ; scarta codice FF (overrun/error)
78
000028 5C??           00053         subwf   KBuf, W
79
00002A E0??           00054         bz              KbdInt99
80
00002C 0EFE           00055         movlw   KBD_RESEND              ; scarta richiesta resend
81
00002E 5C??           00056         subwf   KBuf, W
82
000030 E0??           00057         bz              KbdInt99
83
000032 0EFA           00058         movlw   KBD_ACK                 ; scarta ACK
84
000034 5C??           00059         subwf   KBuf, W
85
000036 E0??           00060         bz              KbdInt99
86
000038 0EAA           00061         movlw   KBD_BAT                 ; scarta BAT
87
00003A 5C??           00062         subwf   KBuf, W
88
00003C E1??           00063         bnz             KbdInt11
89
00003E 8C??           00064         bsf             KbdFlag, KBBAT
90
000040 88??           00065         bsf             KbdFlag, KBBAT2
91
000042 9E??           00066         bcf             KbdFlag2, KBNOBAT
92
000044 D???           00067         bra             KbdInt99
93
                      00068
94
000046                00069 KbdInt11:
95
000046 0EFC           00070         movlw   KBD_NOBAT                       ; scarta BAT failure
96
000048 5C??           00071         subwf   KBuf, W
97
00004A E1??           00072         bnz             KbdInt12
98
00004C 9C??           00073         bcf             KbdFlag, KBBAT
99
00004E 98??           00074         bcf             KbdFlag, KBBAT2
100
000050 8E??           00075         bsf             KbdFlag2, KBNOBAT
101
                      00076
102
000052                00077 KbdInt99:
103
                      00078         SCLOCKH                                 ; abilita TX da tastiera
104
000052 888A               M         bsf             LATB, KCLKO
105
000054 0012           00079         return
106
                      00080
107
000056                00081 KbdInt12:                                               ; inserisce byte in coda
108
000056 0EF5           00082         movlw   (RXBUFLEN - 9)          ; lascia un limite di guardia di 8 bytes
109
000058 5C??           00083         subwf   RxCnt,W                         ; RxCnt - (RXBUFLEN - 9))
110
00005A B0D8           00084         btfsc   STATUS, C                       ; C = 0 -> OK - spazio disponibile in coda
111
00005C 8E??           00085         bsf             RxFlag, RXOVR           ; segnala condizione overrun
112
                      00086         ldw             KBuf                            ; memorizza byte in coda
113
00005E 50??               M         movf    KBuf, w
114
000060 6EDE           00087         movwf   POSTINC2
115
000062 2A??           00088         incf    RxCnt, f                        ; incrementa contatore bytes in coda
116
000064 0E3E           00089         movlw   LOW(RxBufEnd)           ; coda circolare - test puntatore
117
000066 5CD9           00090         subwf   FSR2L, W                        ; FSR2L - LOW(RxBufEnd)
118
000068 0E01           00091         movlw   HIGH(RxBufEnd)          ; limite superiore H
119
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  3
120
 
121
 
122
LOC  OBJECT CODE     LINE SOURCE TEXT
123
  VALUE
124
 
125
00006A 58DA           00092         subwfb  FSR2H, W                        ; FSR2H - HIGH(RxBufEnd)
126
00006C B0D8           00093         btfsc   STATUS, C                       ; C = 0 se FSR2 < RxBufEnd
127
00006E EE20 F040      00094         lfsr    FSR2, RxBuffer          ; reimposta puntatore a inizio buffer
128
                      00095
129
000072                00096 KbdInt20:
130
000072 AE??           00097         btfss   RxFlag, RXOVR   ; se in condizioni di overrun disabilita TX
131
000074 D???           00098         bra             KbdInt99                ; riabilita trasmissione da tastiera
132
000076 0012           00099         return                                  ; esce con CLK OUT LOW
133
                      00100
134
000078                00101 RxKeyb:
135
000078 6A??           00102         clrf    KStatus                 ; azzera status
136
00007A 0E08           00103         movlw   D'8'                    ; contatore 8 bit
137
00007C 6E??           00104         movwf   KCnt
138
00007E 0E01           00105         movlw   D'1'                    ; parity bit (odd)
139
000080 6E??           00106         movwf   KPar
140
000082 0E01           00107         movlw   TMR0P4                  ; TMR0 stop, prescaler = 4
141
000084 6ED5           00108         movwf   T0CON                   ; modo 16 bit
142
000086 94F2           00109         bcf             INTCON, TMR0IF  ; azzera flag timeout
143
000088 0E9E           00110         movlw   HIGH(T20MS)             ; imposta timeout
144
00008A 6ED7           00111         movwf   TMR0H                   ; caricare prima TMR0H
145
00008C 6E??           00112         movwf   T0CntH
146
00008E 0E58           00113         movlw   LOW(T20MS)
147
000090 6ED6           00114         movwf   TMR0L                   ; carica TMR0L/H
148
000092 6E??           00115         movwf   T0CntL
149
000094 8ED5           00116         bsf             T0CON, TMR0ON   ; start Timer 0
150
                      00117
151
000096                00118 RxKeyb1:                                        ; attesa CLK IN -> LOW
152
000096 D???           00119         rcall   GetLine
153
000098 E6??           00120         bmi             RxKeyb1                 ; CLK IN = HIGH - loop
154
                      00121
155
00009A                00122 RxKeyb2:                                        ; loop attesa CLK IN -> HIGH
156
00009A D???           00123         rcall   GetLine
157
00009C E7??           00124         bpl             RxKeyb2                 ; CLK IN = LOW - loop
158
                      00125
159
00009E                00126 RxKeyb3:                                        ; loop attesa CLK IN -> LOW
160
00009E D???           00127         rcall   GetLine
161
0000A0 E6??           00128         bmi             RxKeyb3                 ; CLK IN = HIGH - loop
162
0000A2 E3??           00129         bnc             RxKeyb4                 ; no parity se DATA IN = LOW
163
0000A4 2A??           00130         incf    KPar, f                 ; incrementa parity
164
0000A6 80D8           00131         bsf             STATUS, C               ; forza CARRY = 1 (DATA IN = HIGH)
165
                      00132
166
0000A8                00133 RxKeyb4:                                        ; aggiorna KBuf
167
0000A8 32??           00134         rrcf    KBuf, f                 ; KBuf<7> = CARRY
168
0000AA 2E??           00135         decfsz  KCnt, f                 ; decrementa contatore 8 bit
169
0000AC D???           00136         bra             RxKeyb2                 ; loop 8 bit
170
                      00137
171
0000AE                00138 RxKeyb5:                                        ; attesa CLK IN -> HIGH
172
0000AE D???           00139         rcall   GetLine
173
0000B0 E7??           00140         bpl             RxKeyb5                 ; CLK IN = LOW - loop
174
                      00141
175
0000B2                00142 RxKeyb6:                                        ; attesa CLK IN -> LOW
176
0000B2 D???           00143         rcall   GetLine
177
0000B4 E6??           00144         bmi             RxKeyb6                 ; CLK IN = HIGH - loop
178
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  4
179
 
180
 
181
LOC  OBJECT CODE     LINE SOURCE TEXT
182
  VALUE
183
 
184
0000B6 34??           00145         rlcf    KCnt, W                 ; C = parity bit -> W<0> = parity bit
185
0000B8 1A??           00146         xorwf   KPar, f                 ; confronto parity ricevuta con parity calcolata
186
0000BA 30??           00147         rrcf    KPar, W                 ; C = confronto parity
187
0000BC E3??           00148         bnc             RxKeyb7                 ; C = 0 -> parity OK
188
0000BE 84??           00149         bsf             KStatus, KPARY  ; imposta errore parity
189
                      00150
190
0000C0                00151 RxKeyb7:                                        ; attesa CLK IN -> HIGH
191
0000C0 D???           00152         rcall   GetLine
192
0000C2 E7??           00153         bpl             RxKeyb7                 ; CLK IN = LOW - loop
193
                      00154
194
0000C4                00155 RxKeyb8:                                        ; attesa CLK IN -> LOW
195
0000C4 D???           00156         rcall   GetLine
196
0000C6 E6??           00157         bmi             RxKeyb8                 ; CLK IN = HIGH - loop
197
0000C8 E2??           00158         bc              RxKeyb9                 ; C = 1 -> stop bit OK
198
0000CA 86??           00159         bsf             KStatus, KSTOP  ; segnala errore bit stop errato
199
                      00160
200
0000CC                00161 RxKeyb9:                                        ; attesa CLK IN -> HIGH - fine trasmissione
201
0000CC D???           00162         rcall   GetLine
202
0000CE E7??           00163         bpl             RxKeyb9                 ; CLK IN = LOW - loop
203
0000D0 8E??           00164         bsf             KStatus, KBRX   ; segnala ricezione completata
204
0000D2 9ED5           00165         bcf             T0CON, TMR0ON   ; stop Timer 0
205
0000D4 94F2           00166         bcf             INTCON, TMR0IF  ; azzera flag timeout
206
0000D6 0012           00167         return
207
                      00168
208
0000D8                00169 GetLine:
209
0000D8 B4F2           00170         btfsc   INTCON, TMR0IF  ; test timeout
210
0000DA D???           00171         bra             GetLine2                ; timeout
211
                      00172         ldw             PORTB
212
0000DC 5081               M         movf    PORTB, w
213
0000DE 0B0D           00173         andlw   RBMASK                  ; maschera bit utili
214
0000E0 6E??           00174         movwf   TmpB                    ; salva temporaneo
215
                      00175         ldw             PORTB
216
0000E2 5081               M         movf    PORTB, w
217
0000E4 0B0D           00176         andlw   RBMASK                  ; maschera bit utili
218
0000E6 62??           00177         cpfseq  TmpB                    ; confronta con lettura precedente
219
0000E8 D???           00178         bra             GetLine                 ; attesa linee stabili o timeout
220
0000EA A4??           00179         btfss   TmpB, RESIN             ; test asserzione reset da host
221
0000EC D???           00180         bra             GetLine1                ; reset da host
222
0000EE 98D8           00181         bcf             STATUS, N               ; N = 0 se CLK IN = LOW
223
0000F0 B6??           00182         btfsc   TmpB, KCLKIN
224
0000F2 88D8           00183         bsf             STATUS, N               ; N = 1 se CLK IN = HIGH
225
0000F4 90D8           00184         bcf             STATUS, C               ; C = 0 se DATA IN = LOW
226
0000F6 B0??           00185         btfsc   TmpB, KDATAIN
227
0000F8 80D8           00186         bsf             STATUS, C               ; C = 1 se DATA IN = HIGH
228
0000FA 0012           00187         return                                  ; C = DATA IN, N = CLK IN
229
                      00188
230
0000FC                00189 GetLine1:
231
0000FC 80??           00190         bsf             KStatus, KRESET ; segnala reset
232
0000FE 0006           00191         pop                                             ; scarta indirizzo di ritorno
233
000100 0012           00192         return                                  ; uscita
234
                      00193
235
000102                00194 GetLine2:
236
000102 82??           00195         bsf             KStatus, KTIMEO ; segnala timeout
237
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  5
238
 
239
 
240
LOC  OBJECT CODE     LINE SOURCE TEXT
241
  VALUE
242
 
243
000104 9ED5           00196         bcf             T0CON, TMR0ON   ; stop Timer 0
244
000106 94F2           00197         bcf             INTCON, TMR0IF  ; azzera flag timeout
245
000108 0006           00198         pop                                             ; scarta indirizzo di ritorno
246
00010A 0012           00199         return                                  ; uscita
247
                      00200
248
                      00201
249
00010C                00202 TxKeyb:
250
00010C 6E??           00203         movwf   KBuf                    ; salva dato da trasmettere
251
00010E 6A??           00204         clrf    KStatus                 ; azzera status
252
000110 0E08           00205         movlw   TMR0P0                  ; TMR0 stop, no prescaler, modo 16 bit
253
000112 6ED5           00206         movwf   T0CON
254
000114 94F2           00207         bcf             INTCON, TMR0IF  ; azzera flag timeout
255
000116 0EFE           00208         movlw   HIGH(T100US)    ; imposta timeout 100us
256
000118 6ED7           00209         movwf   TMR0H                   ; caricare prima TMR0H
257
00011A 0E0C           00210         movlw   LOW(T100US)
258
00011C 6ED6           00211         movwf   TMR0L                   ; carica TMR0L/H
259
00011E 0E08           00212         movlw   D'8'                    ; contatore 8 bit
260
000120 6E??           00213         movwf   KCnt
261
000122 0E01           00214         movlw   D'1'                    ; parity bit (odd)
262
000124 6E??           00215         movwf   KPar
263
                      00216         SCLOCKL                                 ; CLK OUT -> LOW - request to send
264
000126 988A               M         bcf             LATB, KCLKO
265
000128 8ED5           00217         bsf             T0CON, TMR0ON   ; start Timer 0
266
                      00218
267
00012A                00219 TxKeyb1:                                        ; ritardo 100us
268
00012A A4F2           00220         btfss   INTCON, TMR0IF
269
00012C D???           00221         bra             TxKeyb1                 ; loop ritardo
270
                      00222         SDATAL                                  ; DATA OUT -> LOW (start bit)
271
00012E 9A8A               M         bcf             LATB, KDATAO
272
000130 9ED5           00223         bcf             T0CON, TMR0ON   ; stop Timer 0
273
000132 94F2           00224         bcf             INTCON, TMR0IF  ; azzera flag timeout
274
000134 0E01           00225         movlw   TMR0P4                  ; TMR0 stop, prescaler = 4
275
000136 6ED5           00226         movwf   T0CON                   ; modo 16 bit
276
000138 0E9E           00227         movlw   HIGH(T20MS)             ; imposta timeout
277
00013A 6ED7           00228         movwf   TMR0H                   ; caricare prima TMR0H
278
00013C 0E58           00229         movlw   LOW(T20MS)
279
00013E 6ED6           00230         movwf   TMR0L                   ; carica TMR0L/H
280
000140 8ED5           00231         bsf             T0CON, TMR0ON   ; start Timer 0
281
                      00232         SCLOCKH                                 ; CLK OUT -> HIGH (rilascia clock)
282
000142 888A               M         bsf             LATB, KCLKO
283
                      00233
284
000144                00234 TxKeyb2:                                        ; attesa CLK IN -> LOW
285
000144 D???           00235         rcall   GetLine
286
000146 E6??           00236         bmi             TxKeyb2                 ; CLK IN = HIGH -> loop
287
                      00237
288
000148                00238 TxKeyb3:                                        ; loop 8 bit
289
000148 32??           00239         rrcf    KBuf                    ; C = KBuf<0> - bit da inviare
290
00014A E3??           00240         bnc             TxKeyb4                 ; C = 0 -> DATA OUT = LOW
291
00014C 2A??           00241         incf    KPar, f                 ; C = 1 -> aggiorna parity
292
                      00242         SDATAH                                  ; DATA OUT = HIGH
293
00014E 8A8A               M         bsf             LATB, KDATAO
294
000150 D???           00243         bra             TxKeyb5
295
                      00244
296
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  6
297
 
298
 
299
LOC  OBJECT CODE     LINE SOURCE TEXT
300
  VALUE
301
 
302
000152                00245 TxKeyb4:
303
                      00246         SDATAL                                  ; DATA OUT = LOW
304
000152 9A8A               M         bcf             LATB, KDATAO
305
                      00247
306
000154                00248 TxKeyb5:                                        ; invia bit
307
000154 D???           00249         rcall   GetLine                 ; attende CLK IN -> HIGH
308
000156 E7??           00250         bpl             TxKeyb5                 ; CLK IN = LOW -> loop
309
                      00251
310
000158                00252 TxKeyb6:
311
000158 D???           00253         rcall   GetLine                 ; attende CLK IN -> LOW
312
00015A E6??           00254         bmi             TxKeyb6                 ; CLK IN = HIGH -> loop
313
00015C 2E??           00255         decfsz  KCnt, f                 ; decrementa contatore 8 bit
314
00015E D???           00256         bra             TxKeyb3                 ; loop 8 bit
315
000160 32??           00257         rrcf    KPar, f                 ; C = KPar<0> -> parity bit
316
000162 E3??           00258         bnc             TxKeyb7                 ; C = 0 -> DATA OUT = LOW
317
                      00259         SDATAH                                  ; DATA OUT = HIGH
318
000164 8A8A               M         bsf             LATB, KDATAO
319
000166 D???           00260         bra             TxKeyb8
320
                      00261
321
000168                00262 TxKeyb7:
322
                      00263         SDATAL                                  ; DATA OUT = LOW
323
000168 9A8A               M         bcf             LATB, KDATAO
324
                      00264
325
00016A                00265 TxKeyb8:
326
00016A D???           00266         rcall   GetLine                 ; attende CLK IN -> HIGH
327
00016C E7??           00267         bpl             TxKeyb8                 ; CLK IN = LOW -> loop
328
                      00268
329
00016E                00269 TxKeyb9:
330
00016E D???           00270         rcall   GetLine                 ; attende CLK IN -> LOW
331
000170 E6??           00271         bmi             TxKeyb9                 ; CLK IN = HIGH -> loop
332
                      00272         SDATAH                                  ; DATA OUT -> HIGH - stop bit
333
000172 8A8A               M         bsf             LATB, KDATAO
334
                      00273
335
000174                00274 TxKeyb10:
336
000174 D???           00275         rcall   GetLine                 ; attende CLK IN -> HIGH
337
000176 E7??           00276         bpl             TxKeyb10                ; CLK IN = LOW -> loop
338
                      00277
339
000178                00278 TxKeyb11:
340
000178 D???           00279         rcall   GetLine                 ; attende CLK IN -> LOW
341
00017A E6??           00280         bmi             TxKeyb11                ; CLK IN = HIGH -> loop
342
00017C E3??           00281         bnc             TxKeyb12                ; C = 0 -> DATA IN = LOW - ack bit ok
343
00017E 88??           00282         bsf             KStatus, KBACK  ; segnala errore ack bit
344
                      00283
345
000180                00284 TxKeyb12:
346
000180 D???           00285         rcall   GetLine                 ; attende CLK IN -> HIGH
347
000182 E7??           00286         bpl             TxKeyb12                ; CLK IN = LOW -> loop
348
000184 8C??           00287         bsf             KStatus, KBTX   ; segnala trasmissione completata
349
000186 9ED5           00288         bcf             T0CON, TMR0ON   ; stop Timer 0
350
000188 94F2           00289         bcf             INTCON, TMR0IF  ; azzera flag timeout
351
00018A 0012           00290         return
352
                      00291
353
00018C                00292 GetKbd:
354
00018C EC?? F???      00293         call    RxKeyb                  ; ricezione entro timeout
355
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  7
356
 
357
 
358
LOC  OBJECT CODE     LINE SOURCE TEXT
359
  VALUE
360
 
361
000190 B0??           00294         btfsc   KStatus, KRESET ; test reset
362
000192 00FF           00295         reset                                   ; ricevuto reset in -> reset
363
000194 B2??           00296         btfsc   KStatus, KTIMEO ; test timeout
364
000196 D???           00297         bra             GetKbd10                ; errore ricezione
365
                      00298         ldw             KStatus                 ; test errore ricezione
366
000198 50??               M         movf    KStatus, w
367
00019A 0B0C           00299         andlw   KBRXERR
368
00019C E1??           00300         bnz             GetKbd10                ; dato ricevuto errato
369
00019E 90D8           00301         bcf             STATUS, C               ; C = = -> OK
370
0001A0 0012           00302         return
371
0001A2                00303 GetKbd10:
372
0001A2 80D8           00304         bsf             STATUS, C               ; C = 1 -> errore
373
0001A4 0012           00305         return
374
                      00306
375
0001A6                00307 SendLed:
376
0001A6 0EED           00308         movlw   KBD_SETLED
377
0001A8 D???           00309         rcall   SendKbd
378
0001AA E2??           00310         bc              SendKbd10
379
                      00311         ldw             LedSt
380
0001AC 50??               M         movf    LedSt, w
381
                      00312
382
0001AE                00313 SendKbd:
383
0001AE D???           00314         rcall   TxKeyb
384
0001B0 B0??           00315         btfsc   KStatus, KRESET ; test reset
385
0001B2 00FF           00316         reset                                   ; ricevuto reset in -> reset
386
0001B4 B2??           00317         btfsc   KStatus, KTIMEO ; test timeout
387
0001B6 D???           00318         bra             SendKbd10               ; errore
388
0001B8 AC??           00319         btfss   KStatus, KBTX   ; test trasmissione OK
389
0001BA D???           00320         bra             SendKbd10               ; trasmissione fallita - errore
390
0001BC AC??           00321         btfss   KStatus, KBTX   ; test trasmissione OK
391
0001BE D???           00322         bra             SendKbd10               ; trasmissione fallita - errore
392
0001C0 B8??           00323         btfsc   KStatus, KBACK  ; test errore ACK
393
0001C2 D???           00324         bra             SendKbd10               ; errore ACK
394
0001C4 D???           00325         rcall   GetKbd                  ; ricezione da tastiera
395
0001C6 E2??           00326         bc              SendKbd10               ; errore ricezione
396
0001C8 0EFA           00327         movlw   KBD_ACK                 ; test ACK tastiera
397
0001CA 62??           00328         cpfseq  KBuf
398
0001CC D???           00329         bra             SendKbd10               ; errore
399
0001CE 90D8           00330         bcf             STATUS, C               ; C = = -> OK
400
0001D0 0012           00331         return
401
0001D2                00332 SendKbd10:
402
0001D2 80D8           00333         bsf             STATUS, C               ; C = 1 -> errore
403
0001D4 0012           00334         return
404
                      00335
405
0001D6                00336 InitIO:
406
0001D6 9CD0           00337         bcf             RCON, 6
407
0001D8 82D0           00338         bsf             RCON, 1
408
0001DA 6AF2           00339         clrf    INTCON                  ; disabilita interrupt
409
0001DC 6AF1           00340         clrf    INTCON2                 ; RB0, RB1, RB2 int su fronte negativo
410
0001DE 6AF0           00341         clrf    INTCON3
411
0001E0 6A9E           00342         clrf    PIR1
412
0001E2 6AA1           00343         clrf    PIR2
413
0001E4 6A9D           00344         clrf    PIE1
414
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  8
415
 
416
 
417
LOC  OBJECT CODE     LINE SOURCE TEXT
418
  VALUE
419
 
420
0001E6 6AA0           00345         clrf    PIE2
421
0001E8 6AC2           00346         clrf    ADCON0                  ; disabilita modulo A/D
422
0001EA 6892           00347         setf    DDRA                    ; tutte le porte in input
423
0001EC 6893           00348         setf    DDRB
424
0001EE 6894           00349         setf    DDRC
425
0001F0 6895           00350         setf    DDRD
426
0001F2 6896           00351         setf    DDRE
427
0001F4 0E0F           00352         movlw   B'00001111'             ; tutte le porte I/O sono digitali
428
0001F6 6EC1           00353         movwf   ADCON1
429
0001F8 6889           00354         setf    LATA                    ; tutte le porte I/O a livello alto
430
0001FA 688A           00355         setf    LATB
431
0001FC 688B           00356         setf    LATC
432
0001FE 688C           00357         setf    LATD
433
000200 6A8D           00358         clrf    LATE                    ; porta RE a livello basso in uscita
434
000202 0EC3           00359         movlw   B'11000011'             ; RA<0:1> input, le altre output
435
000204 6E92           00360         movwf   DDRA
436
000206 0ECF           00361         movlw   B'11001111'             ; RB<4:5> in output, le altre in input
437
000208 6E93           00362         movwf   DDRB
438
00020A 6A94           00363         clrf    DDRC                    ; porta C in uscita
439
00020C 9C8B           00364         bcf             LATC, KBVOFF    ; resetta alimentazione tastiera
440
00020E 6A96           00365         clrf    DDRE                    ; porta E in uscita
441
000210 6AF8           00366         clrf    TBLPTRU                 ; FLASH solo < 64K
442
000212 D???           00367         rcall   InitData                ; inizializza variabili
443
                      00368
444
000214                00369 Init1:                                          ; attesa linea reset in alta
445
000214 A481           00370         btfss   PORTB, RESIN
446
000216 D???           00371         bra             Init1
447
                      00372
448
000218 8ED0           00373         bsf             RCON, IPEN              ; abilita int. priorizzati
449
00021A 9EF1           00374         bcf             INTCON2, RBPU   ; disabilita pull-up su porta B
450
00021C 8EF0           00375         bsf             INTCON3, INT2IP ; alta priority per INT2 su RB2 (reset in)
451
00021E 9CF0           00376         bcf             INTCON3, INT1IP ; bassa priority per INT1 su RB1 (linea DRQ)
452
000220 88F2           00377         bsf             INTCON, INT0IE  ; abilita INT0 su RB0 high priority (DATA IN)
453
000222 86F0           00378         bsf             INTCON3, INT1IE ; abilita INT1 su RB1 (linea DRQ)
454
000224 88F0           00379         bsf             INTCON3, INT2IE ; abilita INT2 su RB2 (linea reset in)
455
000226 8C8B           00380         bsf             LATC, KBVOFF    ; termina impulso negativo VCC tastiera
456
000228 0E0C           00381         movlw   LOW(T100US)             ; imposta ritardo 100us
457
00022A 6E??           00382         movwf   T0CntL
458
00022C 0EFE           00383         movlw   HIGH(T100US)
459
00022E 6E??           00384         movwf   T0CntH
460
000230 D???           00385         rcall   Delay_us                ; ritardo 100us
461
000232 9E8B           00386         bcf             LATC, KBVON             ; attiva alimentazione tastiera
462
000234 0E9C           00387         movlw   LOW(T20US)              ; imposta ritardo 20us
463
000236 6E??           00388         movwf   T0CntL
464
000238 0EFF           00389         movlw   HIGH(T20US)
465
00023A 6E??           00390         movwf   T0CntH
466
00023C D???           00391         rcall   Delay_us                ; ritardo 20us
467
00023E 8E8B           00392         bsf             LATC, KBVON             ; termina impulso negativo
468
000240 0EB0           00393         movlw   LOW(T40MS)              ; imposta ritardo 40ms per stabilizzare VCC
469
000242 6E??           00394         movwf   T0CntL
470
000244 0E3C           00395         movlw   HIGH(T40MS)
471
000246 6E??           00396         movwf   T0CntH
472
000248 D???           00397         rcall   Delay_ms                ; ritardo 40ms
473
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE  9
474
 
475
 
476
LOC  OBJECT CODE     LINE SOURCE TEXT
477
  VALUE
478
 
479
00024A 92F2           00398         bcf             INTCON, INT0IF  ; resetta flag INT0 (eventuali impulsi spuri)
480
00024C 0E07           00399         movlw   TMR0P256                ; TMR0 stop, prescaler = 256, modo 16 bit
481
00024E 6ED5           00400         movwf   T0CON
482
000250 94F2           00401         bcf             INTCON, TMR0IF  ; azzera flag timeout
483
000252 0E8D           00402         movlw   HIGH(T1500MS)   ; imposta timeout 1500ms
484
000254 6ED7           00403         movwf   TMR0H                   ; caricare prima TMR0H
485
000256 0E90           00404         movlw   LOW(T1500MS)
486
000258 6ED6           00405         movwf   TMR0L                   ; carica TMR0L/H
487
00025A 8ED5           00406         bsf             T0CON, TMR0ON   ; start Timer 0
488
                      00407
489
00025C                00408 Init2:                                          ; loop attesa tastiera entro timeout 1500ms
490
00025C B4F2           00409         btfsc   INTCON, TMR0IF
491
00025E D???           00410         bra             Init4                   ; timeout
492
000260 B2F0           00411         btfsc   INTCON3, INT2IF
493
000262 00FF           00412         reset                                   ; INT2 -> reset
494
000264 A2F2           00413         btfss   INTCON, INT0IF
495
000266 D???           00414         bra             Init2                   ; loop
496
000268 9ED5           00415         bcf             T0CON, TMR0ON   ; stop Timer 0
497
00026A 94F2           00416         bcf             INTCON, TMR0IF  ; azzera flag timeout
498
00026C EC?? F???      00417         call    RxKeyb                  ; INT0 -> riceve dato da tastiera
499
000270 B0??           00418         btfsc   KStatus, KRESET ; test reset
500
000272 00FF           00419         reset                                   ; ricevuto reset in -> reset
501
000274 B2??           00420         btfsc   KStatus, KTIMEO ; test timeout
502
000276 D???           00421         bra             Init4                   ; scarta dato ricevuto se timeout
503
000278 AE??           00422         btfss   KStatus, KBRX   ; test ricezione full
504
00027A D???           00423         bra             Init4                   ; ricezione incompleta -> scarta dato
505
                      00424         ldw             KStatus                 ; test errore ricezione
506
00027C 50??               M         movf    KStatus, w
507
00027E 0B0C           00425         andlw   KBRXERR
508
000280 E1??           00426         bnz             Init4                   ; dato ricevuto errato
509
000282 0EAA           00427         movlw   KBD_BAT                 ; test BAT OK
510
000284 62??           00428         cpfseq  KBuf
511
000286 D???           00429         bra             KNoBAT                  ; no BAT OK !
512
000288 8C??           00430         bsf             KbdFlag, KBBAT  ; imposta flag BAT OK
513
00028A 88??           00431         bsf             KbdFlag, KBBAT2 ; imposta flag BAT OK
514
00028C D???           00432         bra             Init3
515
                      00433
516
00028E                00434 KNoBAT:
517
00028E 0EFC           00435         movlw   KBD_NOBAT               ; test BAT failure
518
000290 62??           00436         cpfseq  KBuf
519
000292 D???           00437         bra             Init3
520
000294 8E??           00438         bsf             KbdFlag2, KBNOBAT       ; imposta flag BAT FAILURE
521
                      00439
522
000296                00440 Init3:
523
000296 8E??           00441         bsf             KbdFlag, KBFND  ; imposta flag tastiera presente
524
                      00442
525
000298                00443 Init4:          ; KBFND indica tastiera prsente - se il flag e' resettato
526
                      00444                         ; occorre fare ulteriore verifica della tastiera
527
000298 9ED5           00445         bcf             T0CON, TMR0ON   ; stop Timer 0
528
00029A 94F2           00446         bcf             INTCON, TMR0IF  ; azzera flag timeout
529
00029C 92F2           00447         bcf             INTCON, INT0IF  ; resetta flag INT0
530
00029E AE??           00448         btfss   KbdFlag, KBFND  ; se tastiera presente salta ulteriore verifica
531
0002A0 D???           00449         rcall   KbVerf                  ; verifica tastiera
532
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 10
533
 
534
 
535
LOC  OBJECT CODE     LINE SOURCE TEXT
536
  VALUE
537
 
538
0002A2 92F2           00450         bcf             INTCON, INT0IF  ; resetta flag INT0
539
0002A4 AE??           00451         btfss   KbdFlag, KBFND  ; se tastiera presente la inizializza
540
0002A6 D???           00452         bra             Init10                  ; altrimenti esce
541
0002A8 AC??           00453         btfss   KbdFlag, KBBAT  ; tastiera ok ?
542
0002AA D???           00454         bra             Init10                  ; no -> esce
543
                      00455
544
                      00456         ; a questo punto tastiera presente e funzionante
545
                      00457         ; si legge ID tastiera
546
0002AC 92F2           00458         bcf             INTCON, INT0IF  ; resetta flag INT0
547
0002AE 0EF2           00459         movlw   KBD_GETID
548
0002B0 EC?? F???      00460         call    SendKbd
549
0002B4 E2??           00461         bc              Init6                   ; errore
550
0002B6 EC?? F???      00462         call    GetKbd                  ; riceve ID LOW
551
0002BA E2??           00463         bc              Init6                   ; errore
552
                      00464         ldw             KBuf
553
0002BC 50??               M         movf    KBuf, w
554
0002BE 6E??           00465         movwf   KbdIDL                  ; salva ID LOW
555
0002C0 EC?? F???      00466         call    GetKbd                  ; riceve ID LOW
556
0002C4 E2??           00467         bc              Init6                   ; errore
557
                      00468         ldw             KBuf
558
0002C6 50??               M         movf    KBuf, w
559
0002C8 6E??           00469         movwf   KbdIDH                  ; salva ID HIGH
560
0002CA 0EAB           00470         movlw   KBD_IDL                 ; test ID
561
0002CC 62??           00471         cpfseq  KbdIDL
562
0002CE D???           00472         bra             Init6                   ; ID LOW errato
563
0002D0 0E83           00473         movlw   KBD_IDH                 ; test ID
564
0002D2 62??           00474         cpfseq  KbdIDH
565
0002D4 D???           00475         bra             Init6                   ; ID HIGH errato
566
0002D6 8A??           00476         bsf             KbdFlag, KBVID  ; imposta flag ID valido
567
                      00477
568
0002D8                00478 Init6:
569
0002D8 92F2           00479         bcf             INTCON, INT0IF  ; resetta flag INT0
570
0002DA 0EED           00480         movlw   KBD_SETLED              ; spegne LED
571
0002DC EC?? F???      00481         call    SendKbd
572
0002E0 E2??           00482         bc              Init61
573
0002E2 0E00           00483         movlw   0x00
574
0002E4 EC?? F???      00484         call    SendKbd
575
0002E8 E2??           00485         bc              Init61
576
0002EA 80??           00486         bsf             KbdFlag, KBLEDOK
577
                      00487
578
0002EC                00488 Init61:
579
0002EC 92F2           00489         bcf             INTCON, INT0IF  ; resetta flag INT0
580
0002EE 0EF0           00490         movlw   KBD_SETSC               ; imposta scancode 02
581
0002F0 EC?? F???      00491         call    SendKbd
582
0002F4 E2??           00492         bc              Init62
583
0002F6 0E02           00493         movlw   0x02
584
0002F8 EC?? F???      00494         call    SendKbd
585
0002FC E2??           00495         bc              Init62
586
0002FE 82??           00496         bsf             KbdFlag, KBSCOK
587
                      00497
588
000300                00498 Init62:
589
000300 92F2           00499         bcf             INTCON, INT0IF  ; resetta flag INT0
590
000302 0EF3           00500         movlw   KBD_TYPERATE    ; imposta typerate
591
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 11
592
 
593
 
594
LOC  OBJECT CODE     LINE SOURCE TEXT
595
  VALUE
596
 
597
000304 EC?? F???      00501         call    SendKbd
598
000308 E2??           00502         bc              Init63
599
00030A 0E0B           00503         movlw   KBD_DEFRATE
600
00030C EC?? F???      00504         call    SendKbd
601
000310 E2??           00505         bc              Init63
602
000312 86??           00506         bsf             KbdFlag, KBRATE
603
                      00507
604
000314                00508 Init63:
605
000314 92F2           00509         bcf             INTCON, INT0IF  ; resetta flag INT0
606
000316 0EF4           00510         movlw   KBD_ENABLE              ; abilita scanning tastiera
607
000318 EC?? F???      00511         call    SendKbd
608
00031C E2??           00512         bc              Init10
609
00031E 84??           00513         bsf             KbdFlag, KBENABLE
610
                      00514
611
000320                00515 Init10:
612
                      00516         SCLOCKL                                 ; disabilita TX da tastiera
613
000320 988A               M         bcf             LATB, KCLKO
614
000322 0E03           00517         movlw   0x03                    ; registro KFR 3
615
000324 6E8D           00518         movwf   LATE
616
                      00519         ldw             KbdFlag
617
000326 50??               M         movf    KbdFlag, w
618
000328 EC?? F???      00520         call    KFRWrite
619
00032C 92F2           00521         bcf             INTCON, INT0IF  ; resetta flag INT0
620
00032E 90F0           00522         bcf             INTCON3, INT1IF ; resetta flag INT1
621
000330 92F0           00523         bcf             INTCON3, INT2IF ; resetta flag INT2
622
000332 8EF2           00524         bsf             INTCON, GIEH    ; abilita INT high priority
623
000334 8CF2           00525         bsf             INTCON, GIEL    ; abilita INT low priority
624
000336 0012           00526         return
625
                      00527
626
000338                00528 InitData:
627
000338 EE00 F000      00529         lfsr    FSR0, 0x0               ; azzera RAM banco 0, 1 & 2
628
00033C 0E03           00530         movlw   0x03                    ; banco 3 non esiste !
629
                      00531
630
00033E                00532 InitData1:
631
00033E 6AEE           00533         clrf    POSTINC0
632
000340 62EA           00534         cpfseq  FSR0H
633
000342 D???           00535         bra             InitData1
634
                      00536
635
000344 0E04           00537         movlw   0x04                    ; contatore registri
636
000346 6E??           00538         movwf   KFRRdCnt
637
000348 6A8D           00539         clrf    LATE                    ; azzera indirizzo KFR
638
00034A 6A95           00540         clrf    DDRD                    ; porta D in uscita
639
00034C 6A8C           00541         clrf    LATD                    ; porta D tutti i bit bassi
640
                      00542
641
00034E                00543 InitData2:
642
00034E 0000           00544         nop                                             ; scrittura su registro
643
000350 0000           00545         nop
644
000352 928B           00546         bcf             LATC, KFRWE             ; impulso write
645
000354 0000           00547         nop
646
000356 828B           00548         bsf             LATC, KFRWE
647
000358 0000           00549         nop
648
00035A 2A8D           00550         incf    LATE,f                  ; incrementa indirizzo
649
00035C 2E??           00551         decfsz  KFRRdCnt, f             ; loop
650
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 12
651
 
652
 
653
LOC  OBJECT CODE     LINE SOURCE TEXT
654
  VALUE
655
 
656
00035E D???           00552         bra             InitData2
657
000360 EE20 F040      00553         lfsr    FSR2, RxBuffer  ; imposta puntatore iniziale testa buffer RX
658
000364 EE10 F040      00554         lfsr    FSR1, RxBuffer  ; imposta puntatore iniziale coda buffer RX
659
000368 0E3E           00555         movlw   LOW(TxBuffer)           ; imposta puntatore Head, Tail TX a inizio buffer
660
00036A 6E??           00556         movwf   TxHeadL
661
00036C 6E??           00557         movwf   TxTailL
662
00036E 0E01           00558         movlw   HIGH(TxBuffer)
663
000370 6E??           00559         movwf   TxHeadH
664
000372 6E??           00560         movwf   TxTailH
665
000374 0012           00561         return
666
                      00562
667
000376                00563 Delay_ms:
668
000376 0E01           00564         movlw   TMR0P4                  ; TMR0 stop, prescaler = 4, modo 16 bit
669
000378 D???           00565         bra             Delay_xx
670
                      00566
671
00037A                00567 Delay_us:
672
00037A 0E08           00568         movlw   TMR0P0                  ; TMR0 stop, no prescaler, modo 16 bit
673
00037C                00569 Delay_xx:
674
00037C 6ED5           00570         movwf   T0CON
675
00037E 94F2           00571         bcf             INTCON, TMR0IF  ; azzera flag timeout
676
                      00572         ldw             T0CntH                  ; imposta timeout high
677
000380 50??               M         movf    T0CntH, w
678
000382 6ED7           00573         movwf   TMR0H                   ; caricare prima TMR0H
679
                      00574         ldw             T0CntL
680
000384 50??               M         movf    T0CntL, w
681
000386 6ED6           00575         movwf   TMR0L                   ; carica TMR0L/H
682
000388 8ED5           00576         bsf             T0CON, TMR0ON   ; start Timer 0
683
                      00577
684
00038A                00578 Delay_xx1:                                      ; loop
685
00038A A4F2           00579         btfss   INTCON, TMR0IF  ; attende flag overflow
686
00038C D???           00580         bra             Delay_xx1               ; loop ritardo
687
00038E 9ED5           00581         bcf             T0CON, TMR0ON   ; stop Timer 0
688
000390 94F2           00582         bcf             INTCON, TMR0IF  ; azzera flag timeout
689
000392 0012           00583         return
690
                      00584
691
000394                00585 KbVerf:
692
000394 0EEE           00586         movlw   KBD_ECHO                ; test tastiera tramite ECHO
693
000396 EC?? F???      00587         call    TxKeyb
694
00039A B0??           00588         btfsc   KStatus, KRESET ; test reset
695
00039C 00FF           00589         reset                                   ; ricevuto reset in -> reset
696
00039E B2??           00590         btfsc   KStatus, KTIMEO ; test timeout
697
0003A0 0012           00591         return                                  ; tastiera non presente
698
0003A2 AC??           00592         btfss   KStatus, KBTX   ; test trasmissione OK
699
0003A4 0012           00593         return                                  ; trasmissione fallita - si assume NO tastiera
700
0003A6 EC?? F???      00594         call    RxKeyb                  ; ricezione ECHO entro timeout
701
0003AA B0??           00595         btfsc   KStatus, KRESET ; test reset
702
0003AC 00FF           00596         reset                                   ; ricevuto reset in -> reset
703
0003AE B2??           00597         btfsc   KStatus, KTIMEO ; test timeout
704
0003B0 0012           00598         return                                  ; tastiera non presente
705
0003B2 8E??           00599         bsf             KbdFlag, KBFND  ; si assume tastiera presente
706
0003B4 AE??           00600         btfss   KStatus, KBRX   ; test ricezione full
707
0003B6 0012           00601         return                                  ; ricezione incompleta -> failure tastiera
708
                      00602         ldw             KStatus                 ; test errore ricezione
709
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 13
710
 
711
 
712
LOC  OBJECT CODE     LINE SOURCE TEXT
713
  VALUE
714
 
715
0003B8 50??               M         movf    KStatus, w
716
0003BA 0B0C           00603         andlw   KBRXERR
717
0003BC E1??           00604         bnz             KbVerf2                 ; dato ricevuto errato -> failure tastiera
718
0003BE 0EEE           00605         movlw   KBD_ECHO                ; test ECHO
719
0003C0 62??           00606         cpfseq  KBuf
720
0003C2 0012           00607         return                                  ; failure tastiera
721
0003C4 8C??           00608         bsf             KbdFlag, KBBAT  ; imposta flag BAT OK
722
0003C6                00609 KbVerf2:
723
0003C6 0012           00610         return
724
                      00611
725
0003C8                00612 KbdProc:
726
0003C8 0E00           00613         movlw   0x00                            ; test presenza bytes nella coda di ricezione
727
0003CA 5C??           00614         subwf   RxCnt, W
728
0003CC E1??           00615         bnz             KbdProc0                        ; coda non vuota
729
0003CE 9E??           00616         bcf             RxFlag, RXOVR           ; rimuove blocco TX (coda vuota)
730
                      00617         SCLOCKH                                         ; abilita TX da tastiera
731
0003D0 888A               M         bsf             LATB, KCLKO
732
0003D2 0012           00618         return
733
0003D4                00619 KbdProc0:
734
0003D4 BE??           00620         btfsc   TxFlag, TXOVR           ; buffer TX pronto ?
735
0003D6 0012           00621         return                                          ; NO - attende posto
736
                      00622         ldw             POSTINC1                        ; legge byte da coda -> FSR1 ptr coda di ricezio
737
                            ne
738
0003D8 50E6               M         movf    POSTINC1, w
739
0003DA 6E??           00623         movwf   RxData
740
0003DC 9EF2           00624         bcf             INTCON, GIEH            ; disabilita INT
741
0003DE 9CF2           00625         bcf             INTCON, GIEL
742
0003E0 06??           00626         decf    RxCnt, F                        ; aggiorna contatore bytes in coda
743
0003E2 9E??           00627         bcf             RxFlag, RXOVR           ; rimuove blocco TX (coda vuota)
744
                      00628         SCLOCKH                                         ; abilita TX da tastiera
745
0003E4 888A               M         bsf             LATB, KCLKO
746
0003E6 8EF2           00629         bsf             INTCON, GIEH            ; abilita INT
747
0003E8 8CF2           00630         bsf             INTCON, GIEL
748
                      00631         ; si assume che TBLPTR non cambia entro il ciclo
749
0003EA A8??           00632         btfss   RxFlag, RXEXT1          ; sequenza E1 pending ?
750
0003EC D???           00633         bra             KbdProc1                        ; NO
751
0003EE 0009           00634         tblrd   *+                                      ; legge byte da memoria ed incrementa ptr
752
                      00635         ldw             TABLAT
753
0003F0 50F5               M         movf    TABLAT, w
754
0003F2 5C??           00636         subwf   RxData, W                       ; confronta con dato ricevuto
755
0003F4 A4D8           00637         btfss   STATUS, Z                       ; Z = 1 se coincide
756
0003F6 86??           00638         bsf             RxFlag, RXE1ERR         ; segnala errore in sequenza E1
757
0003F8 2E??           00639         decfsz  E1Cnt, F                        ; decrementa contatore
758
0003FA D???           00640         bra             UpdBufPtr
759
0003FC                00641 E1Test:
760
0003FC A6??           00642         btfss   RxFlag, RXE1ERR         ; errore nella sequenza E1 ?
761
0003FE D???           00643         bra             PauseKey                        ; NO - tasto PAUSE premuto
762
000400                00644 ClrRX:                                                  ; termina scansione corrente - inizio nuova
763
000400 0E80           00645         movlw   RXMASK                          ; azzera tutti i flag ricezione
764
000402 16??           00646         andwf   RxFlag, F
765
000404                00647 UpdBufPtr:
766
000404 0E3E           00648         movlw   LOW(RxBufEnd)           ; coda circolare - test puntatore
767
000406 5CE1           00649         subwf   FSR1L, W                        ; FSR1L - LOW(RxBufEnd)
768
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 14
769
 
770
 
771
LOC  OBJECT CODE     LINE SOURCE TEXT
772
  VALUE
773
 
774
000408 0E01           00650         movlw   HIGH(RxBufEnd)          ; FSR1H - HIGH(RxBufEnd)
775
00040A 58E2           00651         subwfb  FSR1H, W                        ; C = 0 se FSR1 < RxBufEnd
776
00040C B0D8           00652         btfsc   STATUS, C                       ; OK
777
00040E EE10 F040      00653         lfsr    FSR1, RxBuffer          ; reimposta puntatore a inizio buffer
778
000412 0012           00654         return
779
000414                00655 PauseKey:
780
000414 0E09           00656         movlw   PAUSECODE                       ; imposta codice tasto PAUSE
781
000416 6E??           00657         movwf   RxCode
782
000418 D???           00658         rcall   GetKeyTbl
783
00041A D???           00659         bra             KbdProc14                       ; gestione tasti toggle
784
00041C                00660 KbdProc1:
785
00041C 0EF0           00661         movlw   KBD_BRK                         ; test break
786
00041E 5C??           00662         subwf   RxData, W
787
000420 E1??           00663         bnz             KbdProc2
788
000422 8C??           00664         bsf             RxFlag, RXBRK           ; F0 break pending
789
000424 D???           00665         bra             UpdBufPtr
790
000426                00666 KbdProc2:
791
000426 0EE0           00667         movlw   KBD_EXT                         ; test codice esteso
792
000428 5C??           00668         subwf   RxData, W
793
00042A E1??           00669         bnz             KbdProc3
794
00042C 0E80           00670         movlw   RXMASK                          ; azzera tutti i flag ricezione
795
00042E 16??           00671         andwf   RxFlag, F
796
000430 8A??           00672         bsf             RxFlag, RXEXT           ; imposta E0 pending
797
000432 D???           00673         bra             UpdBufPtr
798
000434                00674 KbdProc3:
799
000434 0EE1           00675         movlw   KBD_EXT1                        ; test codice esteso
800
000436 5C??           00676         subwf   RxData, W
801
000438 E1??           00677         bnz             KbdProc4
802
00043A 0E80           00678         movlw   RXMASK                          ; azzera tutti i flag ricezione
803
00043C 16??           00679         andwf   RxFlag, F
804
00043E 88??           00680         bsf             RxFlag, RXEXT1          ; imposta E1 pending
805
000440 0E??           00681         movlw   LOW EXT1TBL                     ; imposta ptr tabella sequenza E1
806
000442 6EF6           00682         movwf   TBLPTRL
807
000444 0E??           00683         movlw   HIGH EXT1TBL
808
000446 6EF7           00684         movwf   TBLPTRH
809
000448 0E07           00685         movlw   E1SEQCNT                        ; imposta numero bytes sequenza E1
810
00044A 6E??           00686         movwf   E1Cnt
811
00044C D???           00687         bra             UpdBufPtr
812
00044E                00688 KbdProc4:
813
00044E AA??           00689         btfss   RxFlag, RXEXT           ; codice esteso E0 pending ?
814
000450 D???           00690         bra             KbdProc6                        ; NO - codice normale o break
815
000452 0E??           00691         movlw   LOW EXTTBL                      ; imposta ptr tabella sequenza E0
816
000454 6EF6           00692         movwf   TBLPTRL
817
000456 0E??           00693         movlw   HIGH EXTTBL
818
000458 6EF7           00694         movwf   TBLPTRH
819
00045A 68??           00695         setf    E1Cnt                           ; indice tabella E0 (inizializzato a 0xFF)
820
00045C                00696 KbdProc5:
821
00045C 2A??           00697         incf    E1Cnt, F                        ; update indice
822
00045E 0009           00698         tblrd   *+                                      ; legge byte da memoria ed incrementa ptr
823
000460 0EFF           00699         movlw   0xFF                            ; test fine tabella
824
000462 5CF5           00700         subwf   TABLAT, W
825
000464 E0??           00701         bz              ClrRX                           ; termina sequenza
826
                      00702         ldw             TABLAT
827
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 15
828
 
829
 
830
LOC  OBJECT CODE     LINE SOURCE TEXT
831
  VALUE
832
 
833
000466 50F5               M         movf    TABLAT, w
834
000468 5C??           00703         subwf   RxData, W                       ; confronta con dato ricevuto
835
00046A E1??           00704         bnz             KbdProc5                        ; loop next
836
                      00705                                                                 ; trovato codice esteso
837
00046C 0E??           00706         movlw   LOW EXTRLTBL            ; imposta ptr tabella rilocazione E0
838
00046E 24??           00707         addwf   E1Cnt, W                        ; aggiunge indice
839
000470 6EF6           00708         movwf   TBLPTRL
840
000472 0E??           00709         movlw   HIGH EXTRLTBL
841
000474 6EF7           00710         movwf   TBLPTRH
842
000476 6AE8           00711         clrf    WREG
843
000478 22F7           00712         addwfc  TBLPTRH, F
844
00047A 0009           00713         tblrd   *+                                      ; codice rilocato
845
                      00714         ldw             TABLAT
846
00047C 50F5               M         movf    TABLAT, w
847
00047E D???           00715         bra             KbdProc10
848
000480                00716 KbdProc6:                                               ; codice normale
849
000480 0E??           00717         movlw   LOW DEFTBL                      ; imposta ptr tabella sequenza normale
850
000482 6EF6           00718         movwf   TBLPTRL
851
000484 0E??           00719         movlw   HIGH DEFTBL
852
000486 6EF7           00720         movwf   TBLPTRH
853
000488 68??           00721         setf    E1Cnt                           ; indice tabella (inizializzato a 0xFF)
854
00048A                00722 KbdProc7:
855
00048A 2A??           00723         incf    E1Cnt, F                        ; update indice
856
00048C 0009           00724         tblrd   *+                                      ; legge byte da memoria ed incrementa ptr
857
00048E 0EFF           00725         movlw   0xFF                            ; test fine tabella
858
000490 5CF5           00726         subwf   TABLAT, W
859
000492 E0??           00727         bz              KbdProc8                        ; codice da non rilocare
860
                      00728         ldw             TABLAT
861
000494 50F5               M         movf    TABLAT, w
862
000496 5C??           00729         subwf   RxData, W                       ; confronta con dato ricevuto
863
000498 E1??           00730         bnz             KbdProc7                        ; loop next
864
                      00731                                                                 ; trovato codice da rilocare
865
00049A 0E??           00732         movlw   LOW DEFRLTBL            ; imposta ptr tabella rilocazione
866
00049C 24??           00733         addwf   E1Cnt, W                        ; aggiunge indice
867
00049E 6EF6           00734         movwf   TBLPTRL
868
0004A0 0E??           00735         movlw   HIGH DEFRLTBL
869
0004A2 6EF7           00736         movwf   TBLPTRH
870
0004A4 6AE8           00737         clrf    WREG
871
0004A6 22F7           00738         addwfc  TBLPTRH, F
872
0004A8 0009           00739         tblrd   *+                                      ; codice rilocato
873
                      00740         ldw             TABLAT
874
0004AA 50F5               M         movf    TABLAT, w
875
0004AC D???           00741         bra             KbdProc10
876
0004AE                00742 KbdProc8:                                               ; rilocazione degli scan code 70..7E in 60..6E
877
0004AE 0E70           00743         movlw   0x70
878
0004B0 5C??           00744         subwf   RxData, W
879
                      00745         ldw             RxData                          ; W = codice non rilocato
880
0004B2 50??               M         movf    RxData, w
881
0004B4 E3??           00746         bnc             KbdProc10                       ; OK (< 70)
882
0004B6 0E7F           00747         movlw   0x7F                            ; max. codice di scansione 0x7E
883
0004B8 5C??           00748         subwf   RxData, W
884
0004BA E2??           00749         bc              ClrRX                           ; codice non valido (>= 7F) - azzera ed esce
885
0004BC 0E10           00750         movlw   0x10                            ; rilocazione codice in 60..6E
886
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 16
887
 
888
 
889
LOC  OBJECT CODE     LINE SOURCE TEXT
890
  VALUE
891
 
892
0004BE 5C??           00751         subwf   RxData, W                       ; W = codice rilocato
893
0004C0                00752 KbdProc10:                                              ; IN -> W = codice
894
0004C0 6E??           00753         movwf   E1Cnt                           ; codice
895
0004C2 0E??           00754         movlw   LOW CVTTBL                      ; imposta ptr tabella conversione
896
0004C4 24??           00755         addwf   E1Cnt, W                        ; aggiunge indice
897
0004C6 6EF6           00756         movwf   TBLPTRL
898
0004C8 0E??           00757         movlw   HIGH CVTTBL
899
0004CA 6EF7           00758         movwf   TBLPTRH
900
0004CC 6AE8           00759         clrf    WREG
901
0004CE 22F7           00760         addwfc  TBLPTRH, F
902
0004D0 0009           00761         tblrd   *+                                      ; codice rilocato
903
                      00762         ldw             TABLAT
904
0004D2 50F5               M         movf    TABLAT, w
905
0004D4 6E??           00763         movwf   RxCode                          ; nuovo codice
906
0004D6 E6??           00764         bmi             ClrRX                           ; codice non valido - azzera flag ed esce
907
0004D8 0E7B           00765         movlw   ('z' + 1)                       ; massimo codice 7A ('z')
908
0004DA 5C??           00766         subwf   RxCode, W
909
0004DC E2??           00767         bc              ClrRX                           ; codice non valido
910
                      00768
911
                      00769         ; RxCode contiene ora un codice compreso tra 00 e 7A
912
                      00770         ; codici 00 - 41 utilizzati per accesso tabella KEYTBL
913
                      00771         ; codici 42 - 56 utilizzati per accesso mappe US/IT
914
                      00772         ; codici 57 - 60 non validi
915
                      00773         ; codici 61 - 7A lettere 'a'..'z'
916
                      00774         ; codici 00 - 05 -> flag shift/alt/ctrl
917
                      00775         ; codici 06 - 09 -> tasti toggle (LOCK e PAUSE)
918
                      00776
919
0004DE 9C??           00777         bcf             TxFlag, SKPCTLB         ; azzera flag skip SHIFT/ALT/CTL
920
0004E0 9A??           00778         bcf             TxFlag, SKPALTB
921
0004E2 98??           00779         bcf             TxFlag, SKPSHFB
922
0004E4 9C??           00780         bcf             MapCfg, MAPALPHA        ; tasto non alfabetico
923
0004E6 0E61           00781         movlw   'a'                                     ; test carattere alfabetico
924
0004E8 5C??           00782         subwf   RxCode, W
925
0004EA E3??           00783         bnc             MKeyTst                         ; no alpha - test codice mappe US/IT
926
0004EC 6A??           00784         clrf    TxData0                         ; flag codice ASCII
927
                      00785         ldw             RxCode                          ; 'a'..'z'
928
0004EE 50??               M         movf    RxCode, w
929
0004F0 6E??           00786         movwf   TxData1                         ; codice ASCII tasto
930
0004F2 0E20           00787         movlw   0x20                            ; converte in maiuscolo
931
0004F4 5C??           00788         subwf   RxCode, W                       ; 'A'..'Z'
932
0004F6 6E??           00789         movwf   Caps
933
0004F8 8C??           00790         bsf             MapCfg, MAPALPHA        ; tasto alfabetico
934
0004FA D???           00791         bra             KbdProc40                       ; gestione tasto alpha
935
                      00792
936
0004FC                00793 MKeyTst:
937
0004FC 0E42           00794         movlw   MAPCODE                         ; test codice in 42..56 (mappe US/IT)
938
0004FE 5C??           00795         subwf   RxCode, W
939
000500 E3??           00796         bnc             NKeyTst                         ; CODE < MAPCODE - no tasto mappe US/IT
940
000502 6E??           00797         movwf   RxData                          ; salva CODE - MAPCODE (indice 0)
941
000504 0E57           00798         movlw   (MAPCODEMAX + 1)
942
000506 5C??           00799         subwf   RxCode, W
943
000508 E3??           00800         bnc             MapTst                          ; CODE < MAPCODEMAX + 1 - tasto mappe US/IT
944
00050A D???           00801         bra             ClrRX                           ; codice non valido
945
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 17
946
 
947
 
948
LOC  OBJECT CODE     LINE SOURCE TEXT
949
  VALUE
950
 
951
00050C                00802 MapTst:
952
                      00803         ; gestione mappe US/IT
953
00050C 90D8           00804         bcf             STATUS, C                       ; azzera carry
954
00050E 36??           00805         rlcf    RxData, f                       ; * 2
955
000510 88??           00806         bsf             TxFlag, SKPSHFB         ; skip test SHIFT
956
000512 BE??           00807         btfsc   MapCfg, MAPITB          ; configurazione mappa IT ?
957
000514 D???           00808         bra             ITMap                           ; SI
958
000516 BE??           00809         btfsc   ShfSt, ASHFB            ; SHIFT ?
959
000518 2A??           00810         incf    RxData, F                       ; SI - incrementa indice
960
00051A 0E??           00811         movlw   LOW USTBL                       ; imposta ptr tabella conversione mappa US
961
00051C 24??           00812         addwf   RxData, W                       ; aggiunge indice
962
00051E 6EF6           00813         movwf   TBLPTRL
963
000520 0E??           00814         movlw   HIGH USTBL
964
000522 6EF7           00815         movwf   TBLPTRH
965
000524 6AE8           00816         clrf    WREG
966
000526 22F7           00817         addwfc  TBLPTRH, F
967
000528 0008           00818         tblrd   *                                       ; codice tasto
968
                      00819         ldw             TABLAT
969
00052A 50F5               M         movf    TABLAT, w
970
00052C 6E??           00820         movwf   TxData1                         ; codice tasto
971
00052E 6A??           00821         clrf    TxData0                         ; flag ASCII
972
000530 D???           00822         bra             KbdProc41                       ; gestione tasto
973
000532                00823 ITMap:
974
000532 0E00           00824         movlw   0x00
975
000534 6E??           00825         movwf   TxData1
976
000536 6A??           00826         clrf    TxData0
977
000538 D???           00827         bra             KbdProc41                       ; gestione tasto
978
                      00828
979
00053A                00829 NKeyTst:
980
                      00830         ; gestione tasti NO-REPEAT: PWR, SLEEP, WAKEUP, APP
981
                      00831         ; L-GUI, R-GUI, ESC, PRINT SCRN
982
00053A 0E18           00832         movlw   WAKECODE
983
00053C 5C??           00833         subwf   RxCode, W
984
00053E E3??           00834         bnc             NMITst                          ; RxCode < WAKECODE
985
000540 6E??           00835         movwf   RxData                          ; RxData = RxCode - WAKECODE
986
000542 0E20           00836         movlw   (ESCCODE + 1)
987
000544 5C??           00837         subwf   RxCode, W
988
000546 E2??           00838         bc              NMITst                          ; RxCode >= (ESCCODE + 1)
989
000548 0E??           00839         movlw   LOW RPTTBL                      ; imposta ptr tabella flag RPTTBL
990
00054A 24??           00840         addwf   RxData, W                       ; aggiunge indice
991
00054C 6EF6           00841         movwf   TBLPTRL
992
00054E 0E??           00842         movlw   HIGH RPTTBL
993
000550 6EF7           00843         movwf   TBLPTRH
994
000552 6AE8           00844         clrf    WREG
995
000554 22F7           00845         addwfc  TBLPTRH, F
996
000556 0008           00846         tblrd   *                                       ; flag tasto
997
                      00847         ldw             TABLAT
998
000558 50F5               M         movf    TABLAT, w
999
00055A 6E??           00848         movwf   RxData                          ; flag
1000
00055C BC??           00849         btfsc   RxFlag, RXBRK           ; test tasto rilasciato
1001
00055E D???           00850         bra             NKeyRls                         ; SI
1002
000560 14??           00851         andwf   RptSt, W                        ; flag tasto premuto attivo ?
1003
000562 E0??           00852         bz              NKeySet                         ; NO - prima attivazione
1004
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 18
1005
 
1006
 
1007
LOC  OBJECT CODE     LINE SOURCE TEXT
1008
  VALUE
1009
 
1010
000564 D???           00853         bra             ClrRX                           ; tasto repeat - scarta codice
1011
000566                00854 NKeySet:
1012
                      00855         ldw             RxData                          ; set bit in RptSt
1013
000566 50??               M         movf    RxData, w
1014
000568 12??           00856         iorwf   RptSt, F
1015
00056A E1??           00857         bnz             NMITst
1016
00056C                00858 NKeyRls:
1017
00056C 1C??           00859         comf    RxData, W                       ; complementa maschera per azzerare bit
1018
00056E 16??           00860         andwf   RptSt, F                        ; azzera bit
1019
                      00861
1020
000570                00862 NMITst:
1021
                      00863         ; CTRL + BREAK, ALT + SYSREQ, WAKE UP, PWR, SLEEP sono tasti NMI
1022
                      00864         ; vengono rilevati solo dopo il loro rilascio
1023
000570 D???           00865         rcall   GetKeyTbl
1024
000572 52??           00866         movf    TxData1, F                      ; test se codice = 0
1025
000574 E1??           00867         bnz             NMITst1
1026
000576 D???           00868         bra             ClrRX                           ; tasto nullo - scarta codice
1027
000578                00869 NMITst1:
1028
000578 0EC0           00870         movlw   0xC0                            ; test tasto NMI
1029
00057A 5C??           00871         subwf   TxData0, W                      ; flag tasto
1030
00057C E1??           00872         bnz             KbdProc12                       ; no tasto NMI
1031
00057E AC??           00873         btfss   RxFlag, RXBRK           ; codice break ?
1032
000580 D???           00874         bra             ClrRX                           ; NO - scarta codice
1033
000582 9C??           00875         bcf             RxFlag, RXBRK           ; azzera flag
1034
000584 D???           00876         bra             KbdProc60                       ; gestione tasto NMI
1035
                      00877
1036
000586                00878 KbdProc12:
1037
                      00879         ; gestione tasti SHIFT/ALT/CTRL
1038
                      00880         ; TxData0 = flag tasto
1039
                      00881         ; TxData1 = codice tasto
1040
000586 0E80           00882         movlw   0x80                            ; test invio status flag
1041
000588 5C??           00883         subwf   TxData0, W
1042
00058A E1??           00884         bnz             KbdProc14                       ; no SHIFT/ALT/CTRL
1043
                      00885         ldw             CtlSt                           ; salva flag attuali
1044
00058C 50??               M         movf    CtlSt, w
1045
00058E 6E??           00886         movwf   TCtlSt
1046
000590 0EC0           00887         movlw   (ASHFM | ALTCTLM)       ; maschera bit necessari
1047
000592 14??           00888         andwf   ShfSt, W
1048
000594 6E??           00889         movwf   TShfSt
1049
                      00890         ldw             TxData1                         ; flag tasto
1050
000596 50??               M         movf    TxData1, w
1051
000598 6E??           00891         movwf   RxData                          ; flag attuale
1052
00059A 1C??           00892         comf    RxData, W                       ; complementa maschera per azzerare bit
1053
00059C 16??           00893         andwf   CtlSt, F                        ; azzera bit
1054
                      00894         ldw             RxData                          ; carica maschera bit attivi
1055
00059E 50??               M         movf    RxData, w
1056
0005A0 AC??           00895         btfss   RxFlag, RXBRK           ; lascia bit azzerati se tasto rilasciato
1057
0005A2 12??           00896         iorwf   CtlSt, F                        ; tasto premuto: imposta bit
1058
0005A4 9E??           00897         bcf             CtlSt, AALTB            ; azzera bit di ALT e CTRL
1059
0005A6 9C??           00898         bcf             CtlSt, ACTLB
1060
0005A8 0E24           00899         movlw   ALTKM                           ; test L-ALT OR R-ALT
1061
0005AA 14??           00900         andwf   CtlSt, W
1062
0005AC A4D8           00901         btfss   STATUS, Z                       ; Z = 1 -> no ALT
1063
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 19
1064
 
1065
 
1066
LOC  OBJECT CODE     LINE SOURCE TEXT
1067
  VALUE
1068
 
1069
0005AE 8E??           00902         bsf             CtlSt, AALTB            ; imposta bit ALT (L o R)
1070
0005B0 0E12           00903         movlw   CTRLKM                          ; test L-CTRL OR R-CTRL
1071
0005B2 14??           00904         andwf   CtlSt, W
1072
0005B4 A4D8           00905         btfss   STATUS, Z                       ; Z = 1 -> no CTRL
1073
0005B6 8C??           00906         bsf             CtlSt, ACTLB            ; imposta bit CTRL (L o R)
1074
0005B8 9E??           00907         bcf             ShfSt, ASHFB            ; azzera bit SHIFT
1075
0005BA 9C??           00908         bcf             ShfSt, ALTCTLB          ; azzera bit ALT OR CTRL
1076
0005BC 0E09           00909         movlw   SHIFTKM                         ; test L-SHIFT OR R-SHIFT
1077
0005BE 14??           00910         andwf   CtlSt, W
1078
0005C0 A4D8           00911         btfss   STATUS, Z                       ; Z = 1 -> no SHIFT
1079
0005C2 8E??           00912         bsf             ShfSt, ASHFB            ; imposta bit SHIFT (L o R)
1080
0005C4 0EC0           00913         movlw   ALLALTCTLM                      ; test ALT OR CTRL
1081
0005C6 14??           00914         andwf   CtlSt, W
1082
0005C8 A4D8           00915         btfss   STATUS, Z                       ; Z = 1 -> no ALT OR CTRL
1083
0005CA 8C??           00916         bsf             ShfSt, ALTCTLB          ; imposta bit ALT OR CTRL (L o R)
1084
                      00917         ldw             CtlSt                           ; confronta flag attuali con flag precedenti
1085
0005CC 50??               M         movf    CtlSt, w
1086
0005CE 62??           00918         cpfseq  TCtlSt
1087
0005D0 D???           00919         bra             KbdProc13                       ; flag cambiato
1088
0005D2 0EC0           00920         movlw   (ASHFM | ALTCTLM)
1089
0005D4 14??           00921         andwf   ShfSt, W                        ; maschera bit necessari
1090
0005D6 5C??           00922         subwf   TShfSt, W                       ; confronta con vecchio flag
1091
0005D8 E1??           00923         bnz             KbdProc13                       ; flag cambiato
1092
0005DA D???           00924         bra             ClrRX                           ; flag non cambiati -> scarta codice
1093
0005DC                00925 KbdProc13:                                              ; invia nuovi flag all' host
1094
                      00926         ; formato -> 100000<76-ShfSt> + CtlSt
1095
                      00927         ldw             CtlSt
1096
0005DC 50??               M         movf    CtlSt, w
1097
0005DE 6E??           00928         movwf   TxData1
1098
                      00929         ldw             ShfSt                           ; trasla bit 7 e 6 in bit 1 e 0
1099
0005E0 50??               M         movf    ShfSt, w
1100
0005E2 6E??           00930         movwf   RxData
1101
0005E4 42??           00931         rrncf   RxData, F                       ; bit 6
1102
0005E6 42??           00932         rrncf   RxData, F                       ; bit 5
1103
0005E8 42??           00933         rrncf   RxData, F                       ; bit 4
1104
0005EA 42??           00934         rrncf   RxData, F                       ; bit 3
1105
0005EC 42??           00935         rrncf   RxData, F                       ; bit 2
1106
0005EE 40??           00936         rrncf   RxData, W                       ; bit 1 -> W
1107
0005F0 0B03           00937         andlw   B'00000011'
1108
0005F2 12??           00938         iorwf   TxData0, F
1109
                      00939
1110
0005F4                00940 PutKey:                                                 ; inserisce word codice tasto nella coda TX
1111
0005F4 0EE0           00941         movlw   (TXMAXCNT - 1)          ; test spazio disponibile
1112
0005F6 5C??           00942         subwf   TxCnt, W                        ; W = TxCnt - (TMAXCNT - 1)
1113
0005F8 B0D8           00943         btfsc   STATUS, C                       ; W >= 0 -> C = 1
1114
0005FA 8E??           00944         bsf             TxFlag, TXOVR           ; segnala overrun buffer TX
1115
                      00945         ldw             TxHeadL                         ; imposta ptr head al buffer
1116
0005FC 50??               M         movf    TxHeadL, w
1117
0005FE 6EE9           00946         movwf   FSR0L
1118
                      00947         ldw             TxHeadH
1119
000600 50??               M         movf    TxHeadH, w
1120
000602 6EEA           00948         movwf   FSR0H
1121
                      00949         ldw             TxData0                         ; primo byte in coda
1122
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 20
1123
 
1124
 
1125
LOC  OBJECT CODE     LINE SOURCE TEXT
1126
  VALUE
1127
 
1128
000604 50??               M         movf    TxData0, w
1129
000606 6EEE           00950         movwf   POSTINC0
1130
                      00951         ldw             TxData1                         ; secondo byte in coda
1131
000608 50??               M         movf    TxData1, w
1132
00060A 6EEE           00952         movwf   POSTINC0
1133
00060C 2A??           00953         incf    TxCnt, F                        ; aggiorna contatore word nel buffer TX
1134
                      00954         ldw             FSR0L                           ; aggiorna ptr
1135
00060E 50E9               M         movf    FSR0L, w
1136
000610 6E??           00955         movwf   TxHeadL
1137
                      00956         ldw             FSR0H
1138
000612 50EA               M         movf    FSR0H, w
1139
000614 6E??           00957         movwf   TxHeadH
1140
000616 0E00           00958         movlw   LOW(TxBufEnd)           ; coda circolare - test puntatore
1141
000618 5C??           00959         subwf   TxHeadL, W                      ; TxHeadL - LOW(TxBufEnd)
1142
00061A 0E03           00960         movlw   HIGH(TxBufEnd)          ; TxHeadH - HIGH(TxBufEnd)
1143
00061C 58??           00961         subwfb  TxHeadH, W                      ; C = 0 se TxHead < TxBufEnd
1144
00061E A0D8           00962         btfss   STATUS, C                       ; test buffer
1145
000620 D???           00963         bra             ClrRX                           ; C = 0 -> OK
1146
000622 0E3E           00964         movlw   LOW(TxBuffer)           ; reimposta puntatore a inizio buffer
1147
000624 6E??           00965         movwf   TxHeadL
1148
000626 0E01           00966         movlw   HIGH(TxBuffer)
1149
000628 6E??           00967         movwf   TxHeadH
1150
00062A D???           00968         bra             ClrRX                           ; azzera flag ed esce
1151
                      00969
1152
00062C                00970 KbdProc14:
1153
                      00971         ; gestione tasti TOGGLE
1154
00062C 0E90           00972         movlw   0x90                            ; test invio toggle
1155
00062E 5C??           00973         subwf   TxData0, W                      ; test tasti LOCK o PAUSE
1156
000630 E1??           00974         bnz             KbdProc16
1157
                      00975         ldw             TglSt                           ; salva flag toggle attuali
1158
000632 50??               M         movf    TglSt, w
1159
000634 6E??           00976         movwf   TTglSt
1160
                      00977         ldw             LockSt
1161
000636 50??               M         movf    LockSt, w
1162
000638 6E??           00978         movwf   TLockSt
1163
00063A 0E09           00979         movlw   PAUSECODE                       ; test PAUSE
1164
00063C 5C??           00980         subwf   RxCode, W
1165
00063E E1??           00981         bnz             NoPause                         ; no tasto PAUSE
1166
000640 78??           00982         btg             TglSt, PAUSB            ; toggle bit ad ogni pressione PAUSE
1167
000642 D???           00983         bra             KbdProc15
1168
000644                00984 NoPause:
1169
000644 BC??           00985         btfsc   RxFlag, RXBRK           ; test tasto rilasciato
1170
000646 D???           00986         bra             ToggleRls                       ; SI
1171
000648 14??           00987         andwf   LockSt, W                       ; flag tasto premuto attivo ?
1172
00064A E0??           00988         bz              ToggleBit                       ; NO - prima attivazione
1173
00064C D???           00989         bra             ClrRX                           ; tasto repeat - scarta codice
1174
00064E                00990 ToggleBit:
1175
                      00991         ldw             TxData1                         ; toggle bit in TglSt
1176
00064E 50??               M         movf    TxData1, w
1177
000650 1A??           00992         xorwf   TglSt, F
1178
000652 12??           00993         iorwf   LockSt, F                       ; setta bit in LockSt
1179
000654 E1??           00994         bnz             TstLock
1180
000656                00995 ToggleRls:
1181
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 21
1182
 
1183
 
1184
LOC  OBJECT CODE     LINE SOURCE TEXT
1185
  VALUE
1186
 
1187
000656 1C??           00996         comf    TxData1, W                      ; complementa maschera per azzerare bit
1188
000658 16??           00997         andwf   LockSt, F                       ; azzera bit
1189
00065A                00998 TstLock:
1190
                      00999         ldw             TglSt                           ; confronta con toggle precedente
1191
00065A 50??               M         movf    TglSt, w
1192
00065C 5C??           01000         subwf   TTglSt, W
1193
00065E E1??           01001         bnz             LedUpd
1194
000660 D???           01002         bra             ClrRX                           ; toggle non modificato - scarta codice
1195
000662                01003 LedUpd:
1196
000662 EC?? F???      01004         call    SetLed1
1197
000666 A0??           01005         btfss   KbdFlag, KBLEDOK        ; comando LED riuscito
1198
000668 D???           01006         bra             ClrRX                           ; ignora tasto ed esce
1199
00066A                01007 KbdProc15:                                              ; invia toggle ad host
1200
                      01008         ; formato -> 10010000 + TglSt
1201
                      01009         ldw             TglSt
1202
00066A 50??               M         movf    TglSt, w
1203
00066C 6E??           01010         movwf   TxData1
1204
00066E D???           01011         bra             PutKey
1205
                      01012
1206
000670                01013 KbdProc16:
1207
                      01014         ; gestione tasti tastierino numerico (KP)
1208
000670 0E20           01015         movlw   KP0CODE
1209
000672 5C??           01016         subwf   RxCode, W
1210
000674 E3??           01017         bnc             KbdProc20                       ; no tasto numerico
1211
000676 0E2B           01018         movlw   INSCODE
1212
000678 5C??           01019         subwf   RxCode, W
1213
00067A E2??           01020         bc              KbdProc20                       ; no tasto numerico
1214
                      01021         ; se NUM-LOCK OFF i tasti numerici diventano tasti cursore (escluso 5)
1215
00067C AC??           01022         btfss   TglSt, NUMLB
1216
00067E D???           01023         bra             KbdProc18                       ; NUM-LOCK OFF -> converte in codice cursore
1217
                      01024         ; se NUM-LOCK ON e premuto il solo tasto SHIFT converte in codice cursore
1218
000680 AE??           01025         btfss   ShfSt, ASHFB
1219
000682 D???           01026         bra             KbdProc20                       ; no SHIFT -> tasto numerico
1220
000684 BC??           01027         btfsc   ShfSt, ALTCTLB          ; premuti ALT e/o CTRL ?
1221
000686 D???           01028         bra             KbdProc20                       ; si - tasto numerico
1222
000688 88??           01029         bsf             TxFlag, SKPSHFB         ; flag skip test SHIFT
1223
00068A 8A??           01030         bsf             TxFlag, SKPALTB         ; flag skip test ALT
1224
00068C 8C??           01031         bsf             TxFlag, SKPCTLB         ; flag skip test CTRL
1225
                      01032
1226
00068E                01033 KbdProc18:
1227
00068E 0E0B           01034         movlw   CRSLEN                          ; converte in codice tasto cursore
1228
000690 26??           01035         addwf   RxCode, F
1229
000692 D???           01036         rcall   GetKeyTbl                       ; legge nuovamente codice/flag tasto
1230
000694 52??           01037         movf    TxData1, F                      ; test se codice tasto = 0
1231
000696 E1??           01038         bnz             KbdProc20
1232
000698 D???           01039         bra             ClrRX                           ; scarta codice nullo
1233
                      01040
1234
00069A                01041 KbdProc20:
1235
                      01042         ; toggle tasto INSERT - soltanto senza SHIFT/ALT/CTRL
1236
00069A 0E2B           01043         movlw   INSCODE
1237
00069C 5C??           01044         subwf   RxCode, W
1238
00069E E1??           01045         bnz             KbdProc22
1239
0006A0 B8??           01046         btfsc   TxFlag, SKPSHFB         ; INSERT su tastierino numerico ?
1240
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 22
1241
 
1242
 
1243
LOC  OBJECT CODE     LINE SOURCE TEXT
1244
  VALUE
1245
 
1246
0006A2 D???           01047         bra             KbdProc21                       ; si - non testa SHIFT
1247
0006A4 0EC0           01048         movlw   SHFALL
1248
0006A6 14??           01049         andwf   ShfSt, W                        ; test SHIFT/ALT/CTRL
1249
0006A8 E1??           01050         bnz             KbdProc22                       ; no toggle
1250
0006AA                01051 KbdProc21:
1251
0006AA BC??           01052         btfsc   RxFlag, RXBRK           ; test tasto rilasciato
1252
0006AC D???           01053         bra             KbdProc22
1253
0006AE 74??           01054         btg             TglSt, INSTB            ; toggle bit INSERT
1254
                      01055
1255
0006B0                01056 KbdProc22:
1256
                      01057         ; imposta flag in TglSt per ESC e PRINT SCRN
1257
0006B0 0E1E           01058         movlw   PRTCODE
1258
0006B2 5C??           01059         subwf   RxCode, W
1259
0006B4 E0??           01060         bz              KbdProc23
1260
0006B6 0E1F           01061         movlw   ESCCODE
1261
0006B8 5C??           01062         subwf   RxCode, W
1262
0006BA E1??           01063         bnz             KbdProc24
1263
0006BC                01064 KbdProc23:
1264
0006BC 0E03           01065         movlw   ESCPRNM                         ; imposta flag ESC e PRINT SCRN
1265
0006BE 14??           01066         andwf   RptSt, W                        ; da RptSt a TglSt
1266
0006C0 12??           01067         iorwf   TglSt, F
1267
                      01068
1268
0006C2                01069 KbdProc24:
1269
                      01070         ; gestione tasti CR, TAB, SHIFT-CR, SHIFT-TAB, '<' e '>' mappa IT
1270
0006C2 0E0A           01071         movlw   CRCODE
1271
0006C4 5C??           01072         subwf   RxCode, W
1272
0006C6 E3??           01073         bnc             KbdProc26                       ; RxCode < CRCODE
1273
0006C8 0E10           01074         movlw   KPBARCODE
1274
0006CA 5C??           01075         subwf   RxCode, W
1275
0006CC E2??           01076         bc              KbdProc26                       ; RxCode >= KPBARCODE
1276
0006CE AE??           01077         btfss   ShfSt, ASHFB            ; SHIFT ?
1277
0006D0 D???           01078         bra             KbdProc25                       ; NO
1278
0006D2 BC??           01079         btfsc   ShfSt, ALTCTLB          ; CTRL/ALT ?
1279
0006D4 D???           01080         bra             KbdProc25                       ; SI
1280
0006D6 2A??           01081         incf    RxCode, F                       ; SHIFT -> increnmenta codice
1281
0006D8                01082 KbdProc25:
1282
0006D8 D???           01083         rcall   GetKeyTbl                       ; legge nuovamente codice/flag tasto
1283
0006DA 52??           01084         movf    TxData1, F                      ; test se codice tasto = 0
1284
0006DC E1??           01085         bnz             KbdProc50                       ; gestione tasto
1285
0006DE D???           01086         bra             ClrRX                           ; scarta codice nullo
1286
                      01087
1287
0006E0                01088 KbdProc26:
1288
                      01089         ; tasti funzione - a questo punto CODE < MAPCODE (42)
1289
0006E0 0E36           01090         movlw   FNCCODE                         ; range tasti funzione 36..41
1290
0006E2 5C??           01091         subwf   RxCode, W
1291
0006E4 E3??           01092         bnc             KbdProc50                       ; gestione tasti per codici < FNCCODE (36)
1292
                      01093
1293
                      01094         ;                                               FX -> A0..AB
1294
                      01095         ; SHIFT +                               FX -> AC..B7
1295
                      01096         ; CTL   +                               FX -> B8..C3
1296
                      01097         ; ALT   +                               FX -> C4..CF
1297
                      01098         ; CTL + SHIFT +                 FX -> D0..DB
1298
                      01099         ; CTL + ALT      +                      FX -> DC..E7
1299
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 23
1300
 
1301
 
1302
LOC  OBJECT CODE     LINE SOURCE TEXT
1303
  VALUE
1304
 
1305
                      01100         ; ALT + SHIFT +                 FX -> E8..F3
1306
                      01101         ; CTL + ALT + SHIFT     +       FX -> F4..FF
1307
                      01102
1308
0006E6 AE??           01103         btfss   ShfSt, ASHFB
1309
0006E8 D???           01104         bra             FnNoShf
1310
0006EA 0E0C           01105         movlw   D'12'                           ; SHIFT + Fx
1311
0006EC AC??           01106         btfss   ShfSt, ALTCTLB          ; ALT o CTRL ?
1312
0006EE D???           01107         bra             FnAdd                           ; no - SHIFT + FX
1313
0006F0 0E30           01108         movlw   D'48'
1314
0006F2 AE??           01109         btfss   CtlSt, AALTB            ; ALT ?
1315
0006F4 D???           01110         bra             FnAdd                           ; no - SHIFT + CTRL + Fx
1316
0006F6 0E48           01111         movlw   D'72'
1317
0006F8 AC??           01112         btfss   CtlSt, ACTLB            ; CTRL ?
1318
0006FA D???           01113         bra             FnAdd                           ; no - SHIFT + ALT + Fx
1319
0006FC 0E54           01114         movlw   D'84'                           ; SHIFT + ALT + CTRL + Fx
1320
0006FE D???           01115         bra             FnAdd
1321
000700                01116 FnNoShf:
1322
000700 0E00           01117         movlw   D'0'                            ; Fx
1323
000702 AC??           01118         btfss   ShfSt, ALTCTLB          ; ALT o CTRL ?
1324
000704 D???           01119         bra             FnAdd                           ; no - FX
1325
000706 0E18           01120         movlw   D'24'
1326
000708 AE??           01121         btfss   CtlSt, AALTB            ; ALT ?
1327
00070A D???           01122         bra             FnAdd                           ; no - CTRL + Fx
1328
00070C 0E24           01123         movlw   D'36'
1329
00070E AC??           01124         btfss   CtlSt, ACTLB            ; CTRL ?
1330
000710 D???           01125         bra             FnAdd                           ; no - ALT + Fx
1331
000712 0E3C           01126         movlw   D'60'                           ; ALT + CTRL + Fx
1332
000714                01127 FnAdd:
1333
000714 26??           01128         addwf   TxData1, F
1334
000716 D???           01129         bra             KeySnd                          ; tasti funzione inviati senza altri test
1335
                      01130
1336
000718                01131 KbdProc40:                                              ; gestione tasto alfabetico
1337
                      01132         ldw             Caps                            ; 'A'..'Z'
1338
000718 50??               M         movf    Caps, w
1339
00071A                01133 KbdProc41:                                              ; gestione tasto ASCII non-alpha
1340
00071A 6E??           01134         movwf   RxData                          ; codice tasto attuale (TxData1)
1341
00071C 0E40           01135         movlw   '@'
1342
00071E 5C??           01136         subwf   RxData, W
1343
000720 E3??           01137         bnc             KbdProc50                       ; key < '@' (40)
1344
000722 0E60           01138         movlw   '`'
1345
000724 5C??           01139         subwf   RxData, W
1346
000726 E2??           01140         bc              KbdProc50                       ; key >= '`' (60)
1347
000728 AE??           01141         btfss   CtlSt, AALTB            ; ALT ?
1348
00072A D???           01142         bra             KbdProc42                       ; NO
1349
00072C 0E1F           01143         movlw   0x1F
1350
00072E 14??           01144         andwf   RxData, W                       ; converte in 00..1F
1351
000730 0F60           01145         addlw   0x60                            ; converte in 60..7F
1352
000732 6E??           01146         movwf   TxData1                         ; codice controllo
1353
000734 0EA0           01147         movlw   0xA0                            ; flag codice controllo
1354
000736 6E??           01148         movwf   TxData0
1355
000738 D???           01149         bra             KbdProc50
1356
00073A                01150 KbdProc42:
1357
00073A AC??           01151         btfss   CtlSt, ACTLB            ; CTRL ?
1358
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 24
1359
 
1360
 
1361
LOC  OBJECT CODE     LINE SOURCE TEXT
1362
  VALUE
1363
 
1364
00073C D???           01152         bra             KbdProc43                       ; NO
1365
00073E 0E1F           01153         movlw   0x1F
1366
000740 14??           01154         andwf   RxData, W                       ; converte in 00..1F
1367
000742 6E??           01155         movwf   TxData1                         ; codice ASCII
1368
000744 6A??           01156         clrf    TxData0                         ; flag codice ASCII
1369
000746 D???           01157         bra             KbdProc50
1370
000748                01158 KbdProc43:
1371
                      01159         ; test SHIFT / CAPS-LOCK per tasti alfabetici
1372
000748 AC??           01160         btfss   MapCfg, MAPALPHA
1373
00074A D???           01161         bra             KbdProc50                       ; no tasto alfabetico
1374
                      01162         ldw             ShfSt                           ; SHIFT
1375
00074C 50??               M         movf    ShfSt, w
1376
00074E 18??           01163         xorwf   TglSt, W                        ; confronta con CAPS LOCK
1377
000750 0B80           01164         andlw   0x80                            ; interessa bit 7 soltanto
1378
000752 E0??           01165         bz              KbdProc50                       ; o NO SHIFT oppure CAPS LOCK + SHIFT -> a..z
1379
                      01166         ldw             Caps                            ; o SHIFT oppure CAPS LOCK -> A..Z
1380
000754 50??               M         movf    Caps, w
1381
000756 6E??           01167         movwf   TxData1
1382
                      01168
1383
000758                01169 KbdProc50:
1384
                      01170         ; ALT 0..9        -> 30..39
1385
                      01171         ; CTRL 0..9       -> 40..49
1386
                      01172         ; CTRL + ALT 0..9 -> 50..59
1387
000758 BE??           01173         btfsc   TxData0, 7
1388
00075A D???           01174         bra             Key10                           ; codice di controllo
1389
00075C 0E30           01175         movlw   '0'                                     ; test tasto numerico
1390
00075E 5C??           01176         subwf   TxData1, W
1391
000760 6E??           01177         movwf   RxData                          ; 0..9
1392
000762 E3??           01178         bnc             Key06
1393
000764 0E3A           01179         movlw   ('9' + 1)
1394
000766 5C??           01180         subwf   TxData1, W
1395
000768 E2??           01181         bc              Key06
1396
00076A AE??           01182         btfss   CtlSt, AALTB            ; ALT ?
1397
00076C D???           01183         bra             Key01                           ; NO
1398
00076E 0E30           01184         movlw   ALTKEY0                         ; ALT + 0..9
1399
000770 BC??           01185         btfsc   CtlSt, ACTLB            ; CTRL + ALT ?
1400
000772 0E50           01186         movlw   ALTCTLKEY0                      ; CTRL + ALT + 0..9
1401
000774 D???           01187         bra             Key02
1402
000776                01188 Key01:
1403
000776 AC??           01189         btfss   CtlSt, ACTLB            ; CTRL ?
1404
000778 D???           01190         bra             KeySnd                          ; NO - lascia inalterato il tasto
1405
00077A 0E40           01191         movlw   CTLKEY0                         ; CTRL + 0..9
1406
00077C                01192 Key02:
1407
00077C 24??           01193         addwf   RxData, W
1408
00077E 6E??           01194         movwf   TxData1                         ; codice controllo
1409
000780 0EA0           01195         movlw   0xA0                            ; flag codice controllo
1410
000782 6E??           01196         movwf   TxData0
1411
000784 D???           01197         bra             KeySnd                          ; invia tasto
1412
000786                01198 Key06:
1413
000786 0E1B           01199         movlw   KB_ESCAPE                       ; ESC, TAB, +, -
1414
000788 5C??           01200         subwf   TxData1, W
1415
00078A E0??           01201         bz              Key10
1416
00078C 0E09           01202         movlw   KB_TAB
1417
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 25
1418
 
1419
 
1420
LOC  OBJECT CODE     LINE SOURCE TEXT
1421
  VALUE
1422
 
1423
00078E 5C??           01203         subwf   TxData1, W
1424
000790 E0??           01204         bz              Key10
1425
000792 0E2B           01205         movlw   '+'
1426
000794 5C??           01206         subwf   TxData1, W
1427
000796 E0??           01207         bz              Key10
1428
000798 0E2D           01208         movlw   '-'
1429
00079A 5C??           01209         subwf   TxData1, W
1430
00079C E1??           01210         bnz             KeySnd
1431
00079E                01211 Key10:
1432
00079E 0E70           01212         movlw   SKPALL                          ; tasti cursore da tastierino numerico
1433
0007A0 14??           01213         andwf   TxFlag, W                       ; non vengono testati per SHIFT/CTRL/ALT
1434
0007A2 0870           01214         sublw   SKPALL
1435
0007A4 E0??           01215         bz              KeySnd
1436
0007A6 0E??           01216         movlw   LOW SPCKEY                      ; imposta ptr tabella tasti speciali
1437
0007A8 6EF6           01217         movwf   TBLPTRL
1438
0007AA 0E??           01218         movlw   HIGH SPCKEY
1439
0007AC 6EF7           01219         movwf   TBLPTRH
1440
0007AE 68??           01220         setf    E1Cnt                           ; indice tabella (inizializzato a 0xFF)
1441
0007B0                01221 Key11:
1442
0007B0 2A??           01222         incf    E1Cnt, F                        ; update indice
1443
0007B2 0009           01223         tblrd   *+                                      ; legge byte da memoria ed incrementa ptr
1444
0007B4 0EFF           01224         movlw   0xFF                            ; test fine tabella
1445
0007B6 5CF5           01225         subwf   TABLAT, W
1446
0007B8 E0??           01226         bz              KeySnd                          ; termina sequenza
1447
                      01227         ldw             TxData1                         ; confronta con tasto
1448
0007BA 50??               M         movf    TxData1, w
1449
0007BC 5CF5           01228         subwf   TABLAT, W
1450
0007BE E1??           01229         bnz             Key11                           ; loop
1451
0007C0 0EC0           01230         movlw   B'11000000'
1452
0007C2 14??           01231         andwf   CtlSt, W                        ; test ALT e/o CTRL
1453
0007C4 E0??           01232         bz              Key13                           ; test SHIFT
1454
0007C6 08C0           01233         sublw   B'11000000'                     ; CTRL + ALT ?
1455
0007C8 E1??           01234         bnz             Key12                           ; NO
1456
0007CA 0E03           01235         movlw   0x03                            ; CTRL + ALT
1457
0007CC D???           01236         bra             Key15
1458
0007CE                01237 Key12:
1459
0007CE 0E01           01238         movlw   0x01
1460
0007D0 BE??           01239         btfsc   CtlSt, AALTB
1461
0007D2 D???           01240         bra             Key15                           ; ALT
1462
0007D4 0E02           01241         movlw   0x02
1463
0007D6 D???           01242         bra             Key15                           ; CTRL
1464
0007D8                01243 Key13:
1465
0007D8 AE??           01244         btfss   ShfSt, ASHFB
1466
0007DA D???           01245         bra             KeySnd                          ; no SHIFT - non modifica tasto
1467
0007DC 0E00           01246         movlw   0x00
1468
0007DE                01247 Key15:
1469
0007DE 90D8           01248         bcf             STATUS, C
1470
0007E0 36??           01249         rlcf    E1Cnt, F
1471
0007E2 36??           01250         rlcf    E1Cnt, F                        ; * 4
1472
0007E4 26??           01251         addwf   E1Cnt, F
1473
0007E6 0E??           01252         movlw   LOW SPCKEY2                     ; imposta ptr tabella SPCKEY2
1474
0007E8 24??           01253         addwf   E1Cnt, W                        ; aggiunge indice
1475
0007EA 6EF6           01254         movwf   TBLPTRL
1476
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 26
1477
 
1478
 
1479
LOC  OBJECT CODE     LINE SOURCE TEXT
1480
  VALUE
1481
 
1482
0007EC 0E??           01255         movlw   HIGH SPCKEY2
1483
0007EE 6EF7           01256         movwf   TBLPTRH
1484
0007F0 6AE8           01257         clrf    WREG
1485
0007F2 22F7           01258         addwfc  TBLPTRH, F
1486
0007F4 0009           01259         tblrd   *+                                      ; codice
1487
                      01260         ldw             TABLAT
1488
0007F6 50F5               M         movf    TABLAT, w
1489
0007F8 E0??           01261         bz              KeySnd                          ; tasto null
1490
0007FA 6E??           01262         movwf   TxData1
1491
0007FC 0E??           01263         movlw   LOW SPCKEY3                     ; imposta ptr tabella SPCKEY3
1492
0007FE 24??           01264         addwf   E1Cnt, W                        ; aggiunge indice
1493
000800 6EF6           01265         movwf   TBLPTRL
1494
000802 0E??           01266         movlw   HIGH SPCKEY3
1495
000804 6EF7           01267         movwf   TBLPTRH
1496
000806 6AE8           01268         clrf    WREG
1497
000808 22F7           01269         addwfc  TBLPTRH, F
1498
00080A 0009           01270         tblrd   *+                                      ; codice
1499
                      01271         ldw             TABLAT
1500
00080C 50F5               M         movf    TABLAT, w
1501
00080E 6E??           01272         movwf   TxData0
1502
000810 0EC0           01273         movlw   0xC0
1503
000812 5C??           01274         subwf   TxData0, W
1504
000814 E0??           01275         bz              KbdProc60
1505
                      01276
1506
000816                01277 KeySnd:
1507
000816 BC??           01278         btfsc   RxFlag, RXBRK           ; test tasto rilasciato
1508
000818 8C??           01279         bsf             TxData0, KEYRLS         ; SI - imposta bit rilascio
1509
00081A A8??           01280         btfss   TxData0, KEYTGL         ; invia flag toggle low ?
1510
00081C D???           01281         bra             PutKey                          ; NO
1511
                      01282         ldw             TglSt
1512
00081E 50??               M         movf    TglSt, w
1513
000820 0B0F           01283         andlw   B'00001111'
1514
000822 12??           01284         iorwf   TxData0, F                      ; 4 bit bassi corrispondono ai 4 bit di TglSt
1515
000824 D???           01285         bra             PutKey
1516
                      01286
1517
000826                01287 KbdProc60:
1518
                      01288         ; setta NMI all' host
1519
000826 6A??           01289         clrf    Caps                            ; contatore temporaneo
1520
000828                01290 KbdProc61:
1521
000828 A280           01291         btfss   PORTA, HLNMI            ; host busy
1522
00082A D???           01292         bra             NMISnd                          ; NMI non attivo - attiva
1523
00082C 3E??           01293         incfsz  Caps, F                         ; attende host libero
1524
00082E D???           01294         bra             KbdProc61
1525
000830 EF?? F???      01295         goto    ClrRX                           ; scarta codice NMI
1526
000834                01296 NMISnd:
1527
000834 0E02           01297         movlw   0x02                            ; porta NMI
1528
000836 6E8D           01298         movwf   LATE                            ; indirizzo KFR
1529
                      01299         ldw             TxData1                         ; codice NMI
1530
000838 50??               M         movf    TxData1, w
1531
00083A D???           01300         rcall   KFRWrite                        ; codice in porta NMI
1532
00083C 9882           01301         bcf             PORTC, KFRSSN           ; attiva NMI host
1533
00083E 0000           01302         nop
1534
000840 8882           01303         bsf             PORTC, KFRSSN
1535
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 27
1536
 
1537
 
1538
LOC  OBJECT CODE     LINE SOURCE TEXT
1539
  VALUE
1540
 
1541
000842 D???           01304         bra             ClrRX
1542
                      01305
1543
000844                01306 GetKeyTbl:
1544
000844 0E??           01307         movlw   LOW KEYTBL                      ; imposta ptr tabella conversione KEYTBL
1545
000846 24??           01308         addwf   RxCode, W                       ; aggiunge indice
1546
000848 6EF6           01309         movwf   TBLPTRL
1547
00084A 0E??           01310         movlw   HIGH KEYTBL
1548
00084C 6EF7           01311         movwf   TBLPTRH
1549
00084E 6AE8           01312         clrf    WREG
1550
000850 22F7           01313         addwfc  TBLPTRH, F
1551
000852 0008           01314         tblrd   *                                       ; codice tasto
1552
                      01315         ldw             TABLAT
1553
000854 50F5               M         movf    TABLAT, w
1554
000856 6E??           01316         movwf   TxData1                         ; codice tasto
1555
000858 0E??           01317         movlw   LOW FLGTBL                      ; imposta ptr tabella conversione FLGTBL
1556
00085A 24??           01318         addwf   RxCode, W                       ; aggiunge indice
1557
00085C 6EF6           01319         movwf   TBLPTRL
1558
00085E 0E??           01320         movlw   HIGH FLGTBL
1559
000860 6EF7           01321         movwf   TBLPTRH
1560
000862 6AE8           01322         clrf    WREG
1561
000864 22F7           01323         addwfc  TBLPTRH, F
1562
000866 0008           01324         tblrd   *                                       ; flag tasto
1563
                      01325         ldw             TABLAT
1564
000868 50F5               M         movf    TABLAT, w
1565
00086A 6E??           01326         movwf   TxData0                         ; flag tasto
1566
00086C 0012           01327         return
1567
                      01328
1568
                      01329
1569
00086E                01330 KFRWrite:
1570
00086E 6E8C           01331         movwf   LATD                    ; byte da scrivere nel registro
1571
000870 6A95           01332         clrf    DDRD                    ; porta D in uscita
1572
000872 0000           01333         nop
1573
000874 0000           01334         nop                                             ; dato stabile
1574
000876 928B           01335         bcf             LATC, KFRWE             ; impulso write
1575
000878 0000           01336         nop
1576
00087A 828B           01337         bsf             LATC, KFRWE
1577
00087C 0000           01338         nop
1578
00087E 0012           01339         return
1579
                      01340
1580
000880                01341 KFRRead:
1581
000880 6895           01342         setf    DDRD                    ; Porta D input
1582
000882 6A8D           01343         clrf    LATE                    ; indirizzo file reg. = 0
1583
000884 0E04           01344         movlw   0x04                    ; contatore registri
1584
000886 6E??           01345         movwf   KFRRdCnt
1585
000888 EE?? F0??      01346         lfsr    FSR0, KFRRd0    ; puntatore registro 0
1586
00088C                01347 KFRRead1:
1587
00088C 908B           01348         bcf             LATC, KFRRD             ; lettura registro
1588
00088E 0000           01349         nop
1589
000890 0000           01350         nop
1590
000892                01351 KFRRead2:
1591
                      01352         ldw             PORTD                   ; legge porta D
1592
000892 5083               M         movf    PORTD, w
1593
000894 6283           01353         cpfseq  PORTD                   ; attende dato stabile
1594
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 28
1595
 
1596
 
1597
LOC  OBJECT CODE     LINE SOURCE TEXT
1598
  VALUE
1599
 
1600
000896 D???           01354         bra             KFRRead2
1601
000898 808B           01355         bsf             LATC, KFRRD             ; linea lettura alta
1602
00089A 6EEE           01356         movwf   POSTINC0                ; memorizza dato registro
1603
00089C 2A8D           01357         incf    LATE, f                 ; incrementa indirizzo
1604
00089E 2E??           01358         decfsz  KFRRdCnt, f             ; loop
1605
0008A0 D???           01359         bra             KFRRead1
1606
0008A2 6A8D           01360         clrf    LATE
1607
0008A4 9E??           01361         bcf             KFRFlag, KFRFULL        ; azzera flag richiesta servizio
1608
0008A6 0EE1           01362         movlw   0xE1                            ; set lock led
1609
0008A8 5C??           01363         subwf   KFRRd0, W
1610
0008AA E1??           01364         bnz             Cmd0
1611
0008AC D???           01365         rcall   SetLed
1612
0008AE 6A??           01366         clrf    KFRRd3                          ; errore ?
1613
0008B0 B0??           01367         btfsc   KbdFlag, KBLEDOK
1614
0008B2 68??           01368         setf    KFRRd3
1615
0008B4 D???           01369         bra             CmdRsp
1616
0008B6                01370 Cmd0:
1617
0008B6 0EC1           01371         movlw   0xC1                            ; start scanning
1618
0008B8 5C??           01372         subwf   KFRRd0, W
1619
0008BA E1??           01373         bnz             Cmd1
1620
                      01374         SCLOCKH
1621
0008BC 888A               M         bsf             LATB, KCLKO
1622
0008BE D???           01375         bra             CmdEnd
1623
0008C0                01376 Cmd1:
1624
0008C0 0EC2           01377         movlw   0xC2                            ; RESET
1625
0008C2 5C??           01378         subwf   KFRRd0, W
1626
0008C4 E1??           01379         bnz             Cmd2
1627
0008C6 9EF2           01380         bcf             INTCON, GIEH            ; disabilita INT high priority
1628
0008C8 9CF2           01381         bcf             INTCON, GIEL            ; disabilita INT low priority
1629
0008CA 9C8B           01382         bcf             LATC, KBVOFF    ; impulso negativo VCC tastiera
1630
0008CC 0E07           01383         movlw   TMR0P256                ; TMR0 stop, prescaler = 256, modo 16 bit
1631
0008CE 6ED5           01384         movwf   T0CON
1632
0008D0 94F2           01385         bcf             INTCON, TMR0IF  ; azzera flag timeout
1633
0008D2 0E8D           01386         movlw   HIGH(T1500MS)   ; imposta timeout 1500ms
1634
0008D4 6ED7           01387         movwf   TMR0H                   ; caricare prima TMR0H
1635
0008D6 0E90           01388         movlw   LOW(T1500MS)
1636
0008D8 6ED6           01389         movwf   TMR0L                   ; carica TMR0L/H
1637
0008DA 8ED5           01390         bsf             T0CON, TMR0ON   ; start Timer 0
1638
0008DC                01391 Wait1:
1639
0008DC A4F2           01392         btfss   INTCON, TMR0IF
1640
0008DE D???           01393         bra             Wait1                   ; timeout
1641
                      01394
1642
                      01395         ;bsf            LATC, KBVOFF
1643
0008E0 968B           01396         bcf             LATC, KFRSRP    ; azzera linea DRQ verso host
1644
0008E2 0000           01397         nop
1645
0008E4 0000           01398         nop
1646
0008E6 868B           01399         bsf             LATC, KFRSRP
1647
0008E8 00FF           01400         reset
1648
0008EA                01401 Cmd2:
1649
0008EA D???           01402         bra             CmdEnd
1650
0008EC                01403 CmdRsp:
1651
0008EC 0E03           01404         movlw   0x03
1652
0008EE 6E8D           01405         movwf   LATE
1653
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 29
1654
 
1655
 
1656
LOC  OBJECT CODE     LINE SOURCE TEXT
1657
  VALUE
1658
 
1659
                      01406         ldw             KFRRd3
1660
0008F0 50??               M         movf    KFRRd3, w
1661
0008F2 D???           01407         rcall   KFRWrite
1662
0008F4 D???           01408         bra             CmdEnd
1663
                      01409
1664
0008F6                01410 CmdEnd:
1665
0008F6 968B           01411         bcf             LATC, KFRSRP    ; azzera linea DRQ verso host
1666
0008F8 0000           01412         nop
1667
0008FA 0000           01413         nop
1668
0008FC 868B           01414         bsf             LATC, KFRSRP
1669
0008FE 0012           01415         return
1670
                      01416
1671
000900                01417 SetLed:
1672
                      01418         ldw             TglSt
1673
000900 50??               M         movf    TglSt, w
1674
000902 6E??           01419         movwf   TTglSt
1675
                      01420         ldw             KFRRd1
1676
000904 50??               M         movf    KFRRd1, w
1677
000906 6E??           01421         movwf   TglSt
1678
000908                01422 SetLed1:
1679
                      01423         ldw             TglSt
1680
000908 50??               M         movf    TglSt, w
1681
00090A 6E??           01424         movwf   LedSt
1682
00090C 42??           01425         rrncf   LedSt, F
1683
00090E 42??           01426         rrncf   LedSt, F
1684
000910 42??           01427         rrncf   LedSt, F
1685
000912 42??           01428         rrncf   LedSt, F
1686
000914 40??           01429         rrncf   LedSt, W
1687
000916 0B07           01430         andlw   B'00000111'
1688
000918 6E??           01431         movwf   LedSt
1689
                      01432         ldw             LATB                            ; salva porta B
1690
00091A 508A               M         movf    LATB, w
1691
00091C 6E??           01433         movwf   TPortB
1692
                      01434         SCLOCKL                                         ; inibisce TX da tastiera
1693
00091E 988A               M         bcf             LATB, KCLKO
1694
000920 9EF2           01435         bcf             INTCON, GIEH            ; disabilita INT high priority
1695
000922 9CF2           01436         bcf             INTCON, GIEL            ; disabilita INT low priority
1696
000924 EC?? F???      01437         call    SendLed
1697
000928 A8??           01438         btfss   TPortB, KCLKO           ; disabilita TX da tast. se era disabilitato
1698
                      01439         SCLOCKL
1699
00092A 988A               M         bcf             LATB, KCLKO
1700
00092C 92F2           01440         bcf             INTCON, INT0IF          ; resetta flag INT0
1701
00092E 8EF2           01441         bsf             INTCON, GIEH            ; abilita INT high priority
1702
000930 8CF2           01442         bsf             INTCON, GIEL            ; abilita INT low priority
1703
000932 E3??           01443         bnc             SetLed2                         ; comando LED riuscito
1704
                      01444         ldw             TTglSt                          ; errore -> ignora tasto
1705
000934 50??               M         movf    TTglSt, w
1706
000936 6E??           01445         movwf   TglSt                           ; reimposta flag toggle precedente
1707
                      01446         ldw             TLockSt
1708
000938 50??               M         movf    TLockSt, w
1709
00093A 6E??           01447         movwf   LockSt
1710
00093C 90??           01448         bcf             KbdFlag, KBLEDOK        ; comando LED fallito
1711
00093E 0012           01449         return                                          ; fail
1712
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 30
1713
 
1714
 
1715
LOC  OBJECT CODE     LINE SOURCE TEXT
1716
  VALUE
1717
 
1718
000940                01450 SetLed2:
1719
000940 80??           01451         bsf             KbdFlag, KBLEDOK
1720
000942 0012           01452         return
1721
                      01453
1722
000944                01454 SndProc:                                                ; invia word nella coda TX ad host
1723
000944 B080           01455         btfsc   PORTA, HLINT            ; host busy ?
1724
000946 0012           01456         return                                          ; si
1725
                      01457         ldw             TxTailL                         ; imposta ptr head al buffer
1726
000948 50??               M         movf    TxTailL, w
1727
00094A 6EE9           01458         movwf   FSR0L
1728
                      01459         ldw             TxTailH
1729
00094C 50??               M         movf    TxTailH, w
1730
00094E 6EEA           01460         movwf   FSR0H
1731
                      01461         ldw             POSTINC0
1732
000950 50EE               M         movf    POSTINC0, w
1733
000952 6E??           01462         movwf   TxData0
1734
                      01463         ldw             POSTINC0
1735
000954 50EE               M         movf    POSTINC0, w
1736
000956 6E??           01464         movwf   TxData1
1737
000958 6A8D           01465         clrf    LATE                            ; indirizzo KFR = 0
1738
                      01466         ldw             TxData0                         ; flag tasto
1739
00095A 50??               M         movf    TxData0, w
1740
00095C D???           01467         rcall   KFRWrite
1741
00095E 0E01           01468         movlw   0x01                            ; indirizzo KFR = 1
1742
000960 6E8D           01469         movwf   LATE
1743
                      01470         ldw             TxData1                         ; codice tasto
1744
000962 50??               M         movf    TxData1, w
1745
000964 D???           01471         rcall   KFRWrite
1746
000966 9A82           01472         bcf             PORTC, KFRSSI           ; attiva INT host
1747
000968 0000           01473         nop
1748
00096A 8A82           01474         bsf             PORTC, KFRSSI
1749
00096C 06??           01475         decf    TxCnt, F                        ; aggiorna contatore word nel buffer TX
1750
                      01476         ldw             FSR0L                           ; aggiorna ptr
1751
00096E 50E9               M         movf    FSR0L, w
1752
000970 6E??           01477         movwf   TxTailL
1753
                      01478         ldw             FSR0H
1754
000972 50EA               M         movf    FSR0H, w
1755
000974 6E??           01479         movwf   TxTailH
1756
000976 0E00           01480         movlw   LOW(TxBufEnd)           ; coda circolare - test puntatore
1757
000978 5C??           01481         subwf   TxTailL, W                      ; TxTailL - LOW(TxBufEnd)
1758
00097A 0E03           01482         movlw   HIGH(TxBufEnd)          ; TxTailH - HIGH(TxBufEnd)
1759
00097C 58??           01483         subwfb  TxTailH, W                      ; C = 0 se TxTail < TxBufEnd
1760
00097E A0D8           01484         btfss   STATUS, C                       ; test buffer
1761
000980 0012           01485         return                                          ; C = 0 -> OK
1762
000982 0E3E           01486         movlw   LOW(TxBuffer)           ; reimposta puntatore a inizio buffer
1763
000984 6E??           01487         movwf   TxTailL
1764
000986 0E01           01488         movlw   HIGH(TxBuffer)
1765
000988 6E??           01489         movwf   TxTailH
1766
00098A 0012           01490         return
1767
                      01491
1768
00098C                01492 Start:
1769
00098C 0100           01493         movlb   0x00
1770
00098E EC?? F???      01494         call    InitIO
1771
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 31
1772
 
1773
 
1774
LOC  OBJECT CODE     LINE SOURCE TEXT
1775
  VALUE
1776
 
1777
000992 9A89           01495         bcf             LATA, RA5                       ; bit READY
1778
                      01496
1779
000994                01497 Main:
1780
000994 A88A           01498         btfss   LATB, KCLKO                     ; se TX disabilitato salta
1781
000996 D???           01499         bra             Main2
1782
000998 EC?? F???      01500         call    KbdProc
1783
00099C 66??           01501         tstfsz  TxCnt                           ; coda TX vuota
1784
00099E D???           01502         rcall   SndProc                         ; invia word codice ad host
1785
0009A0                01503 Main2:
1786
0009A0 BE??           01504         btfsc   KFRFlag, KFRFULL        ; host richiede servizio ?
1787
0009A2 D???           01505         rcall   KFRRead                         ; si - lettura registro KFR
1788
0009A4 D???           01506         bra             Main
1789
                      01507
1790
                      01508         #include romtbl.inc
1791
                      00001
1792
                      00002         ;NOLIST
1793
                      00003
1794
                      00004
1795
                      00005 RomTbl          code_pack
1796
                      00006 ; Fill
1797
000000 00 00 00 00 00 00007         dw              0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
1798
       00 00 00 00 00
1799
       00 00 00 00 00
1800
       00
1801
                      00008
1802
                      00009 ; mappa codici ASCII tastiera USA
1803
000010                00010 USTBL:
1804
000010 60 7E          00011         DB              "`", "~"
1805
000012 31 21          00012         DB              "1", "!"
1806
000014 32 40          00013         DB              "2", "@"
1807
000016 34 24          00014         DB              "4", "$"
1808
000018 33 23          00015         DB              "3", "#"
1809
00001A 35 25          00016         DB              "5", "%"
1810
00001C 36 5E          00017         DB              "6", "^"
1811
00001E 37 26          00018         DB              "7", "&"
1812
000020 38 2A          00019         DB              "8", "*"
1813
000022 2C 3C          00020         DB              ",", "<"
1814
000024 30 29          00021         DB              "0", ")"
1815
000026 39 28          00022         DB              "9", "("
1816
000028 2E 3E          00023         DB              ".", ">"
1817
00002A 2F 3F          00024         DB              "/", "?"
1818
00002C 3B 3A          00025         DB              ";", ":"
1819
00002E 2D 5F          00026         DB              "-", "_"
1820
000030 27 22          00027         DB              "'", "\""
1821
000032 5B 7B          00028         DB              "[", "{"
1822
000034 3D 2B          00029         DB              "=", "+"
1823
000036 5D 7D          00030         DB              "]", "}"
1824
000038 5C 7C          00031         DB              "\\", "|"
1825
                      00032
1826
                      00033 ; tabella tasti speciali SHIFT, ALT, CTRL, CTRL+ALT
1827
00003A                00034 SPCKEY2:
1828
00003A 01 02 03 04    00035         DB              KB_SHIFTPRT,    KB_ALTPRT,              KB_CTLPRT,              KB_ALTCTLPRT
1829
00003E 05 06 07 08    00036         DB              KB_SHIFTHOME,   KB_ALTHOME,     KB_CTLHOME,     KB_ALTCTLHOME
1830
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 32
1831
 
1832
 
1833
LOC  OBJECT CODE     LINE SOURCE TEXT
1834
  VALUE
1835
 
1836
000042 09 0A 0B 0C    00037         DB              KB_SHIFTINS,    KB_ALTINS,              KB_CTLINS,              KB_ALTCTLINS
1837
000046 0D 0E 0F 10    00038         DB              KB_SHIFTPGUP,   KB_ALTPGUP,             KB_CTLPGUP,             KB_ALTCTLPGUP
1838
00004A 11 12 13 14    00039         DB              KB_SHIFTPGDWN,  KB_ALTPGDWN,    KB_CTLPGDWN,    KB_ALTCTLPGDWN
1839
00004E 15 16 17 80    00040         DB              KB_SHIFTEND,    KB_ALTEND,              KB_CTLEND,              KB_ALTCTLEND
1840
000052 18 19 1A 81    00041         DB              KB_SHIFTDEL,    KB_ALTDEL,              KB_CTLDEL,              KB_ALTCTLDEL
1841
000056 1B 1C 1D 82    00042         DB              KB_SHIFTBKS,    KB_ALTBKS,              KB_CTLBKS,              KB_ALTCTLBKS
1842
00005A 00 1E 1F 88    00043         DB              0x00,                   KB_ALTESC,              KB_CTLESC,              KB_ALTCT
1843
                            LESC
1844
00005E 00 20 21 22    00044         DB              0x00,                   KB_ALTTAB,              KB_CTLTAB,              KB_ALTCT
1845
                            LTAB
1846
000062 00 23 24 25    00045         DB              0x00,                   KB_ALTPLUS,             KB_CTLPLUS,             KB_ALTCT
1847
                            LPLUS
1848
000066 00 26 27 28    00046         DB              0x00,                   KB_ALTMINUS,    KB_CTLMINUS,    KB_ALTCTLMINUS
1849
                      00047
1850
                      00048 ; tabella flag tasti speciali SHIFT, ALT, CTRL, CTRL+ALT
1851
00006A                00049 SPCKEY3:
1852
00006A A0 A0 A0 A0    00050         DB              0xA0, 0xA0, 0xA0, 0xA0
1853
00006E A0 A0 A0 A0    00051         DB              0xA0, 0xA0, 0xA0, 0xA0
1854
000072 A0 A0 A0 A0    00052         DB              0xA0, 0xA0, 0xA0, 0xA0
1855
000076 A0 A0 A0 A0    00053         DB              0xA0, 0xA0, 0xA0, 0xA0
1856
00007A A0 A0 A0 A0    00054         DB              0xA0, 0xA0, 0xA0, 0xA0
1857
00007E A0 A0 A0 C0    00055         DB              0xA0, 0xA0, 0xA0, 0xC0
1858
000082 A0 A0 A0 C0    00056         DB              0xA0, 0xA0, 0xA0, 0xC0
1859
000086 A0 A0 A0 C0    00057         DB              0xA0, 0xA0, 0xA0, 0xC0
1860
00008A A0 A0 A0 C0    00058         DB              0xA0, 0xA0, 0xA0, 0xC0
1861
00008E A0 A0 A0 A0    00059         DB              0xA0, 0xA0, 0xA0, 0xA0
1862
000092 A0 A0 A0 A0    00060         DB              0xA0, 0xA0, 0xA0, 0xA0
1863
000096 A0 A0 A0 A0    00061         DB              0xA0, 0xA0, 0xA0, 0xA0
1864
                      00062
1865
                      00063 ; tabella tasti speciali
1866
00009A                00064 SPCKEY:
1867
00009A 83             00065         DB              KB_PRTSCN
1868
00009B 85             00066         DB              KB_HOME
1869
00009C 86             00067         DB              KB_INSERT
1870
00009D 88             00068         DB              KB_PGUP
1871
00009E 8A             00069         DB              KB_PGDOWN
1872
00009F 8C             00070         DB              KB_END
1873
0000A0 8E             00071         DB              KB_DELETE
1874
0000A1 90             00072         DB              KB_BACKSPACE
1875
0000A2 1B             00073         DB              KB_ESCAPE
1876
0000A3 09             00074         DB              KB_TAB
1877
0000A4 2B             00075         DB              '+'
1878
0000A5 2D             00076         DB              '-'
1879
0000A6 FF             00077         DB              0xFF
1880
                      00078
1881
                      00079 ; SEQUENZA E0 12 E0 7C                                  PRTSCR DOWN  (SIMULA SHIFT *)
1882
                      00080 ; SEQUENZA E0 F0 7C E0 F0 12                    PRTSCR UP
1883
                      00081 ; SEQUENXA E1 14 77 E1 F0 14 F0 77     PAUSE (SIMULA L-CTRL NUMLOCK)
1884
                      00082 ; E1 indica tasti no-repeat
1885
                      00083
1886
                      00084 ; PRIORITA' MODIFICATORI: ALT   CTRL    SHIFT   CAPS/NUMLOCK
1887
                      00085
1888
                      00086 ; Tabella codici prefissati da E1 - Tasto PAUSE (solo make)
1889
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 33
1890
 
1891
 
1892
LOC  OBJECT CODE     LINE SOURCE TEXT
1893
  VALUE
1894
 
1895
                      00087 ; scan code: E1 14 77 E1 F0 14 F0 77 - di seguito la sequenza aspettata
1896
0000A7                00088 EXT1TBL:
1897
0000A7 14 77 E1 F0 14 00089         db              0x14, 0x77, 0xE1, 0xF0, 0x14, 0xF0, 0x77
1898
       F0 77
1899
                      00090
1900
                      00091 ; Tabella codici estesi (prefisso E0)
1901
                      00092 ; NOTA: codice make  PRNT -> E0 12 E0 7C (simula SHIFT *)
1902
                      00093 ;       codice break PRNT -> E0 F0 7C E0 F0 12
1903
                      00094 ; Tutte le sequenze E0 12 / E0 F0 12 / E0 59 / E0 F0 59
1904
                      00095 ; vengono scartate
1905
                      00096 ; Per la combinazione CTRL BREAK (E0 7E E0 F0 7E) viene analizzata
1906
                      00097 ; solo la parte che simula il rilascio (E0 F0 7E)
1907
0000AE                00098 EXTTBL:
1908
0000AE 7C             00099         DB              0x7C            ; PRNT                  RILOCATO $00
1909
0000AF 11             00100         DB              0x11            ; R-ALT                 RILOCATO $10
1910
0000B0 14             00101         DB              0x14            ; R-CTRL                RILOCATO $0F
1911
0000B1 70             00102         DB              0x70            ; INS                   RILOCATO $13
1912
0000B2 71             00103         DB              0x71            ; DEL                   RILOCATO $08
1913
0000B3 6C             00104         DB              0x6C            ; HOME                  RILOCATO $17
1914
0000B4 69             00105         DB              0x69            ; END                   RILOCATO $18
1915
0000B5 7A             00106         DB              0x7A            ; PG-DOWN               RILOCATO $19
1916
0000B6 7D             00107         DB              0x7D            ; PG-UP                 RILOCATO $20
1917
0000B7 75             00108         DB              0x75            ; CSR-UP                RILOCATO $28
1918
0000B8 6B             00109         DB              0x6B            ; CSR-LEFT              RILOCATO $30
1919
0000B9 72             00110         DB              0x72            ; CSR-DOWN              RILOCATO $38
1920
0000BA 74             00111         DB              0x74            ; CSR-RIGHT             RILOCATO $39
1921
0000BB 5A             00112         DB              0x5A            ; KP-ENTER              RILOCATO $5A
1922
0000BC 4A             00113         DB              0x4A            ; KP /                  RILOCATO $5F
1923
0000BD 1F             00114         DB              0x1F            ; L=GUI                 RILOCATO $1F
1924
0000BE 27             00115         DB              0x27            ; R-GUI                 RILOCATO $27
1925
0000BF 2F             00116         DB              0x2F            ; APPS                  RILOCATO $2F
1926
0000C0 37             00117         DB              0x37            ; PWR                   RILOCATO $37
1927
0000C1 3F             00118         DB              0x3F            ; SLEEP                 RILOCATO $3F
1928
0000C2 5E             00119         DB              0x5E            ; WAKE                  RILOCATO $5E
1929
0000C3 7E             00120         DB              0x7E            ; CTRL-BREAK    RILOCATO $48
1930
0000C4 FF             00121         DB              0xFF            ; FINE TABELLA
1931
                      00122
1932
                      00123 ; Tabella rilocazione codici estesi (prefisso E0)
1933
0000C5                00124 EXTRLTBL:
1934
0000C5 00             00125         DB              0x00            ; PRNT                  RILOCATO $00
1935
0000C6 10             00126         DB              0x10            ; R-ALT                 RILOCATO $10
1936
0000C7 0F             00127         DB              0x0F            ; R-CTRL                RILOCATO $0F
1937
0000C8 13             00128         DB              0x13            ; INS                   RILOCATO $13
1938
0000C9 08             00129         DB              0x08            ; DEL                   RILOCATO $08
1939
0000CA 17             00130         DB              0x17            ; HOME                  RILOCATO $17
1940
0000CB 18             00131         DB              0x18            ; END                   RILOCATO $18
1941
0000CC 19             00132         DB              0x19            ; PG-DOWN               RILOCATO $19
1942
0000CD 20             00133         DB              0x20            ; PG-UP                 RILOCATO $20
1943
0000CE 28             00134         DB              0x28            ; CSR-UP                RILOCATO $28
1944
0000CF 30             00135         DB              0x30            ; CSR-LEFT              RILOCATO $30
1945
0000D0 38             00136         DB              0x38            ; CSR-DOWN              RILOCATO $38
1946
0000D1 39             00137         DB              0x39            ; CSR-RIGHT             RILOCATO $39
1947
0000D2 5A             00138         DB              0x5A            ; KP-ENTER              RILOCATO $5A
1948
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 34
1949
 
1950
 
1951
LOC  OBJECT CODE     LINE SOURCE TEXT
1952
  VALUE
1953
 
1954
0000D3 5F             00139         DB              0x5F            ; KP /                  RILOCATO $5F
1955
0000D4 1F             00140         DB              0x1F            ; L=GUI                 RILOCATO $1F
1956
0000D5 27             00141         DB              0x27            ; R-GUI                 RILOCATO $27
1957
0000D6 2F             00142         DB              0x2F            ; APPS                  RILOCATO $2F
1958
0000D7 37             00143         DB              0x37            ; PWR                   RILOCATO $37
1959
0000D8 3F             00144         DB              0x3F            ; SLEEP                 RILOCATO $3F
1960
0000D9 5E             00145         DB              0x5E            ; WAKE                  RILOCATO $5E
1961
0000DA 48             00146         DB              0x48            ; CTRL-BREAK    RILOCATO $48
1962
                      00147
1963
                      00148 ; Codici normali da rilocare
1964
                      00149 ; I codici da 70 a 7E vanno rilocati in 60 - 6E
1965
0000DB                00150 DEFTBL:
1966
0000DB 83             00151         DB              0x83            ; F7                    RILOCATO $02
1967
0000DC 84             00152         DB              0x84            ; ALT SYSREQ    RILOCATO $40
1968
0000DD 66             00153         DB              0x66            ; BACKSPACE             RILOCATO $47
1969
0000DE 69             00154         DB              0x69            ; KP 1                  RILOCATO $4F
1970
0000DF 6B             00155         DB              0x6B            ; KP 4                  RILOCATO $50
1971
0000E0 6C             00156         DB              0x6C            ; KP 7                  RILOCATO $51
1972
0000E1 61             00157         DB              0x61            ; IT <>                 RILOCATO $53 (TASTO 45)
1973
0000E2 FF             00158         DB              0xFF            ; FINE TABELLA
1974
                      00159
1975
                      00160 ; Tabella rilocazione codici normali
1976
0000E3                00161 DEFRLTBL:
1977
0000E3 02             00162         DB              0x02            ; F7                    RILOCATO $02
1978
0000E4 40             00163         DB              0x40            ; ALT SYSREQ    RILOCATO $40
1979
0000E5 47             00164         DB              0x47            ; BACKSPACE             RILOCATO $47
1980
0000E6 4F             00165         DB              0x4F            ; KP 1                  RILOCATO $4F
1981
0000E7 50             00166         DB              0x50            ; KP 4                  RILOCATO $50
1982
0000E8 51             00167         DB              0x51            ; KP 7                  RILOCATO $51
1983
0000E9 53             00168         DB              0x53            ; IT <>                 RILOCATO $53
1984
                      00169
1985
                      00170 ; seconda tabella di conversione (da codice scansione rilocato a semi ASCII)
1986
                      00171 ; indice accesso da 00 a 6E
1987
                      00172 ; la tabella ritorna un codice tra 00 e 7A esclusi 0B, 0F e range 57..60
1988
                      00173 ; i codici relativi alle lettere a..z vengono restituiti come 'a'..'z'
1989
                      00174 ; i codici 42..56 sono quelli da distinguere tra mappa US e mappa IT
1990
                      00175 ; i valori 0xFF indicano codice non valido
1991
0000EA                00176 CVTTBL
1992
0000EA 1E             00177         DB              PRTCODE         ; 00 *PRNT
1993
0000EB 3E             00178         DB              0x3E            ; 01 F9
1994
0000EC 3C             00179         DB              0x3C            ; 02 *F7
1995
0000ED 3A             00180         DB              0x3A            ; 03 F5
1996
0000EE 38             00181         DB              0x38            ; 04 F3
1997
0000EF 36             00182         DB              FNCCODE         ; 05 F1
1998
0000F0 37             00183         DB              0x37            ; 06 F2
1999
0000F1 41             00184         DB              0x41            ; 07 F12
2000
0000F2 35             00185         DB              0x35            ; 08 *DEL
2001
0000F3 3F             00186         DB              0x3F            ; 09 F10
2002
0000F4 3D             00187         DB              0x3D            ; 0A F8
2003
0000F5 3B             00188         DB              0x3B            ; 0B F6
2004
0000F6 39             00189         DB              0x39            ; 0C F4
2005
0000F7 0E             00190         DB              0x0E            ; 0D TAB
2006
0000F8 42             00191         DB              0x42            ; 0E `~         IT \|
2007
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 35
2008
 
2009
 
2010
LOC  OBJECT CODE     LINE SOURCE TEXT
2011
  VALUE
2012
 
2013
0000F9 04             00192         DB              0x04            ; 0F *R-CTRL
2014
0000FA 05             00193         DB              0x05            ; 10 *R-ALT
2015
0000FB 02             00194         DB              0x02            ; 11 L- ALT
2016
0000FC 00             00195         DB              0x00            ; 12 L-SHIFT
2017
0000FD 2B             00196         DB              INSCODE         ; 13 *INS
2018
0000FE 01             00197         DB              0x01            ; 14 L-CTRL
2019
0000FF 71             00198         DB              'q'                     ; 15 qQ
2020
000100 43             00199         DB              0x43            ; 16 1!         IT 1!
2021
000101 32             00200         DB              0x32            ; 17 *HOME
2022
000102 2C             00201         DB              0x2C            ; 18 *END
2023
000103 2E             00202         DB              0x2E            ; 19 *PG-DOWN
2024
000104 7A             00203         DB              'z'                     ; 1A zZ
2025
000105 73             00204         DB              's'                     ; 1B sS
2026
000106 61             00205         DB              'a'                     ; 1C aA
2027
000107 77             00206         DB              'w'                     ; 1D wW
2028
000108 44             00207         DB              0x44            ; 1E 2@         IT 2"
2029
000109 1C             00208         DB              0x1C            ; 1F *L-GUI
2030
00010A 34             00209         DB              0x34            ; 20 *PG-UP
2031
00010B 63             00210         DB              'c'                     ; 21 cC
2032
00010C 78             00211         DB              'x'                     ; 22 xX
2033
00010D 64             00212         DB              'd'                     ; 23 dD
2034
00010E 65             00213         DB              'e'                     ; 24 eE
2035
00010F 45             00214         DB              0x45            ; 25 4$         IT 4$
2036
000110 46             00215         DB              0x46            ; 26 3#         IT 3 LIRA
2037
000111 1B             00216         DB              0x1B            ; 27 *R-GUI
2038
000112 33             00217         DB              0x33            ; 28 *CSR-UP
2039
000113 14             00218         DB              0x14            ; 29 SPACE
2040
000114 76             00219         DB              'v'                     ; 2A vV
2041
000115 66             00220         DB              'f'                     ; 2B fF
2042
000116 74             00221         DB              't'                     ; 2C tT
2043
000117 72             00222         DB              'r'                     ; 2D rR
2044
000118 47             00223         DB              0x47            ; 2E 5%         IT 5% (EURO)
2045
000119 1D             00224         DB              0x1D            ; 2F *APPS
2046
00011A 2F             00225         DB              0x2F            ; 30 *CSR-LEFT
2047
00011B 6E             00226         DB              'n'                     ; 31 nN
2048
00011C 62             00227         DB              'b'                     ; 32 bB
2049
00011D 68             00228         DB              'h'                     ; 33 hH
2050
00011E 67             00229         DB              'g'                     ; 34 gG
2051
00011F 79             00230         DB              'y'                     ; 35 yY
2052
000120 48             00231         DB              0x48            ; 36 6^         IT 6&
2053
000121 1A             00232         DB              0x1A            ; 37 *PWR
2054
000122 2D             00233         DB              0x2D            ; 38 *CSR-DOWN
2055
000123 31             00234         DB              0x31            ; 39 *CSR-RIGHT
2056
000124 6D             00235         DB              'm'                     ; 3A mM
2057
000125 6A             00236         DB              'j'                     ; 3B jJ
2058
000126 75             00237         DB              'u'                     ; 3C uU
2059
000127 49             00238         DB              0x49            ; 3D 7&         IT 7/
2060
000128 4A             00239         DB              0x4A            ; 3E 8*         IT 8(
2061
000129 19             00240         DB              0x19            ; 3F *SLEEP
2062
00012A 17             00241         DB              SYSCODE         ; 40 *ALT SYSREQ
2063
00012B 4B             00242         DB              0x4B            ; 41 ,<         IT ,:
2064
00012C 6B             00243         DB              'k'                     ; 42 kK
2065
00012D 69             00244         DB              'i'                     ; 43 iI
2066
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 36
2067
 
2068
 
2069
LOC  OBJECT CODE     LINE SOURCE TEXT
2070
  VALUE
2071
 
2072
00012E 6F             00245         DB              'o'                     ; 44 oO
2073
00012F 4C             00246         DB              0x4C            ; 45 0)         IT 0=
2074
000130 4D             00247         DB              0x4D            ; 46 9(         IT 9)
2075
000131 15             00248         DB              0x15            ; 47 *BACKSPACE
2076
000132 16             00249         DB              CBRKCODE        ; 48 *CTRL-BREAK
2077
000133 4E             00250         DB              0x4E            ; 49 .>         IT .:
2078
000134 4F             00251         DB              0x4F            ; 4A /?         IT -_
2079
000135 6C             00252         DB              'l'                     ; 4B lL
2080
000136 50             00253         DB              0x50            ; 4C ;:         IT oc@
2081
000137 70             00254         DB              'p'                     ; 4D pP
2082
000138 51             00255         DB              0x51            ; 4E -_         IT '?
2083
000139 21             00256         DB              0x21            ; 4F *KP 1
2084
00013A 24             00257         DB              0x24            ; 50 *KP 4
2085
00013B 27             00258         DB              0x27            ; 51 *KP 7
2086
00013C 52             00259         DB              0x52            ; 52 '"         IT ao#
2087
00013D 0C             00260         DB              0x0C            ; 53 *IT <>
2088
00013E 53             00261         DB              0x53            ; 54 [{         IT ee[{
2089
00013F 54             00262         DB              0x54            ; 55 =+         IT i^
2090
000140 FF             00263         DB              0xFF            ; 56
2091
000141 FF             00264         DB              0xFF            ; 57
2092
000142 06             00265         DB              CAPSCODE        ; 58 CAPS LOCK
2093
000143 03             00266         DB              0x03            ; 59 R-SHIFT
2094
000144 0A             00267         DB              CRCODE          ; 5A ENTER <*KP ENTER>
2095
000145 55             00268         DB              0x55            ; 5B ]}         IT +*]}
2096
000146 FF             00269         DB              0xFF            ; 5C
2097
000147 56             00270         DB              0x56            ; 5D \|         IT paragrafo u
2098
000148 18             00271         DB              0x18            ; 5E *WAKE
2099
000149 10             00272         DB              KPBARCODE       ; 5F *<KP />
2100
00014A 20             00273         DB              KP0CODE         ; 60 *KP 0
2101
00014B 2A             00274         DB              0x2A            ; 61 *KP .
2102
00014C 22             00275         DB              0x22            ; 62 *KP 2
2103
00014D 25             00276         DB              0x25            ; 63 *KP 5
2104
00014E 26             00277         DB              0x26            ; 64 *KP 6
2105
00014F 28             00278         DB              0x28            ; 65 *KP 8
2106
000150 1F             00279         DB              ESCCODE         ; 66 *ESC
2107
000151 07             00280         DB              0x07            ; 67 *NUM-LOCK
2108
000152 40             00281         DB              0x40            ; 68 *F11
2109
000153 11             00282         DB              0x11            ; 69 *KP +
2110
000154 23             00283         DB              0x23            ; 6A *KP 3
2111
000155 12             00284         DB              0x12            ; 6B *KP -
2112
000156 13             00285         DB              0x13            ; 6C *KP *
2113
000157 29             00286         DB              0x29            ; 6D *KP 9
2114
000158 08             00287         DB              0x08            ; 6E *SCROLL-LOCK
2115
000159 FF             00288         DB              0xFF
2116
                      00289
2117
                      00290 ; tabella flag RptSt per tasti NO REPEAT
2118
00015A                00291 RPTTBL:
2119
00015A 20             00292         DB              WAKEM           ; WAKE UP
2120
00015B 40             00293         DB              SLEEPM          ; SLEEP
2121
00015C 80             00294         DB              PWRM            ; POWER
2122
00015D 08             00295         DB              RGUIM           ; R-GUI
2123
00015E 10             00296         DB              LGUIM           ; L-GUI
2124
00015F 04             00297         DB              GUIAPPM         ; GUI APP
2125
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 37
2126
 
2127
 
2128
LOC  OBJECT CODE     LINE SOURCE TEXT
2129
  VALUE
2130
 
2131
000160 01             00298         DB              PRINTM          ; PRINT SCRN
2132
000161 02             00299         DB              ESCAPEM         ; ESC
2133
                      00300
2134
                      00301 ; tabella conversione codici restituiti da CVTTBL a tasti effettivi
2135
000162                00302 KEYTBL:
2136
                      00303 ; questi indici impostano i flag di CtlSt e ShfSt
2137
                      00304 ; rispecchiano lo stato di pressione/rilascio tasti SHIFT,ALT e CTRL
2138
000162 01             00305         DB              LSHFM                   ; 00 L-SHIFT
2139
000163 02             00306         DB              LCTLM                   ; 01 L-CTRL
2140
000164 04             00307         DB              LALTM                   ; 02 L-ALT
2141
000165 08             00308         DB              RSHFM                   ; 03 R-SHIFT
2142
000166 10             00309         DB              RCTLM                   ; 04 R-CTRL
2143
000167 20             00310         DB              RALTM                   ; 05 R-ALT
2144
                      00311
2145
                      00312 ; questi indici impostano i flag di TglSt
2146
                      00313 ; rispecchiano lo stato dei tasti CAPS-LOCK/NUM-LOCK/SCROLL-LOCK/PAUSE
2147
                      00314 ; NOTA: PAUSE non ha codice di rilascio
2148
000168 80             00315         DB              CAPSM                   ; 06 CAPS-LOCK
2149
000169 40             00316         DB              NUMLM                   ; 07 NUM-LOCK
2150
00016A 20             00317         DB              SCRLM                   ; 08 SCROLL-LOCK
2151
                      00318 ; il tasto PAUSE va trattato come un tasto toggle
2152
00016B 10             00319         DB              PAUSM                   ; 09 PAUSE
2153
                      00320
2154
                      00321 ; i tasti seguenti vanno testati con lo shift
2155
00016C 0D             00322         DB              KB_CR                   ; 0A ENTER
2156
00016D 8D             00323         DB              KB_SHCR                 ; 0B SHIFT ENTER
2157
00016E 3C             00324         DB              '<'                             ; 0C IT <
2158
00016F 3E             00325         DB              '>'                             ; 0D SHIFT IT >
2159
000170 09             00326         DB              KB_TAB                  ; 0E TAB
2160
000171 89             00327         DB              KB_SHTAB                ; 0F SHIFT TAB
2161
                      00328
2162
                      00329 ; questi indici non vanno trattati eccetto ESC/PRINT SCRN
2163
                      00330 ; per il tasto esc va impostato il flag premuto/rilasciato
2164
000172 2F             00331         DB              '/'                             ; 10 KP /
2165
000173 2B             00332         DB              '+'                             ; 11 KP +
2166
000174 2D             00333         DB              '-'                             ; 12 KP -
2167
000175 2A             00334         DB              '*'                             ; 13 KP *
2168
000176 20             00335         DB              ' '                             ; 14 SPACE
2169
000177 90             00336         DB              KB_BACKSPACE    ; 15 BACKSPACE
2170
000178 83             00337         DB              KB_CTRLBREAK    ; 16 CTRL BREAK
2171
000179 84             00338         DB              KB_ALTSYSREQ    ; 17 ALT SYS REQ
2172
00017A 85             00339         DB              KB_WAKE                 ; 18 WAKE
2173
00017B 86             00340         DB              KB_SLEEP                ; 19 SLEEP
2174
00017C 87             00341         DB              KB_PWR                  ; 1A PWR
2175
00017D 80             00342         DB              KB_RIGHTGUI             ; 1B R-GUI
2176
00017E 81             00343         DB              KB_LEFTGUI              ; 1C L-GUI
2177
00017F 82             00344         DB              KB_GUIMENU              ; 1D APPS/MENU
2178
000180 83             00345         DB              KB_PRTSCN               ; 1E PRTSCN/SYSRQ
2179
000181 1B             00346         DB              KB_ESCAPE               ; 1F ESC
2180
                      00347
2181
                      00348 ; tasti numerici vanno trattati specialmente
2182
000182 30             00349         DB              '0'                             ; 20 KP 0
2183
000183 31             00350         DB              '1'                             ; 21 KP 1
2184
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 38
2185
 
2186
 
2187
LOC  OBJECT CODE     LINE SOURCE TEXT
2188
  VALUE
2189
 
2190
000184 32             00351         DB              '2'                             ; 22 KP 2
2191
000185 33             00352         DB              '3'                             ; 23 KP 3
2192
000186 34             00353         DB              '4'                             ; 24 KP 4
2193
000187 35             00354         DB              '5'                             ; 25 KP 5
2194
000188 36             00355         DB              '6'                             ; 26 KP 6
2195
000189 37             00356         DB              '7'                             ; 27 KP 7
2196
00018A 38             00357         DB              '8'                             ; 28 KP 8
2197
00018B 39             00358         DB              '9'                             ; 29 KP 9
2198
00018C 2E             00359         DB              '.'                             ; 2A KP .
2199
                      00360
2200
                      00361 ; tasti cursore: INSERT va trattato specialmente (toggle bit)
2201
00018D 86             00362         DB              KB_INSERT               ; 2B INS
2202
00018E 8C             00363         DB              KB_END                  ; 2C END
2203
00018F 8B             00364         DB              KB_CSRDOWN              ; 2D CSR DOWN
2204
000190 8A             00365         DB              KB_PGDOWN               ; 2E PG DOWN
2205
000191 8F             00366         DB              KB_CSRLEFT              ; 2F CSR LEFT
2206
000192 00             00367         DB              0x00                    ; 30 - TASTO NULL
2207
000193 87             00368         DB              KB_CSRRIGHT             ; 31 CSR RIGHT
2208
000194 85             00369         DB              KB_HOME                 ; 32 HOME
2209
000195 84             00370         DB              KB_CSRUP                ; 33 CSR UP
2210
000196 88             00371         DB              KB_PGUP                 ; 34 PG UP
2211
000197 8E             00372         DB              KB_DELETE               ; 35 DEL
2212
                      00373
2213
                      00374 ; tasti funzione
2214
000198 A0             00375         DB              KB_F1                   ; 36 F1
2215
000199 A1             00376         DB              KB_F2                   ; 37 F2
2216
00019A A2             00377         DB              KB_F3                   ; 38 F3
2217
00019B A3             00378         DB              KB_F4                   ; 39 F4
2218
00019C A4             00379         DB              KB_F5                   ; 3A F5
2219
00019D A5             00380         DB              KB_F6                   ; 3B F6
2220
00019E A6             00381         DB              KB_F7                   ; 3C F7
2221
00019F A7             00382         DB              KB_F8                   ; 3D F8
2222
0001A0 A8             00383         DB              KB_F9                   ; 3E F9
2223
0001A1 A9             00384         DB              KB_F10                  ; 3F F10
2224
0001A2 AA             00385         DB              KB_F11                  ; 40 F11
2225
0001A3 AB             00386         DB              KB_F12                  ; 41 F12
2226
                      00387
2227
                      00388 ; tabella flag codice corrispondente a KEYTBL
2228
                      00389 ; 0x00 -> codice ASCII
2229
                      00390 ; 0x10 -> codice ASCII + flag toggle 4 bit low
2230
                      00391 ; 0x80 -> invia status shift/alt/ctrl
2231
                      00392 ; 0x90 -> invia status toggle
2232
                      00393 ; 0xA0 -> codice di controllo
2233
                      00394 ; 0xB0 -> codice di controllo + flag toggle 4 bit low
2234
                      00395 ; 0xC0 -> codice tasto NMI
2235
0001A4                00396 FLGTBL:
2236
                      00397         ; questi valori non sono usati - il tasto viene trattato a parte
2237
0001A4 80             00398         DB              0x80                    ; 00 L-SHIFT
2238
0001A5 80             00399         DB              0x80                    ; 01 L-CTRL
2239
0001A6 80             00400         DB              0x80                    ; 02 L-ALT
2240
0001A7 80             00401         DB              0x80                    ; 03 R-SHIFT
2241
0001A8 80             00402         DB              0x80                    ; 04 R-CTRL
2242
0001A9 80             00403         DB              0x80                    ; 05 R-ALT
2243
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 39
2244
 
2245
 
2246
LOC  OBJECT CODE     LINE SOURCE TEXT
2247
  VALUE
2248
 
2249
0001AA 90             00404         DB              0x90                    ; 06 CAPS-LOCK
2250
0001AB 90             00405         DB              0x90                    ; 07 NUM-LOCK
2251
0001AC 90             00406         DB              0x90                    ; 08 SCROLL-LOCK
2252
0001AD 90             00407         DB              0x90                    ; 09 PAUSE
2253
0001AE 00             00408         DB              0x00                    ; 0A ENTER
2254
0001AF A0             00409         DB              0xA0                    ; 0B SHIFT ENTER
2255
0001B0 00             00410         DB              0x00                    ; 0C IT <
2256
0001B1 00             00411         DB              0x00                    ; 0D SHIFT IT >
2257
0001B2 00             00412         DB              0x00                    ; 0E TAB
2258
0001B3 A0             00413         DB              0xA0                    ; 0F SHIFT TAB
2259
0001B4 00             00414         DB              0x00                    ; 10 KP /
2260
0001B5 00             00415         DB              0x00                    ; 11 KP +
2261
0001B6 00             00416         DB              0x00                    ; 12 KP -
2262
0001B7 00             00417         DB              0x00                    ; 13 KP *
2263
0001B8 00             00418         DB              0x00                    ; 14 SPACE
2264
0001B9 A0             00419         DB              0xA0                    ; 15 BACKSPACE
2265
0001BA C0             00420         DB              0xC0                    ; 16 CTRL BREAK
2266
0001BB C0             00421         DB              0xC0                    ; 17 ALT SYS REQ
2267
0001BC C0             00422         DB              0xC0                    ; 18 WAKE
2268
0001BD C0             00423         DB              0xC0                    ; 19 SLEEP
2269
0001BE C0             00424         DB              0xC0                    ; 1A PWR
2270
0001BF A0             00425         DB              0xA0                    ; 1B R-GUI
2271
0001C0 A0             00426         DB              0xA0                    ; 1C L-GUI
2272
0001C1 A0             00427         DB              0xA0                    ; 1D APPS/MENU
2273
0001C2 B0             00428         DB              0xB0                    ; 1E PRTSCN/SYSRQ
2274
0001C3 10             00429         DB              0x10                    ; 1F ESC
2275
0001C4 00             00430         DB              0x00                    ; 20 KP 0
2276
0001C5 00             00431         DB              0x00                    ; 21 KP 1
2277
0001C6 00             00432         DB              0x00                    ; 22 KP 2
2278
0001C7 00             00433         DB              0x00                    ; 23 KP 3
2279
0001C8 00             00434         DB              0x00                    ; 24 KP 4
2280
0001C9 00             00435         DB              0x00                    ; 25 KP 5
2281
0001CA 00             00436         DB              0x00                    ; 26 KP 6
2282
0001CB 00             00437         DB              0x00                    ; 27 KP 7
2283
0001CC 00             00438         DB              0x00                    ; 28 KP 8
2284
0001CD 00             00439         DB              0x00                    ; 29 KP 9
2285
0001CE 00             00440         DB              0x00                    ; 2A KP .
2286
0001CF B0             00441         DB              0xB0                    ; 2B INS
2287
0001D0 A0             00442         DB              0xA0                    ; 2C END
2288
0001D1 A0             00443         DB              0xA0                    ; 2D CSR DOWN
2289
0001D2 A0             00444         DB              0xA0                    ; 2E PG DOWN
2290
0001D3 A0             00445         DB              0xA0                    ; 2F CSR LEFT
2291
0001D4 A0             00446         DB              0xA0                    ; 30 - TASTO NULL
2292
0001D5 A0             00447         DB              0xA0                    ; 31 CSR RIGHT
2293
0001D6 A0             00448         DB              0xA0                    ; 32 HOME
2294
0001D7 A0             00449         DB              0xA0                    ; 33 CSR UP
2295
0001D8 A0             00450         DB              0xA0                    ; 34 PG UP
2296
0001D9 A0             00451         DB              0xA0                    ; 35 DEL
2297
0001DA A0             00452         DB              0xA0                    ; 36 F1
2298
0001DB A0             00453         DB              0xA0                    ; 37 F2
2299
0001DC A0             00454         DB              0xA0                    ; 38 F3
2300
0001DD A0             00455         DB              0xA0                    ; 39 F4
2301
0001DE A0             00456         DB              0xA0                    ; 3A F5
2302
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 40
2303
 
2304
 
2305
LOC  OBJECT CODE     LINE SOURCE TEXT
2306
  VALUE
2307
 
2308
0001DF A0             00457         DB              0xA0                    ; 3B F6
2309
0001E0 A0             00458         DB              0xA0                    ; 3C F7
2310
0001E1 A0             00459         DB              0xA0                    ; 3D F8
2311
0001E2 A0             00460         DB              0xA0                    ; 3E F9
2312
0001E3 A0             00461         DB              0xA0                    ; 3F F10
2313
0001E4 A0             00462         DB              0xA0                    ; 40 F11
2314
0001E5 A0             00463         DB              0xA0                    ; 41 F12
2315
                      00464
2316
                      01509
2317
                      01510         end
2318
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 41
2319
 
2320
 
2321
SYMBOL TABLE
2322
  LABEL                             VALUE
2323
 
2324
A                                 00000000
2325
AALTB                             00000007
2326
AALTM                             00000080
2327
ABDEN                             00000000
2328
ABDOVF                            00000007
2329
ACCESS                            00000000
2330
ACKDT                             00000005
2331
ACKEN                             00000004
2332
ACKSTAT                           00000006
2333
ACQT0                             00000003
2334
ACQT1                             00000004
2335
ACQT2                             00000005
2336
ACTLB                             00000006
2337
ACTLM                             00000040
2338
ADCON0                            00000FC2
2339
ADCON1                            00000FC1
2340
ADCON2                            00000FC0
2341
ADCS0                             00000000
2342
ADCS1                             00000001
2343
ADCS2                             00000002
2344
ADDEN                             00000003
2345
ADEN                              00000003
2346
ADFM                              00000007
2347
ADIE                              00000006
2348
ADIF                              00000006
2349
ADIP                              00000006
2350
ADMSK1                            00000001
2351
ADMSK2                            00000002
2352
ADMSK3                            00000003
2353
ADMSK4                            00000004
2354
ADMSK5                            00000005
2355
ADON                              00000000
2356
ADRES                             00000FC3
2357
ADRESH                            00000FC4
2358
ADRESL                            00000FC3
2359
ALLALTCTLM                        000000C0
2360
ALTCTLB                           00000006
2361
ALTCTLKEY0                        00000050
2362
ALTCTLM                           00000040
2363
ALTKEY0                           00000030
2364
ALTKM                             00000024
2365
AN0                               00000000
2366
AN1                               00000001
2367
AN10                              00000001
2368
AN11                              00000004
2369
AN12                              00000000
2370
AN2                               00000002
2371
AN3                               00000003
2372
AN4                               00000005
2373
AN5                               00000000
2374
AN6                               00000001
2375
AN7                               00000002
2376
AN8                               00000002
2377
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 42
2378
 
2379
 
2380
SYMBOL TABLE
2381
  LABEL                             VALUE
2382
 
2383
AN9                               00000003
2384
ASHFB                             00000007
2385
ASHFM                             00000080
2386
BANKED                            00000001
2387
BAUDCON                           00000FB8
2388
BAUDCTL                           00000FB8
2389
BCLIE                             00000003
2390
BCLIF                             00000003
2391
BCLIP                             00000003
2392
BF                                00000000
2393
BGST                              00000005
2394
BOR                               00000000
2395
BRG16                             00000003
2396
BRGH                              00000002
2397
BSR                               00000FE0
2398
C                                 00000000
2399
C1INV                             00000004
2400
C1OUT_CMCON                       00000006
2401
C1OUT_PORTA                       00000004
2402
C2INV                             00000005
2403
C2OUT_CMCON                       00000007
2404
C2OUT_PORTA                       00000005
2405
CAPSB                             00000007
2406
CAPSCODE                          00000006
2407
CAPSM                             00000080
2408
CBRKCODE                          00000016
2409
CCP1                              00000002
2410
CCP1CON                           00000FBD
2411
CCP1IE                            00000002
2412
CCP1IF                            00000002
2413
CCP1IP                            00000002
2414
CCP1M0                            00000000
2415
CCP1M1                            00000001
2416
CCP1M2                            00000002
2417
CCP1M3                            00000003
2418
CCP1X                             00000005
2419
CCP1Y                             00000004
2420
CCP2CON                           00000FBA
2421
CCP2IE                            00000000
2422
CCP2IF                            00000000
2423
CCP2IP                            00000000
2424
CCP2M0                            00000000
2425
CCP2M1                            00000001
2426
CCP2M2                            00000002
2427
CCP2M3                            00000003
2428
CCP2X                             00000005
2429
CCP2Y                             00000004
2430
CCP2_PORTB                        00000003
2431
CCP2_PORTC                        00000001
2432
CCPR1                             00000FBE
2433
CCPR1H                            00000FBF
2434
CCPR1L                            00000FBE
2435
CCPR2                             00000FBB
2436
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 43
2437
 
2438
 
2439
SYMBOL TABLE
2440
  LABEL                             VALUE
2441
 
2442
CCPR2H                            00000FBC
2443
CCPR2L                            00000FBB
2444
CFGS                              00000006
2445
CHS0                              00000002
2446
CHS1                              00000003
2447
CHS2                              00000004
2448
CHS3                              00000005
2449
CIS                               00000003
2450
CK                                00000006
2451
CKE                               00000006
2452
CKP                               00000004
2453
CLKI                              00000007
2454
CLKO                              00000006
2455
CM0                               00000000
2456
CM1                               00000001
2457
CM2                               00000002
2458
CMCON                             00000FB4
2459
CMIE                              00000006
2460
CMIF                              00000006
2461
CMIP                              00000006
2462
CNTMSTMR0                         (0x10000 - ((count * D'625')) / D'32')
2463
CNTTMR0                           (0x10000 - ((count * D'1250')))
2464
CNTUSTMR0                         (0x10000 - (count * 5))
2465
CRCODE                            0000000A
2466
CREN                              00000004
2467
CRSLEN                            0000000B
2468
CS                                00000002
2469
CSRC                              00000007
2470
CTLKEY0                           00000040
2471
CTRLKM                            00000012
2472
CVR0                              00000000
2473
CVR1                              00000001
2474
CVR2                              00000002
2475
CVR3                              00000003
2476
CVRCON                            00000FB5
2477
CVREF                             00000002
2478
CVREN                             00000007
2479
CVROE                             00000006
2480
CVRR                              00000005
2481
CVRSS                             00000004
2482
CVTTBL                            000000EA
2483
Caps                              0000002C
2484
ClrRX                             00000400
2485
Cmd0                              000008B6
2486
Cmd1                              000008C0
2487
Cmd2                              000008EA
2488
CmdEnd                            000008F6
2489
CmdRsp                            000008EC
2490
CtlSt                             00000022
2491
D                                 00000005
2492
DC                                00000001
2493
DC1B0                             00000004
2494
DC1B1                             00000005
2495
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 44
2496
 
2497
 
2498
SYMBOL TABLE
2499
  LABEL                             VALUE
2500
 
2501
DC2B0                             00000004
2502
DC2B1                             00000005
2503
DDRA                              TRISA
2504
DDRB                              TRISB
2505
DDRC                              TRISC
2506
DDRD                              TRISD
2507
DDRE                              TRISE
2508
DEFRLTBL                          000000E3
2509
DEFTBL                            000000DB
2510
DONE                              00000001
2511
D_A                               00000005
2512
D_NOT_A                           00000005
2513
Delay_ms                          00000376
2514
Delay_us                          0000037A
2515
Delay_xx                          0000037C
2516
Delay_xx1                         0000038A
2517
E1Cnt                             0000000A
2518
E1PtrH                            00000009
2519
E1PtrL                            00000008
2520
E1SEQCNT                          00000007
2521
E1Test                            000003FC
2522
ECCP1AS                           00000FB6
2523
ECCP1DEL                          00000FB7
2524
ECCPAS                            00000FB6
2525
ECCPAS0                           00000004
2526
ECCPAS1                           00000005
2527
ECCPAS2                           00000006
2528
ECCPASE                           00000007
2529
EEADR                             00000FA9
2530
EECON1                            00000FA6
2531
EECON2                            00000FA7
2532
EEDATA                            00000FA8
2533
EEIE                              00000004
2534
EEIF                              00000004
2535
EEIP                              00000004
2536
EEPGD                             00000007
2537
ESCAPEM                           00000002
2538
ESCB                              00000001
2539
ESCCODE                           0000001F
2540
ESCM                              00000002
2541
ESCPRNM                           00000003
2542
EXT1TBL                           000000A7
2543
EXTRLTBL                          000000C5
2544
EXTTBL                            000000AE
2545
FAST                              00000001
2546
FERR                              00000002
2547
FLGTBL                            000001A4
2548
FLT0                              00000000
2549
FLTS                              00000002
2550
FNCCODE                           00000036
2551
FREE                              00000004
2552
FSR0                              00000000
2553
FSR0H                             00000FEA
2554
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 45
2555
 
2556
 
2557
SYMBOL TABLE
2558
  LABEL                             VALUE
2559
 
2560
FSR0L                             00000FE9
2561
FSR1                              00000001
2562
FSR1H                             00000FE2
2563
FSR1L                             00000FE1
2564
FSR2                              00000002
2565
FSR2H                             00000FDA
2566
FSR2L                             00000FD9
2567
FnAdd                             00000714
2568
FnNoShf                           00000700
2569
GCEN                              00000007
2570
GIE                               00000007
2571
GIEH                              00000007
2572
GIEL                              00000006
2573
GIE_GIEH                          00000007
2574
GO                                00000001
2575
GO_DONE                           00000001
2576
GO_NOT_DONE                       00000001
2577
GUIAPPM                           00000004
2578
GetKbd                            0000018C
2579
GetKbd10                          000001A2
2580
GetKeyTbl                         00000844
2581
GetLine                           000000D8
2582
GetLine1                          000000FC
2583
GetLine2                          00000102
2584
HDRQIN                            00000001
2585
HLINT                             00000000
2586
HLNMI                             00000001
2587
HLVDCON                           00000FD2
2588
HLVDEN                            00000004
2589
HLVDIE                            00000002
2590
HLVDIF                            00000002
2591
HLVDIN                            00000005
2592
HLVDIP                            00000002
2593
HLVDL0                            00000000
2594
HLVDL1                            00000001
2595
HLVDL2                            00000002
2596
HLVDL3                            00000003
2597
IBF                               00000007
2598
IBOV                              00000005
2599
IDLEN                             00000007
2600
INDF0                             00000FEF
2601
INDF1                             00000FE7
2602
INDF2                             00000FDF
2603
INSCODE                           0000002B
2604
INSTB                             00000002
2605
INSTM                             00000004
2606
INT0                              00000000
2607
INT0E                             00000004
2608
INT0F                             00000001
2609
INT0IE                            00000004
2610
INT0IF                            00000001
2611
INT1                              00000001
2612
INT1E                             00000003
2613
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 46
2614
 
2615
 
2616
SYMBOL TABLE
2617
  LABEL                             VALUE
2618
 
2619
INT1F                             00000000
2620
INT1IE                            00000003
2621
INT1IF                            00000000
2622
INT1IP                            00000006
2623
INT1P                             00000006
2624
INT2                              00000002
2625
INT2E                             00000004
2626
INT2F                             00000001
2627
INT2IE                            00000004
2628
INT2IF                            00000001
2629
INT2IP                            00000007
2630
INT2P                             00000007
2631
INTCON                            00000FF2
2632
INTCON2                           00000FF1
2633
INTCON3                           00000FF0
2634
INTEDG0                           00000006
2635
INTEDG1                           00000005
2636
INTEDG2                           00000004
2637
INTSRC                            00000007
2638
IOFS                              00000002
2639
IPEN                              00000007
2640
IPR1                              00000F9F
2641
IPR2                              00000FA2
2642
IRCF0                             00000004
2643
IRCF1                             00000005
2644
IRCF2                             00000006
2645
IRVST                             00000005
2646
ITMap                             00000532
2647
IVRST                             00000005
2648
Init1                             00000214
2649
Init10                            00000320
2650
Init2                             0000025C
2651
Init3                             00000296
2652
Init4                             00000298
2653
Init6                             000002D8
2654
Init61                            000002EC
2655
Init62                            00000300
2656
Init63                            00000314
2657
InitData                          00000338
2658
InitData1                         0000033E
2659
InitData2                         0000034E
2660
InitIO                            000001D6
2661
KBACK                             00000004
2662
KBBAT                             00000006
2663
KBBAT2                            00000004
2664
KBD_ACK                           000000FA
2665
KBD_BAT                           000000AA
2666
KBD_BRK                           000000F0
2667
KBD_DEFRATE                       0000000B
2668
KBD_DEFRATE2                      00000037
2669
KBD_ECHO                          000000EE
2670
KBD_ENABLE                        000000F4
2671
KBD_EXT                           000000E0
2672
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 47
2673
 
2674
 
2675
SYMBOL TABLE
2676
  LABEL                             VALUE
2677
 
2678
KBD_EXT1                          000000E1
2679
KBD_GETID                         000000F2
2680
KBD_IDH                           00000083
2681
KBD_IDL                           000000AB
2682
KBD_NOBAT                         000000FC
2683
KBD_RESEND                        000000FE
2684
KBD_RESET                         000000FF
2685
KBD_SETLED                        000000ED
2686
KBD_SETSC                         000000F0
2687
KBD_TYPERATE                      000000F3
2688
KBENABLE                          00000002
2689
KBFND                             00000007
2690
KBI0                              00000004
2691
KBI1                              00000005
2692
KBI2                              00000006
2693
KBI3                              00000007
2694
KBLEDOK                           00000000
2695
KBNOBAT                           00000007
2696
KBRATE                            00000003
2697
KBRX                              00000007
2698
KBRXERR                           0000000C
2699
KBSCOK                            00000001
2700
KBTX                              00000006
2701
KBVID                             00000005
2702
KBVOFF                            00000006
2703
KBVON                             00000007
2704
KB_ALTBKS                         0000001C
2705
KB_ALTCTLBKS                      00000082
2706
KB_ALTCTLDEL                      00000081
2707
KB_ALTCTLEND                      00000080
2708
KB_ALTCTLESC                      00000088
2709
KB_ALTCTLHOME                     00000008
2710
KB_ALTCTLINS                      0000000C
2711
KB_ALTCTLMINUS                    00000028
2712
KB_ALTCTLPGDWN                    00000014
2713
KB_ALTCTLPGUP                     00000010
2714
KB_ALTCTLPLUS                     00000025
2715
KB_ALTCTLPRT                      00000004
2716
KB_ALTCTLTAB                      00000022
2717
KB_ALTDEL                         00000019
2718
KB_ALTEND                         00000016
2719
KB_ALTESC                         0000001E
2720
KB_ALTHOME                        00000006
2721
KB_ALTINS                         0000000A
2722
KB_ALTMINUS                       00000026
2723
KB_ALTPGDWN                       00000012
2724
KB_ALTPGUP                        0000000E
2725
KB_ALTPLUS                        00000023
2726
KB_ALTPRT                         00000002
2727
KB_ALTSYSREQ                      00000084
2728
KB_ALTTAB                         00000020
2729
KB_BACKSPACE                      00000090
2730
KB_CR                             0000000D
2731
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 48
2732
 
2733
 
2734
SYMBOL TABLE
2735
  LABEL                             VALUE
2736
 
2737
KB_CSRDOWN                        0000008B
2738
KB_CSRLEFT                        0000008F
2739
KB_CSRRIGHT                       00000087
2740
KB_CSRUP                          00000084
2741
KB_CTLBKS                         0000001D
2742
KB_CTLDEL                         0000001A
2743
KB_CTLEND                         00000017
2744
KB_CTLESC                         0000001F
2745
KB_CTLHOME                        00000007
2746
KB_CTLINS                         0000000B
2747
KB_CTLMINUS                       00000027
2748
KB_CTLPGDWN                       00000013
2749
KB_CTLPGUP                        0000000F
2750
KB_CTLPLUS                        00000024
2751
KB_CTLPRT                         00000003
2752
KB_CTLTAB                         00000021
2753
KB_CTRLBREAK                      00000083
2754
KB_DELETE                         0000008E
2755
KB_END                            0000008C
2756
KB_ESCAPE                         0000001B
2757
KB_F1                             000000A0
2758
KB_F10                            000000A9
2759
KB_F11                            000000AA
2760
KB_F12                            000000AB
2761
KB_F2                             000000A1
2762
KB_F3                             000000A2
2763
KB_F4                             000000A3
2764
KB_F5                             000000A4
2765
KB_F6                             000000A5
2766
KB_F7                             000000A6
2767
KB_F8                             000000A7
2768
KB_F9                             000000A8
2769
KB_GUIMENU                        00000082
2770
KB_HOME                           00000085
2771
KB_INSERT                         00000086
2772
KB_LEFTGUI                        00000081
2773
KB_PGDOWN                         0000008A
2774
KB_PGUP                           00000088
2775
KB_PRTSCN                         00000083
2776
KB_PWR                            00000087
2777
KB_RIGHTGUI                       00000080
2778
KB_SHCR                           0000008D
2779
KB_SHIFTBKS                       0000001B
2780
KB_SHIFTDEL                       00000018
2781
KB_SHIFTEND                       00000015
2782
KB_SHIFTHOME                      00000005
2783
KB_SHIFTINS                       00000009
2784
KB_SHIFTPGDWN                     00000011
2785
KB_SHIFTPGUP                      0000000D
2786
KB_SHIFTPRT                       00000001
2787
KB_SHTAB                          00000089
2788
KB_SLEEP                          00000086
2789
KB_TAB                            00000009
2790
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 49
2791
 
2792
 
2793
SYMBOL TABLE
2794
  LABEL                             VALUE
2795
 
2796
KB_WAKE                           00000085
2797
KBuf                              0000001B
2798
KCLKIN                            00000003
2799
KCLKO                             00000004
2800
KCnt                              00000018
2801
KDATAIN                           00000000
2802
KDATAO                            00000005
2803
KEYCTL                            00000007
2804
KEYCTL2                           00000005
2805
KEYRLS                            00000006
2806
KEYTBL                            00000162
2807
KEYTGL                            00000004
2808
KFRFULL                           00000007
2809
KFRFlag                           00000002
2810
KFRRD                             00000000
2811
KFRRd0                            00000004
2812
KFRRd1                            00000005
2813
KFRRd2                            00000006
2814
KFRRd3                            00000007
2815
KFRRdCnt                          00000003
2816
KFRRead                           00000880
2817
KFRRead1                          0000088C
2818
KFRRead2                          00000892
2819
KFRSRP                            00000003
2820
KFRSSI                            00000005
2821
KFRSSN                            00000004
2822
KFRWE                             00000001
2823
KFRWrite                          0000086E
2824
KNoBAT                            0000028E
2825
KP0CODE                           00000020
2826
KPARY                             00000002
2827
KPBARCODE                         00000010
2828
KPar                              00000019
2829
KRESET                            00000000
2830
KSTOP                             00000003
2831
KStatus                           0000001A
2832
KTIMEO                            00000001
2833
KbVerf                            00000394
2834
KbVerf2                           000003C6
2835
KbdFlag                           0000001D
2836
KbdFlag2                          0000001E
2837
KbdIDH                            00000001
2838
KbdIDL                            00000000
2839
KbdInt                            00000000
2840
KbdInt10                          00000020
2841
KbdInt11                          00000046
2842
KbdInt12                          00000056
2843
KbdInt20                          00000072
2844
KbdInt99                          00000052
2845
KbdProc                           000003C8
2846
KbdProc0                          000003D4
2847
KbdProc1                          0000041C
2848
KbdProc10                         000004C0
2849
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 50
2850
 
2851
 
2852
SYMBOL TABLE
2853
  LABEL                             VALUE
2854
 
2855
KbdProc12                         00000586
2856
KbdProc13                         000005DC
2857
KbdProc14                         0000062C
2858
KbdProc15                         0000066A
2859
KbdProc16                         00000670
2860
KbdProc18                         0000068E
2861
KbdProc2                          00000426
2862
KbdProc20                         0000069A
2863
KbdProc21                         000006AA
2864
KbdProc22                         000006B0
2865
KbdProc23                         000006BC
2866
KbdProc24                         000006C2
2867
KbdProc25                         000006D8
2868
KbdProc26                         000006E0
2869
KbdProc3                          00000434
2870
KbdProc4                          0000044E
2871
KbdProc40                         00000718
2872
KbdProc41                         0000071A
2873
KbdProc42                         0000073A
2874
KbdProc43                         00000748
2875
KbdProc5                          0000045C
2876
KbdProc50                         00000758
2877
KbdProc6                          00000480
2878
KbdProc60                         00000826
2879
KbdProc61                         00000828
2880
KbdProc7                          0000048A
2881
KbdProc8                          000004AE
2882
Key01                             00000776
2883
Key02                             0000077C
2884
Key06                             00000786
2885
Key10                             0000079E
2886
Key11                             000007B0
2887
Key12                             000007CE
2888
Key13                             000007D8
2889
Key15                             000007DE
2890
KeySnd                            00000816
2891
LALTB                             00000002
2892
LALTM                             00000004
2893
LATA                              00000F89
2894
LATA0                             00000000
2895
LATA1                             00000001
2896
LATA2                             00000002
2897
LATA3                             00000003
2898
LATA4                             00000004
2899
LATA5                             00000005
2900
LATA6                             00000006
2901
LATA7                             00000007
2902
LATB                              00000F8A
2903
LATB0                             00000000
2904
LATB1                             00000001
2905
LATB2                             00000002
2906
LATB3                             00000003
2907
LATB4                             00000004
2908
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 51
2909
 
2910
 
2911
SYMBOL TABLE
2912
  LABEL                             VALUE
2913
 
2914
LATB5                             00000005
2915
LATB6                             00000006
2916
LATB7                             00000007
2917
LATC                              00000F8B
2918
LATC0                             00000000
2919
LATC1                             00000001
2920
LATC2                             00000002
2921
LATC3                             00000003
2922
LATC4                             00000004
2923
LATC5                             00000005
2924
LATC6                             00000006
2925
LATC7                             00000007
2926
LATD                              00000F8C
2927
LATD0                             00000000
2928
LATD1                             00000001
2929
LATD2                             00000002
2930
LATD3                             00000003
2931
LATD4                             00000004
2932
LATD5                             00000005
2933
LATD6                             00000006
2934
LATD7                             00000007
2935
LATE                              00000F8D
2936
LATE0                             00000000
2937
LATE1                             00000001
2938
LATE2                             00000002
2939
LCTLB                             00000001
2940
LCTLM                             00000002
2941
LGUIM                             00000010
2942
LSHFB                             00000000
2943
LSHFM                             00000001
2944
LVDCON                            00000FD2
2945
LVDEN                             00000004
2946
LVDIE                             00000002
2947
LVDIF                             00000002
2948
LVDIN                             00000005
2949
LVDIP                             00000002
2950
LVDL0                             00000000
2951
LVDL1                             00000001
2952
LVDL2                             00000002
2953
LVDL3                             00000003
2954
LVV0                              00000000
2955
LVV1                              00000001
2956
LVV2                              00000002
2957
LVV3                              00000003
2958
LedSt                             00000026
2959
LedUpd                            00000662
2960
LockSt                            00000025
2961
MAPALPHA                          00000006
2962
MAPCODE                           00000042
2963
MAPCODEMAX                        00000056
2964
MAPITB                            00000007
2965
MCLR                              00000003
2966
MKeyTst                           000004FC
2967
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 52
2968
 
2969
 
2970
SYMBOL TABLE
2971
  LABEL                             VALUE
2972
 
2973
Main                              00000994
2974
Main2                             000009A0
2975
MapCfg                            0000002B
2976
MapTst                            0000050C
2977
N                                 00000004
2978
NKeyRls                           0000056C
2979
NKeySet                           00000566
2980
NKeyTst                           0000053A
2981
NMISnd                            00000834
2982
NMITst                            00000570
2983
NMITst1                           00000578
2984
NOT_A                             00000005
2985
NOT_ADDRESS                       00000005
2986
NOT_BOR                           00000000
2987
NOT_CS                            00000002
2988
NOT_DONE                          00000001
2989
NOT_MCLR                          00000003
2990
NOT_PD                            00000002
2991
NOT_POR                           00000001
2992
NOT_RBPU                          00000007
2993
NOT_RD                            00000000
2994
NOT_RI                            00000004
2995
NOT_SS                            00000005
2996
NOT_T1SYNC                        00000002
2997
NOT_T3SYNC                        00000002
2998
NOT_TO                            00000003
2999
NOT_W                             00000002
3000
NOT_WR                            00000001
3001
NOT_WRITE                         00000002
3002
NUMLB                             00000006
3003
NUMLM                             00000040
3004
NVCODE                            00000060
3005
NoPause                           00000644
3006
OBF                               00000006
3007
OERR                              00000001
3008
OSC1                              00000007
3009
OSC2                              00000006
3010
OSCCON                            00000FD3
3011
OSCFIE                            00000007
3012
OSCFIF                            00000007
3013
OSCFIP                            00000007
3014
OSCTUNE                           00000F9B
3015
OSTS                              00000003
3016
OV                                00000003
3017
P                                 00000004
3018
P1A                               00000002
3019
P1B                               00000005
3020
P1C                               00000006
3021
P1D                               00000007
3022
P1M0                              00000006
3023
P1M1                              00000007
3024
PAUSB                             00000004
3025
PAUSECODE                         00000009
3026
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 53
3027
 
3028
 
3029
SYMBOL TABLE
3030
  LABEL                             VALUE
3031
 
3032
PAUSM                             00000010
3033
PC                                00000FF9
3034
PCFG0                             00000000
3035
PCFG1                             00000001
3036
PCFG2                             00000002
3037
PCFG3                             00000003
3038
PCL                               00000FF9
3039
PCLATH                            00000FFA
3040
PCLATU                            00000FFB
3041
PD                                00000002
3042
PDC0                              00000000
3043
PDC1                              00000001
3044
PDC2                              00000002
3045
PDC3                              00000003
3046
PDC4                              00000004
3047
PDC5                              00000005
3048
PDC6                              00000006
3049
PEIE                              00000006
3050
PEIE_GIEL                         00000006
3051
PEN                               00000002
3052
PGC                               00000006
3053
PGD                               00000007
3054
PGM                               00000005
3055
PIE1                              00000F9D
3056
PIE2                              00000FA0
3057
PIR1                              00000F9E
3058
PIR2                              00000FA1
3059
PLLEN                             00000006
3060
PLUSW0                            00000FEB
3061
PLUSW1                            00000FE3
3062
PLUSW2                            00000FDB
3063
POR                               00000001
3064
PORTA                             00000F80
3065
PORTB                             00000F81
3066
PORTC                             00000F82
3067
PORTD                             00000F83
3068
PORTE                             00000F84
3069
POSTDEC0                          00000FED
3070
POSTDEC1                          00000FE5
3071
POSTDEC2                          00000FDD
3072
POSTINC0                          00000FEE
3073
POSTINC1                          00000FE6
3074
POSTINC2                          00000FDE
3075
PR2                               00000FCB
3076
PREINC0                           00000FEC
3077
PREINC1                           00000FE4
3078
PREINC2                           00000FDC
3079
PRINTM                            00000001
3080
PRNSCB                            00000000
3081
PRNSCM                            00000001
3082
PROD                              00000FF3
3083
PRODH                             00000FF4
3084
PRODL                             00000FF3
3085
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 54
3086
 
3087
 
3088
SYMBOL TABLE
3089
  LABEL                             VALUE
3090
 
3091
PRSEN                             00000007
3092
PRTCODE                           0000001E
3093
PSA                               00000003
3094
PSP0                              00000000
3095
PSP1                              00000001
3096
PSP2                              00000002
3097
PSP3                              00000003
3098
PSP4                              00000004
3099
PSP5                              00000005
3100
PSP6                              00000006
3101
PSP7                              00000007
3102
PSPIE                             00000007
3103
PSPIF                             00000007
3104
PSPIP                             00000007
3105
PSPMODE                           00000004
3106
PSSAC0                            00000002
3107
PSSAC1                            00000003
3108
PSSBD0                            00000000
3109
PSSBD1                            00000001
3110
PWM1CON                           00000FB7
3111
PWRM                              00000080
3112
PauseKey                          00000414
3113
PutKey                            000005F4
3114
R                                 00000002
3115
RA0                               00000000
3116
RA1                               00000001
3117
RA2                               00000002
3118
RA3                               00000003
3119
RA4                               00000004
3120
RA5                               00000005
3121
RA6                               00000006
3122
RA7                               00000007
3123
RALTB                             00000005
3124
RALTM                             00000020
3125
RB0                               00000000
3126
RB1                               00000001
3127
RB2                               00000002
3128
RB3                               00000003
3129
RB4                               00000004
3130
RB5                               00000005
3131
RB6                               00000006
3132
RB7                               00000007
3133
RBIE                              00000003
3134
RBIF                              00000000
3135
RBIP                              00000000
3136
RBMASK                            0000000D
3137
RBPU                              00000007
3138
RC0                               00000000
3139
RC1                               00000001
3140
RC2                               00000002
3141
RC3                               00000003
3142
RC4                               00000004
3143
RC5                               00000005
3144
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 55
3145
 
3146
 
3147
SYMBOL TABLE
3148
  LABEL                             VALUE
3149
 
3150
RC6                               00000006
3151
RC7                               00000007
3152
RCEN                              00000003
3153
RCIDL                             00000006
3154
RCIE                              00000005
3155
RCIF                              00000005
3156
RCIP                              00000005
3157
RCMT                              00000006
3158
RCON                              00000FD0
3159
RCREG                             00000FAE
3160
RCSTA                             00000FAB
3161
RCTLB                             00000004
3162
RCTLM                             00000010
3163
RD                                00000000
3164
RD0                               00000000
3165
RD1                               00000001
3166
RD16                              00000007
3167
RD2                               00000002
3168
RD3                               00000003
3169
RD4                               00000004
3170
RD5                               00000005
3171
RD6                               00000006
3172
RD7                               00000007
3173
RE0                               00000000
3174
RE1                               00000001
3175
RE2                               00000002
3176
RE3                               00000003
3177
RESIN                             00000002
3178
RGUIM                             00000008
3179
RI                                00000004
3180
RPTTBL                            0000015A
3181
RSEN                              00000001
3182
RSHFB                             00000003
3183
RSHFM                             00000008
3184
RX                                00000007
3185
RX9                               00000006
3186
RX9D                              00000000
3187
RXBRK                             00000006
3188
RXBUFLEN                          000000FE
3189
RXDTP                             00000005
3190
RXE1ERR                           00000003
3191
RXEXT                             00000005
3192
RXEXT1                            00000004
3193
RXMASK                            00000080
3194
RXOVR                             00000007
3195
R_NOT_W                           00000002
3196
R_W                               00000002
3197
RptSt                             0000002A
3198
RxBufEnd                          0000013E
3199
RxBuffer                          00000040
3200
RxCnt                             0000000C
3201
RxCode                            0000001F
3202
RxData                            0000000B
3203
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 56
3204
 
3205
 
3206
SYMBOL TABLE
3207
  LABEL                             VALUE
3208
 
3209
RxFlag                            0000000D
3210
RxKeyb                            00000078
3211
RxKeyb1                           00000096
3212
RxKeyb2                           0000009A
3213
RxKeyb3                           0000009E
3214
RxKeyb4                           000000A8
3215
RxKeyb5                           000000AE
3216
RxKeyb6                           000000B2
3217
RxKeyb7                           000000C0
3218
RxKeyb8                           000000C4
3219
RxKeyb9                           000000CC
3220
S                                 00000003
3221
SBOREN                            00000006
3222
SCK                               00000003
3223
SCKP                              00000004
3224
SCL                               00000003
3225
SCLOCKH
3226
SCLOCKL
3227
SCRLB                             00000005
3228
SCRLM                             00000020
3229
SCS0                              00000000
3230
SCS1                              00000001
3231
SDA                               00000004
3232
SDATAH
3233
SDATAL
3234
SDI                               00000004
3235
SDO                               00000005
3236
SEN                               00000000
3237
SENDB                             00000003
3238
SHFALL                            000000C0
3239
SHIFTKM                           00000009
3240
SKPALL                            00000070
3241
SKPALTB                           00000005
3242
SKPCTLB                           00000006
3243
SKPSHFB                           00000004
3244
SLEEPM                            00000040
3245
SMP                               00000007
3246
SP0                               00000000
3247
SP1                               00000001
3248
SP2                               00000002
3249
SP3                               00000003
3250
SP4                               00000004
3251
SPBRG                             00000FAF
3252
SPBRGH                            00000FB0
3253
SPCKEY                            0000009A
3254
SPCKEY2                           0000003A
3255
SPCKEY3                           0000006A
3256
SPEN                              00000007
3257
SREN                              00000005
3258
SS                                00000005
3259
SSPADD                            00000FC8
3260
SSPBUF                            00000FC9
3261
SSPCON1                           00000FC6
3262
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 57
3263
 
3264
 
3265
SYMBOL TABLE
3266
  LABEL                             VALUE
3267
 
3268
SSPCON2                           00000FC5
3269
SSPEN                             00000005
3270
SSPIE                             00000003
3271
SSPIF                             00000003
3272
SSPIP                             00000003
3273
SSPM0                             00000000
3274
SSPM1                             00000001
3275
SSPM2                             00000002
3276
SSPM3                             00000003
3277
SSPOV                             00000006
3278
SSPSTAT                           00000FC7
3279
STATUS                            00000FD8
3280
STKFUL                            00000007
3281
STKOVF                            00000007
3282
STKPTR                            00000FFC
3283
STKUNF                            00000006
3284
SWDTE                             00000000
3285
SWDTEN                            00000000
3286
SYNC                              00000004
3287
SYSCODE                           00000017
3288
SendKbd                           000001AE
3289
SendKbd10                         000001D2
3290
SendLed                           000001A6
3291
SetLed                            00000900
3292
SetLed1                           00000908
3293
SetLed2                           00000940
3294
ShfSt                             00000020
3295
SndProc                           00000944
3296
Start                             0000098C
3297
T016BIT                           00000006
3298
T08BIT                            00000006
3299
T0CKI                             00000004
3300
T0CON                             00000FD5
3301
T0CS                              00000005
3302
T0CntH                            00000017
3303
T0CntL                            00000016
3304
T0IE                              00000005
3305
T0IF                              00000002
3306
T0PS0                             00000000
3307
T0PS1                             00000001
3308
T0PS2                             00000002
3309
T0PS3                             00000003
3310
T0SE                              00000004
3311
T100US                            0000FE0C
3312
T13CKI                            00000000
3313
T1500MS                           00008D90
3314
T1CKI                             00000000
3315
T1CKPS0                           00000004
3316
T1CKPS1                           00000005
3317
T1CON                             00000FCD
3318
T1OSCEN                           00000003
3319
T1OSI                             00000001
3320
T1OSO                             00000000
3321
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 58
3322
 
3323
 
3324
SYMBOL TABLE
3325
  LABEL                             VALUE
3326
 
3327
T1RUN                             00000006
3328
T1SYNC                            00000002
3329
T20MS                             00009E58
3330
T20US                             0000FF9C
3331
T2CKPS0                           00000000
3332
T2CKPS1                           00000001
3333
T2CON                             00000FCA
3334
T2OUTPS0                          00000003
3335
T2OUTPS1                          00000004
3336
T2OUTPS2                          00000005
3337
T2OUTPS3                          00000006
3338
T3CCP1                            00000003
3339
T3CCP2                            00000006
3340
T3CKPS0                           00000004
3341
T3CKPS1                           00000005
3342
T3CON                             00000FB1
3343
T3SYNC                            00000002
3344
T40MS                             00003CB0
3345
TABLAT                            00000FF5
3346
TBLPTR                            00000FF6
3347
TBLPTRH                           00000FF7
3348
TBLPTRL                           00000FF6
3349
TBLPTRU                           00000FF8
3350
TCtlSt                            00000023
3351
TLockSt                           00000028
3352
TMR0                              00000FD6
3353
TMR0H                             00000FD7
3354
TMR0IE                            00000005
3355
TMR0IF                            00000002
3356
TMR0IP                            00000002
3357
TMR0L                             00000FD6
3358
TMR0ON                            00000007
3359
TMR0P0                            00000008
3360
TMR0P256                          00000007
3361
TMR0P4                            00000001
3362
TMR1                              00000FCE
3363
TMR1CS                            00000001
3364
TMR1H                             00000FCF
3365
TMR1IE                            00000000
3366
TMR1IF                            00000000
3367
TMR1IP                            00000000
3368
TMR1L                             00000FCE
3369
TMR1ON                            00000000
3370
TMR2                              00000FCC
3371
TMR2IE                            00000001
3372
TMR2IF                            00000001
3373
TMR2IP                            00000001
3374
TMR2ON                            00000002
3375
TMR3                              00000FB2
3376
TMR3CS                            00000001
3377
TMR3H                             00000FB3
3378
TMR3IE                            00000001
3379
TMR3IF                            00000001
3380
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 59
3381
 
3382
 
3383
SYMBOL TABLE
3384
  LABEL                             VALUE
3385
 
3386
TMR3IP                            00000001
3387
TMR3L                             00000FB2
3388
TMR3ON                            00000000
3389
TO                                00000003
3390
TOPRAM                            00000300
3391
TOS                               00000FFD
3392
TOSH                              00000FFE
3393
TOSL                              00000FFD
3394
TOSU                              00000FFF
3395
TOUTPS0                           00000003
3396
TOUTPS1                           00000004
3397
TOUTPS2                           00000005
3398
TOUTPS3                           00000006
3399
TPortB                            00000029
3400
TRISA                             00000F92
3401
TRISA0                            00000000
3402
TRISA1                            00000001
3403
TRISA2                            00000002
3404
TRISA3                            00000003
3405
TRISA4                            00000004
3406
TRISA5                            00000005
3407
TRISA6                            00000006
3408
TRISA7                            00000007
3409
TRISB                             00000F93
3410
TRISB0                            00000000
3411
TRISB1                            00000001
3412
TRISB2                            00000002
3413
TRISB3                            00000003
3414
TRISB4                            00000004
3415
TRISB5                            00000005
3416
TRISB6                            00000006
3417
TRISB7                            00000007
3418
TRISC                             00000F94
3419
TRISC0                            00000000
3420
TRISC1                            00000001
3421
TRISC2                            00000002
3422
TRISC3                            00000003
3423
TRISC4                            00000004
3424
TRISC5                            00000005
3425
TRISC6                            00000006
3426
TRISC7                            00000007
3427
TRISD                             00000F95
3428
TRISD0                            00000000
3429
TRISD1                            00000001
3430
TRISD2                            00000002
3431
TRISD3                            00000003
3432
TRISD4                            00000004
3433
TRISD5                            00000005
3434
TRISD6                            00000006
3435
TRISD7                            00000007
3436
TRISE                             00000F96
3437
TRISE0                            00000000
3438
TRISE1                            00000001
3439
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 60
3440
 
3441
 
3442
SYMBOL TABLE
3443
  LABEL                             VALUE
3444
 
3445
TRISE2                            00000002
3446
TRMT                              00000001
3447
TShfSt                            00000024
3448
TTglSt                            00000027
3449
TUN0                              00000000
3450
TUN1                              00000001
3451
TUN2                              00000002
3452
TUN3                              00000003
3453
TUN4                              00000004
3454
TX                                00000006
3455
TX9                               00000006
3456
TX9D                              00000000
3457
TXBUFLEN                          000001C2
3458
TXCKP                             00000004
3459
TXEN                              00000005
3460
TXIE                              00000004
3461
TXIF                              00000004
3462
TXIP                              00000004
3463
TXMAXCNT                          000000E1
3464
TXOVR                             00000007
3465
TXREG                             00000FAD
3466
TXSTA                             00000FAC
3467
TglSt                             00000021
3468
TmpB                              0000001C
3469
ToggleBit                         0000064E
3470
ToggleRls                         00000656
3471
TstLock                           0000065A
3472
TxBufEnd                          00000300
3473
TxBuffer                          0000013E
3474
TxCnt                             00000013
3475
TxData0                           00000014
3476
TxData1                           00000015
3477
TxFlag                            00000012
3478
TxHeadH                           0000000F
3479
TxHeadL                           0000000E
3480
TxKeyb                            0000010C
3481
TxKeyb1                           0000012A
3482
TxKeyb10                          00000174
3483
TxKeyb11                          00000178
3484
TxKeyb12                          00000180
3485
TxKeyb2                           00000144
3486
TxKeyb3                           00000148
3487
TxKeyb4                           00000152
3488
TxKeyb5                           00000154
3489
TxKeyb6                           00000158
3490
TxKeyb7                           00000168
3491
TxKeyb8                           0000016A
3492
TxKeyb9                           0000016E
3493
TxTailH                           00000011
3494
TxTailL                           00000010
3495
UA                                00000001
3496
USTBL                             00000010
3497
UpdBufPtr                         00000404
3498
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 61
3499
 
3500
 
3501
SYMBOL TABLE
3502
  LABEL                             VALUE
3503
 
3504
VCFG0                             00000004
3505
VCFG1                             00000005
3506
VDIRMAG                           00000007
3507
VPP                               00000003
3508
VREFN                             00000002
3509
VREFP                             00000003
3510
W                                 00000000
3511
WAKECODE                          00000018
3512
WAKEM                             00000020
3513
WCOL                              00000007
3514
WDTCON                            00000FD1
3515
WR                                00000001
3516
WREG                              00000FE8
3517
WREN                              00000002
3518
WRERR                             00000003
3519
WUE                               00000001
3520
Wait1                             000008DC
3521
Z                                 00000002
3522
_BOREN_NOSLP_2L                   000000FD
3523
_BOREN_OFF_2L                     000000F9
3524
_BOREN_ON_2L                      000000FB
3525
_BOREN_SBORDIS_2L                 000000FF
3526
_BORV_0_2L                        000000E7
3527
_BORV_1_2L                        000000EF
3528
_BORV_2_2L                        000000F7
3529
_BORV_3_2L                        000000FF
3530
_CCP2MX_PORTBE_3H                 000000FE
3531
_CCP2MX_PORTC_3H                  000000FF
3532
_CONFIG1H                         00300001
3533
_CONFIG2H                         00300003
3534
_CONFIG2L                         00300002
3535
_CONFIG3H                         00300005
3536
_CONFIG4L                         00300006
3537
_CONFIG5H                         00300009
3538
_CONFIG5L                         00300008
3539
_CONFIG6H                         0030000B
3540
_CONFIG6L                         0030000A
3541
_CONFIG7H                         0030000D
3542
_CONFIG7L                         0030000C
3543
_CP0_OFF_5L                       000000FF
3544
_CP0_ON_5L                        000000FE
3545
_CP1_OFF_5L                       000000FF
3546
_CP1_ON_5L                        000000FD
3547
_CPB_OFF_5H                       000000FF
3548
_CPB_ON_5H                        000000BF
3549
_CPD_OFF_5H                       000000FF
3550
_CPD_ON_5H                        0000007F
3551
_DEBUG_OFF_4L                     000000FF
3552
_DEBUG_ON_4L                      0000007F
3553
_DEVID1                           003FFFFE
3554
_DEVID2                           003FFFFF
3555
_EBTR0_OFF_7L                     000000FF
3556
_EBTR0_ON_7L                      000000FE
3557
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 62
3558
 
3559
 
3560
SYMBOL TABLE
3561
  LABEL                             VALUE
3562
 
3563
_EBTR1_OFF_7L                     000000FF
3564
_EBTR1_ON_7L                      000000FD
3565
_EBTRB_OFF_7H                     000000FF
3566
_EBTRB_ON_7H                      000000BF
3567
_FCMEN_OFF_1H                     000000BF
3568
_FCMEN_ON_1H                      000000FF
3569
_IDLOC0                           00200000
3570
_IDLOC1                           00200001
3571
_IDLOC2                           00200002
3572
_IDLOC3                           00200003
3573
_IDLOC4                           00200004
3574
_IDLOC5                           00200005
3575
_IDLOC6                           00200006
3576
_IDLOC7                           00200007
3577
_IESO_OFF_1H                      0000007F
3578
_IESO_ON_1H                       000000FF
3579
_LPT1OSC_OFF_3H                   000000FB
3580
_LPT1OSC_ON_3H                    000000FF
3581
_LVP_OFF_4L                       000000FB
3582
_LVP_ON_4L                        000000FF
3583
_MCLRE_OFF_3H                     0000007F
3584
_MCLRE_ON_3H                      000000FF
3585
_OSC_ECIO6_1H                     000000F5
3586
_OSC_EC_1H                        000000F4
3587
_OSC_HSPLL_1H                     000000F6
3588
_OSC_HS_1H                        000000F2
3589
_OSC_INTIO67_1H                   000000F8
3590
_OSC_INTIO7_1H                    000000F9
3591
_OSC_LP_1H                        000000F0
3592
_OSC_RCIO6_1H                     000000F7
3593
_OSC_RC_1H                        000000F3
3594
_OSC_XT_1H                        000000F1
3595
_PBADEN_OFF_3H                    000000FD
3596
_PBADEN_ON_3H                     000000FF
3597
_PWRT_OFF_2L                      000000FF
3598
_PWRT_ON_2L                       000000FE
3599
_STVREN_OFF_4L                    000000FE
3600
_STVREN_ON_4L                     000000FF
3601
_WDTPS_1024_2H                    000000F5
3602
_WDTPS_128_2H                     000000EF
3603
_WDTPS_16384_2H                   000000FD
3604
_WDTPS_16_2H                      000000E9
3605
_WDTPS_1_2H                       000000E1
3606
_WDTPS_2048_2H                    000000F7
3607
_WDTPS_256_2H                     000000F1
3608
_WDTPS_2_2H                       000000E3
3609
_WDTPS_32768_2H                   000000FF
3610
_WDTPS_32_2H                      000000EB
3611
_WDTPS_4096_2H                    000000F9
3612
_WDTPS_4_2H                       000000E5
3613
_WDTPS_512_2H                     000000F3
3614
_WDTPS_64_2H                      000000ED
3615
_WDTPS_8192_2H                    000000FB
3616
MPASM  5.44                          MAIN.ASM   5-22-2013  16:45:20         PAGE 63
3617
 
3618
 
3619
SYMBOL TABLE
3620
  LABEL                             VALUE
3621
 
3622
_WDTPS_8_2H                       000000E7
3623
_WDT_OFF_2H                       000000FE
3624
_WDT_ON_2H                        000000FF
3625
_WRT0_OFF_6L                      000000FF
3626
_WRT0_ON_6L                       000000FE
3627
_WRT1_OFF_6L                      000000FF
3628
_WRT1_ON_6L                       000000FD
3629
_WRTB_OFF_6H                      000000FF
3630
_WRTB_ON_6H                       000000BF
3631
_WRTC_OFF_6H                      000000FF
3632
_WRTC_ON_6H                       000000DF
3633
_WRTD_OFF_6H                      000000FF
3634
_WRTD_ON_6H                       0000007F
3635
_XINST_OFF_4L                     000000BF
3636
_XINST_ON_4L                      000000FF
3637
__18F4420                         00000001
3638
bmi                               bn
3639
bpl                               bnn
3640
ldw
3641
 
3642
Errors   :     0
3643
Warnings :     0 reported,     0 suppressed
3644
Messages :     0 reported,     0 suppressed
3645
 
3646