OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_13/usb_fpga_2_13/trunk

Subversion Repositories usb_fpga_2_13

[/] [usb_fpga_2_13/] [trunk/] [default/] [usb-fpga-2.01/] [default.asm] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ZTEX
;--------------------------------------------------------
2
; File Created by SDCC : free open source ANSI-C Compiler
3
; Version 2.8.0 #5117 (May 15 2008) (UNIX)
4
; This file was generated Wed Apr  2 23:07:29 2014
5
;--------------------------------------------------------
6
        .module default_tmp
7
        .optsdcc -mmcs51 --model-small
8
 
9
;--------------------------------------------------------
10
; Public variables in this module
11
;--------------------------------------------------------
12
        .globl _sendStringDescriptor_PARM_3
13
        .globl _sendStringDescriptor_PARM_2
14
        .globl _spi_write_PARM_2
15
        .globl _flash_read_PARM_2
16
        .globl _mac_eeprom_init_hexdigits_1_1
17
        .globl _EmptyStringDescriptor
18
        .globl _FullSpeedConfigDescriptor_PadByte
19
        .globl _FullSpeedConfigDescriptor
20
        .globl _HighSpeedConfigDescriptor_PadByte
21
        .globl _HighSpeedConfigDescriptor
22
        .globl _DeviceQualifierDescriptor
23
        .globl _DeviceDescriptor
24
        .globl _configurationString
25
        .globl _productString
26
        .globl _manufacturerString
27
        .globl _fpga_flash_boot_id
28
        .globl _main
29
        .globl _init_USB
30
        .globl _mac_eeprom_init
31
        .globl _EP8_ISR
32
        .globl _EP6_ISR
33
        .globl _EP4_ISR
34
        .globl _EP2_ISR
35
        .globl _EP1OUT_ISR
36
        .globl _EP1IN_ISR
37
        .globl _EP0ACK_ISR
38
        .globl _HSGRANT_ISR
39
        .globl _URES_ISR
40
        .globl _SUSP_ISR
41
        .globl _SUTOK_ISR
42
        .globl _SOF_ISR
43
        .globl _abscode_identity
44
        .globl _fpga_configure_from_flash_init
45
        .globl _fpga_first_free_sector
46
        .globl _fpga_configure_from_flash
47
        .globl _fpga_send_ep0
48
        .globl _spi_send_ep0
49
        .globl _spi_read_ep0
50
        .globl _flash_init
51
        .globl _flash_write_next
52
        .globl _flash_write_finish
53
        .globl _flash_write_finish_sector
54
        .globl _flash_write_init
55
        .globl _flash_write
56
        .globl _flash_write_byte
57
        .globl _spi_pp
58
        .globl _flash_read_finish
59
        .globl _flash_read_next
60
        .globl _flash_read_init
61
        .globl _spi_wait
62
        .globl _spi_deselect
63
        .globl _spi_select
64
        .globl _spi_write
65
        .globl _spi_write_byte
66
        .globl _flash_read
67
        .globl _flash_read_byte
68
        .globl _spi_clocks
69
        .globl _mac_eeprom_read_ep0
70
        .globl _mac_eeprom_write
71
        .globl _mac_eeprom_read
72
        .globl _eeprom_write_ep0
73
        .globl _eeprom_read_ep0
74
        .globl _eeprom_write
75
        .globl _eeprom_read
76
        .globl _eeprom_select
77
        .globl _i2c_waitStop
78
        .globl _i2c_waitStart
79
        .globl _i2c_waitRead
80
        .globl _i2c_waitWrite
81
        .globl _MEM_COPY1_int
82
        .globl _uwait
83
        .globl _wait
84
        .globl _abscode_intvec
85
        .globl _EIPX6
86
        .globl _EIPX5
87
        .globl _EIPX4
88
        .globl _PI2C
89
        .globl _PUSB
90
        .globl _BREG7
91
        .globl _BREG6
92
        .globl _BREG5
93
        .globl _BREG4
94
        .globl _BREG3
95
        .globl _BREG2
96
        .globl _BREG1
97
        .globl _BREG0
98
        .globl _EIEX6
99
        .globl _EIEX5
100
        .globl _EIEX4
101
        .globl _EI2C
102
        .globl _EUSB
103
        .globl _ACC7
104
        .globl _ACC6
105
        .globl _ACC5
106
        .globl _ACC4
107
        .globl _ACC3
108
        .globl _ACC2
109
        .globl _ACC1
110
        .globl _ACC0
111
        .globl _SMOD1
112
        .globl _ERESI
113
        .globl _RESI
114
        .globl _INT6
115
        .globl _CY
116
        .globl _AC
117
        .globl _F0
118
        .globl _RS1
119
        .globl _RS0
120
        .globl _OV
121
        .globl _F1
122
        .globl _PF
123
        .globl _TF2
124
        .globl _EXF2
125
        .globl _RCLK
126
        .globl _TCLK
127
        .globl _EXEN2
128
        .globl _TR2
129
        .globl _CT2
130
        .globl _CPRL2
131
        .globl _SM0_1
132
        .globl _SM1_1
133
        .globl _SM2_1
134
        .globl _REN_1
135
        .globl _TB8_1
136
        .globl _RB8_1
137
        .globl _TI_1
138
        .globl _RI_1
139
        .globl _PS1
140
        .globl _PT2
141
        .globl _PS0
142
        .globl _PT1
143
        .globl _PX1
144
        .globl _PT0
145
        .globl _PX0
146
        .globl _IOD7
147
        .globl _IOD6
148
        .globl _IOD5
149
        .globl _IOD4
150
        .globl _IOD3
151
        .globl _IOD2
152
        .globl _IOD1
153
        .globl _IOD0
154
        .globl _EA
155
        .globl _ES1
156
        .globl _ET2
157
        .globl _ES0
158
        .globl _ET1
159
        .globl _EX1
160
        .globl _ET0
161
        .globl _EX0
162
        .globl _IOC7
163
        .globl _IOC6
164
        .globl _IOC5
165
        .globl _IOC4
166
        .globl _IOC3
167
        .globl _IOC2
168
        .globl _IOC1
169
        .globl _IOC0
170
        .globl _SM0_0
171
        .globl _SM1_0
172
        .globl _SM2_0
173
        .globl _REN_0
174
        .globl _TB8_0
175
        .globl _RB8_0
176
        .globl _TI_0
177
        .globl _RI_0
178
        .globl _IOB7
179
        .globl _IOB6
180
        .globl _IOB5
181
        .globl _IOB4
182
        .globl _IOB3
183
        .globl _IOB2
184
        .globl _IOB1
185
        .globl _IOB0
186
        .globl _TF1
187
        .globl _TR1
188
        .globl _TF0
189
        .globl _TR0
190
        .globl _IE1
191
        .globl _IT1
192
        .globl _IE0
193
        .globl _IT0
194
        .globl _IOA7
195
        .globl _IOA6
196
        .globl _IOA5
197
        .globl _IOA4
198
        .globl _IOA3
199
        .globl _IOA2
200
        .globl _IOA1
201
        .globl _IOA0
202
        .globl _EIP
203
        .globl _BREG
204
        .globl _EIE
205
        .globl _ACC
206
        .globl _EICON
207
        .globl _PSW
208
        .globl _TH2
209
        .globl _TL2
210
        .globl _RCAP2H
211
        .globl _RCAP2L
212
        .globl _T2CON
213
        .globl _SBUF1
214
        .globl _SCON1
215
        .globl _GPIFSGLDATLNOX
216
        .globl _GPIFSGLDATLX
217
        .globl _GPIFSGLDATH
218
        .globl _GPIFTRIG
219
        .globl _EP01STAT
220
        .globl _IP
221
        .globl _OEE
222
        .globl _OED
223
        .globl _OEC
224
        .globl _OEB
225
        .globl _OEA
226
        .globl _IOE
227
        .globl _IOD
228
        .globl _AUTOPTRSETUP
229
        .globl _EP68FIFOFLGS
230
        .globl _EP24FIFOFLGS
231
        .globl _EP2468STAT
232
        .globl _IE
233
        .globl _INT4CLR
234
        .globl _INT2CLR
235
        .globl _IOC
236
        .globl _AUTOPTRL2
237
        .globl _AUTOPTRH2
238
        .globl _AUTOPTRL1
239
        .globl _AUTOPTRH1
240
        .globl _SBUF0
241
        .globl _SCON0
242
        .globl __XPAGE
243
        .globl _MPAGE
244
        .globl _EXIF
245
        .globl _IOB
246
        .globl _CKCON
247
        .globl _TH1
248
        .globl _TH0
249
        .globl _TL1
250
        .globl _TL0
251
        .globl _TMOD
252
        .globl _TCON
253
        .globl _PCON
254
        .globl _DPS
255
        .globl _DPH1
256
        .globl _DPL1
257
        .globl _DPH0
258
        .globl _DPL0
259
        .globl _SP
260
        .globl _IOA
261
        .globl _ISOFRAME_COUNTER
262
        .globl _ep0_vendor_cmd_setup
263
        .globl _ep0_prev_setup_request
264
        .globl _ep0_payload_transfer
265
        .globl _ep0_payload_remaining
266
        .globl _SN_STRING
267
        .globl _MODULE_RESERVED
268
        .globl _INTERFACE_CAPABILITIES
269
        .globl _INTERFACE_VERSION
270
        .globl _FW_VERSION
271
        .globl _PRODUCT_ID
272
        .globl _ZTEXID
273
        .globl _ZTEX_DESCRIPTOR_VERSION
274
        .globl _ZTEX_DESCRIPTOR
275
        .globl _OOEA
276
        .globl _fpga_conf_initialized
277
        .globl _fpga_flash_result
278
        .globl _fpga_init_b
279
        .globl _fpga_bytes
280
        .globl _fpga_checksum
281
        .globl _ep0_write_mode
282
        .globl _ep0_read_mode
283
        .globl _spi_write_sector
284
        .globl _spi_need_pp
285
        .globl _spi_write_addr_lo
286
        .globl _spi_write_addr_hi
287
        .globl _spi_buffer
288
        .globl _spi_last_cmd
289
        .globl _spi_erase_cmd
290
        .globl _spi_memtype
291
        .globl _spi_device
292
        .globl _spi_vendor
293
        .globl _flash_ec
294
        .globl _flash_sectors
295
        .globl _flash_sector_size
296
        .globl _flash_enabled
297
        .globl _config_data_valid
298
        .globl _mac_eeprom_addr
299
        .globl _eeprom_write_checksum
300
        .globl _eeprom_write_bytes
301
        .globl _eeprom_addr
302
        .globl _INTVEC_GPIFWF
303
        .globl _INTVEC_GPIFDONE
304
        .globl _INTVEC_EP8FF
305
        .globl _INTVEC_EP6FF
306
        .globl _INTVEC_EP2FF
307
        .globl _INTVEC_EP8EF
308
        .globl _INTVEC_EP6EF
309
        .globl _INTVEC_EP4EF
310
        .globl _INTVEC_EP2EF
311
        .globl _INTVEC_EP8PF
312
        .globl _INTVEC_EP6PF
313
        .globl _INTVEC_EP4PF
314
        .globl _INTVEC_EP2PF
315
        .globl _INTVEC_EP8ISOERR
316
        .globl _INTVEC_EP6ISOERR
317
        .globl _INTVEC_EP4ISOERR
318
        .globl _INTVEC_EP2ISOERR
319
        .globl _INTVEC_ERRLIMIT
320
        .globl _INTVEC_EP8PING
321
        .globl _INTVEC_EP6PING
322
        .globl _INTVEC_EP4PING
323
        .globl _INTVEC_EP2PING
324
        .globl _INTVEC_EP1PING
325
        .globl _INTVEC_EP0PING
326
        .globl _INTVEC_IBN
327
        .globl _INTVEC_EP8
328
        .globl _INTVEC_EP6
329
        .globl _INTVEC_EP4
330
        .globl _INTVEC_EP2
331
        .globl _INTVEC_EP1OUT
332
        .globl _INTVEC_EP1IN
333
        .globl _INTVEC_EP0OUT
334
        .globl _INTVEC_EP0IN
335
        .globl _INTVEC_EP0ACK
336
        .globl _INTVEC_HISPEED
337
        .globl _INTVEC_USBRESET
338
        .globl _INTVEC_SUSPEND
339
        .globl _INTVEC_SUTOK
340
        .globl _INTVEC_SOF
341
        .globl _INTVEC_SUDAV
342
        .globl _INT12VEC_IE6
343
        .globl _INT11VEC_IE5
344
        .globl _INT10VEC_GPIF
345
        .globl _INT9VEC_I2C
346
        .globl _INT8VEC_USB
347
        .globl _INT7VEC_USART1
348
        .globl _INT6VEC_RESUME
349
        .globl _INT5VEC_T2
350
        .globl _INT4VEC_USART0
351
        .globl _INT3VEC_T1
352
        .globl _INT2VEC_IE1
353
        .globl _INT1VEC_T0
354
        .globl _INT0VEC_IE0
355
        .globl _EP8FIFOBUF
356
        .globl _EP6FIFOBUF
357
        .globl _EP4FIFOBUF
358
        .globl _EP2FIFOBUF
359
        .globl _EP1INBUF
360
        .globl _EP1OUTBUF
361
        .globl _EP0BUF
362
        .globl _GPIFABORT
363
        .globl _GPIFREADYSTAT
364
        .globl _GPIFREADYCFG
365
        .globl _XGPIFSGLDATLNOX
366
        .globl _XGPIFSGLDATLX
367
        .globl _XGPIFSGLDATH
368
        .globl _EP8GPIFTRIG
369
        .globl _EP8GPIFPFSTOP
370
        .globl _EP8GPIFFLGSEL
371
        .globl _EP6GPIFTRIG
372
        .globl _EP6GPIFPFSTOP
373
        .globl _EP6GPIFFLGSEL
374
        .globl _EP4GPIFTRIG
375
        .globl _EP4GPIFPFSTOP
376
        .globl _EP4GPIFFLGSEL
377
        .globl _EP2GPIFTRIG
378
        .globl _EP2GPIFPFSTOP
379
        .globl _EP2GPIFFLGSEL
380
        .globl _GPIFTCB0
381
        .globl _GPIFTCB1
382
        .globl _GPIFTCB2
383
        .globl _GPIFTCB3
384
        .globl _FLOWSTBHPERIOD
385
        .globl _FLOWSTBEDGE
386
        .globl _FLOWSTB
387
        .globl _FLOWHOLDOFF
388
        .globl _FLOWEQ1CTL
389
        .globl _FLOWEQ0CTL
390
        .globl _FLOWLOGIC
391
        .globl _FLOWSTATE
392
        .globl _GPIFADRL
393
        .globl _GPIFADRH
394
        .globl _GPIFCTLCFG
395
        .globl _GPIFIDLECTL
396
        .globl _GPIFIDLECS
397
        .globl _GPIFWFSELECT
398
        .globl _wLengthH
399
        .globl _wLengthL
400
        .globl _wIndexH
401
        .globl _wIndexL
402
        .globl _wValueH
403
        .globl _wValueL
404
        .globl _bRequest
405
        .globl _bmRequestType
406
        .globl _SETUPDAT
407
        .globl _SUDPTRCTL
408
        .globl _SUDPTRL
409
        .globl _SUDPTRH
410
        .globl _EP8FIFOBCL
411
        .globl _EP8FIFOBCH
412
        .globl _EP6FIFOBCL
413
        .globl _EP6FIFOBCH
414
        .globl _EP4FIFOBCL
415
        .globl _EP4FIFOBCH
416
        .globl _EP2FIFOBCL
417
        .globl _EP2FIFOBCH
418
        .globl _EP8FIFOFLGS
419
        .globl _EP6FIFOFLGS
420
        .globl _EP4FIFOFLGS
421
        .globl _EP2FIFOFLGS
422
        .globl _EP8CS
423
        .globl _EP6CS
424
        .globl _EP4CS
425
        .globl _EP2CS
426
        .globl _EPXCS
427
        .globl _EP1INCS
428
        .globl _EP1OUTCS
429
        .globl _EP0CS
430
        .globl _EP8BCL
431
        .globl _EP8BCH
432
        .globl _EP6BCL
433
        .globl _EP6BCH
434
        .globl _EP4BCL
435
        .globl _EP4BCH
436
        .globl _EP2BCL
437
        .globl _EP2BCH
438
        .globl _EP1INBC
439
        .globl _EP1OUTBC
440
        .globl _EP0BCL
441
        .globl _EP0BCH
442
        .globl _FNADDR
443
        .globl _MICROFRAME
444
        .globl _USBFRAMEL
445
        .globl _USBFRAMEH
446
        .globl _TOGCTL
447
        .globl _WAKEUPCS
448
        .globl _SUSPEND
449
        .globl _USBCS
450
        .globl _UDMACRCQUALIFIER
451
        .globl _UDMACRCL
452
        .globl _UDMACRCH
453
        .globl _EXTAUTODAT2
454
        .globl _XAUTODAT2
455
        .globl _EXTAUTODAT1
456
        .globl _XAUTODAT1
457
        .globl _I2CTL
458
        .globl _I2DAT
459
        .globl _I2CS
460
        .globl _PORTECFG
461
        .globl _PORTCCFG
462
        .globl _PORTACFG
463
        .globl _INTSETUP
464
        .globl _INT4IVEC
465
        .globl _INT2IVEC
466
        .globl _CLRERRCNT
467
        .globl _ERRCNTLIM
468
        .globl _USBERRIRQ
469
        .globl _USBERRIE
470
        .globl _GPIFIRQ
471
        .globl _GPIFIE
472
        .globl _EPIRQ
473
        .globl _EPIE
474
        .globl _USBIRQ
475
        .globl _USBIE
476
        .globl _NAKIRQ
477
        .globl _NAKIE
478
        .globl _IBNIRQ
479
        .globl _IBNIE
480
        .globl _EP8FIFOIRQ
481
        .globl _EP8FIFOIE
482
        .globl _EP6FIFOIRQ
483
        .globl _EP6FIFOIE
484
        .globl _EP4FIFOIRQ
485
        .globl _EP4FIFOIE
486
        .globl _EP2FIFOIRQ
487
        .globl _EP2FIFOIE
488
        .globl _OUTPKTEND
489
        .globl _INPKTEND
490
        .globl _EP8ISOINPKTS
491
        .globl _EP6ISOINPKTS
492
        .globl _EP4ISOINPKTS
493
        .globl _EP2ISOINPKTS
494
        .globl _EP8FIFOPFL
495
        .globl _EP8FIFOPFH
496
        .globl _EP6FIFOPFL
497
        .globl _EP6FIFOPFH
498
        .globl _EP4FIFOPFL
499
        .globl _EP4FIFOPFH
500
        .globl _EP2FIFOPFL
501
        .globl _EP2FIFOPFH
502
        .globl _ECC2B2
503
        .globl _ECC2B1
504
        .globl _ECC2B0
505
        .globl _ECC1B2
506
        .globl _ECC1B1
507
        .globl _ECC1B0
508
        .globl _ECCRESET
509
        .globl _ECCCFG
510
        .globl _EP8AUTOINLENL
511
        .globl _EP8AUTOINLENH
512
        .globl _EP6AUTOINLENL
513
        .globl _EP6AUTOINLENH
514
        .globl _EP4AUTOINLENL
515
        .globl _EP4AUTOINLENH
516
        .globl _EP2AUTOINLENL
517
        .globl _EP2AUTOINLENH
518
        .globl _EP8FIFOCFG
519
        .globl _EP6FIFOCFG
520
        .globl _EP4FIFOCFG
521
        .globl _EP2FIFOCFG
522
        .globl _EP8CFG
523
        .globl _EP6CFG
524
        .globl _EP4CFG
525
        .globl _EP2CFG
526
        .globl _EP1INCFG
527
        .globl _EP1OUTCFG
528
        .globl _GPIFHOLDAMOUNT
529
        .globl _REVCTL
530
        .globl _REVID
531
        .globl _FIFOPINPOLAR
532
        .globl _UART230
533
        .globl _BPADDRL
534
        .globl _BPADDRH
535
        .globl _BREAKPT
536
        .globl _FIFORESET
537
        .globl _PINFLAGSCD
538
        .globl _PINFLAGSAB
539
        .globl _IFCONFIG
540
        .globl _CPUCS
541
        .globl _GPCR2
542
        .globl _GPIF_WAVE3_DATA
543
        .globl _GPIF_WAVE2_DATA
544
        .globl _GPIF_WAVE1_DATA
545
        .globl _GPIF_WAVE0_DATA
546
        .globl _GPIF_WAVE_DATA
547
        .globl _flash_write_PARM_2
548
        .globl _mac_eeprom_write_PARM_3
549
        .globl _mac_eeprom_write_PARM_2
550
        .globl _mac_eeprom_read_PARM_3
551
        .globl _mac_eeprom_read_PARM_2
552
        .globl _eeprom_write_PARM_3
553
        .globl _eeprom_write_PARM_2
554
        .globl _eeprom_read_PARM_3
555
        .globl _eeprom_read_PARM_2
556
        .globl _eeprom_select_PARM_3
557
        .globl _eeprom_select_PARM_2
558
;--------------------------------------------------------
559
; special function registers
560
;--------------------------------------------------------
561
        .area RSEG    (DATA)
562
_IOA    =       0x0080
563
_SP     =       0x0081
564
_DPL0   =       0x0082
565
_DPH0   =       0x0083
566
_DPL1   =       0x0084
567
_DPH1   =       0x0085
568
_DPS    =       0x0086
569
_PCON   =       0x0087
570
_TCON   =       0x0088
571
_TMOD   =       0x0089
572
_TL0    =       0x008a
573
_TL1    =       0x008b
574
_TH0    =       0x008c
575
_TH1    =       0x008d
576
_CKCON  =       0x008e
577
_IOB    =       0x0090
578
_EXIF   =       0x0091
579
_MPAGE  =       0x0092
580
__XPAGE =       0x0092
581
_SCON0  =       0x0098
582
_SBUF0  =       0x0099
583
_AUTOPTRH1      =       0x009a
584
_AUTOPTRL1      =       0x009b
585
_AUTOPTRH2      =       0x009d
586
_AUTOPTRL2      =       0x009e
587
_IOC    =       0x00a0
588
_INT2CLR        =       0x00a1
589
_INT4CLR        =       0x00a2
590
_IE     =       0x00a8
591
_EP2468STAT     =       0x00aa
592
_EP24FIFOFLGS   =       0x00ab
593
_EP68FIFOFLGS   =       0x00ac
594
_AUTOPTRSETUP   =       0x00af
595
_IOD    =       0x00b0
596
_IOE    =       0x00b1
597
_OEA    =       0x00b2
598
_OEB    =       0x00b3
599
_OEC    =       0x00b4
600
_OED    =       0x00b5
601
_OEE    =       0x00b6
602
_IP     =       0x00b8
603
_EP01STAT       =       0x00ba
604
_GPIFTRIG       =       0x00bb
605
_GPIFSGLDATH    =       0x00bd
606
_GPIFSGLDATLX   =       0x00be
607
_GPIFSGLDATLNOX =       0x00bf
608
_SCON1  =       0x00c0
609
_SBUF1  =       0x00c1
610
_T2CON  =       0x00c8
611
_RCAP2L =       0x00ca
612
_RCAP2H =       0x00cb
613
_TL2    =       0x00cc
614
_TH2    =       0x00cd
615
_PSW    =       0x00d0
616
_EICON  =       0x00d8
617
_ACC    =       0x00e0
618
_EIE    =       0x00e8
619
_BREG   =       0x00f0
620
_EIP    =       0x00f8
621
;--------------------------------------------------------
622
; special function bits
623
;--------------------------------------------------------
624
        .area RSEG    (DATA)
625
_IOA0   =       0x0080
626
_IOA1   =       0x0081
627
_IOA2   =       0x0082
628
_IOA3   =       0x0083
629
_IOA4   =       0x0084
630
_IOA5   =       0x0085
631
_IOA6   =       0x0086
632
_IOA7   =       0x0087
633
_IT0    =       0x0088
634
_IE0    =       0x0089
635
_IT1    =       0x008a
636
_IE1    =       0x008b
637
_TR0    =       0x008c
638
_TF0    =       0x008d
639
_TR1    =       0x008e
640
_TF1    =       0x008f
641
_IOB0   =       0x0090
642
_IOB1   =       0x0091
643
_IOB2   =       0x0092
644
_IOB3   =       0x0093
645
_IOB4   =       0x0094
646
_IOB5   =       0x0095
647
_IOB6   =       0x0096
648
_IOB7   =       0x0097
649
_RI_0   =       0x0098
650
_TI_0   =       0x0099
651
_RB8_0  =       0x009a
652
_TB8_0  =       0x009b
653
_REN_0  =       0x009c
654
_SM2_0  =       0x009d
655
_SM1_0  =       0x009e
656
_SM0_0  =       0x009f
657
_IOC0   =       0x00a0
658
_IOC1   =       0x00a1
659
_IOC2   =       0x00a2
660
_IOC3   =       0x00a3
661
_IOC4   =       0x00a4
662
_IOC5   =       0x00a5
663
_IOC6   =       0x00a6
664
_IOC7   =       0x00a7
665
_EX0    =       0x00a8
666
_ET0    =       0x00a9
667
_EX1    =       0x00aa
668
_ET1    =       0x00ab
669
_ES0    =       0x00ac
670
_ET2    =       0x00ad
671
_ES1    =       0x00ae
672
_EA     =       0x00af
673
_IOD0   =       0x00b0
674
_IOD1   =       0x00b1
675
_IOD2   =       0x00b2
676
_IOD3   =       0x00b3
677
_IOD4   =       0x00b4
678
_IOD5   =       0x00b5
679
_IOD6   =       0x00b6
680
_IOD7   =       0x00b7
681
_PX0    =       0x00b8
682
_PT0    =       0x00b9
683
_PX1    =       0x00ba
684
_PT1    =       0x00bb
685
_PS0    =       0x00bc
686
_PT2    =       0x00bd
687
_PS1    =       0x00be
688
_RI_1   =       0x00c0
689
_TI_1   =       0x00c1
690
_RB8_1  =       0x00c2
691
_TB8_1  =       0x00c3
692
_REN_1  =       0x00c4
693
_SM2_1  =       0x00c5
694
_SM1_1  =       0x00c6
695
_SM0_1  =       0x00c7
696
_CPRL2  =       0x00c8
697
_CT2    =       0x00c9
698
_TR2    =       0x00ca
699
_EXEN2  =       0x00cb
700
_TCLK   =       0x00cc
701
_RCLK   =       0x00cd
702
_EXF2   =       0x00ce
703
_TF2    =       0x00cf
704
_PF     =       0x00d0
705
_F1     =       0x00d1
706
_OV     =       0x00d2
707
_RS0    =       0x00d3
708
_RS1    =       0x00d4
709
_F0     =       0x00d5
710
_AC     =       0x00d6
711
_CY     =       0x00d7
712
_INT6   =       0x00db
713
_RESI   =       0x00dc
714
_ERESI  =       0x00dd
715
_SMOD1  =       0x00df
716
_ACC0   =       0x00e0
717
_ACC1   =       0x00e1
718
_ACC2   =       0x00e2
719
_ACC3   =       0x00e3
720
_ACC4   =       0x00e4
721
_ACC5   =       0x00e5
722
_ACC6   =       0x00e6
723
_ACC7   =       0x00e7
724
_EUSB   =       0x00e8
725
_EI2C   =       0x00e9
726
_EIEX4  =       0x00ea
727
_EIEX5  =       0x00eb
728
_EIEX6  =       0x00ec
729
_BREG0  =       0x00f0
730
_BREG1  =       0x00f1
731
_BREG2  =       0x00f2
732
_BREG3  =       0x00f3
733
_BREG4  =       0x00f4
734
_BREG5  =       0x00f5
735
_BREG6  =       0x00f6
736
_BREG7  =       0x00f7
737
_PUSB   =       0x00f8
738
_PI2C   =       0x00f9
739
_EIPX4  =       0x00fa
740
_EIPX5  =       0x00fb
741
_EIPX6  =       0x00fc
742
;--------------------------------------------------------
743
; overlayable register banks
744
;--------------------------------------------------------
745
        .area REG_BANK_0        (REL,OVR,DATA)
746
        .ds 8
747
;--------------------------------------------------------
748
; overlayable bit register bank
749
;--------------------------------------------------------
750
        .area BIT_BANK  (REL,OVR,DATA)
751
bits:
752
        .ds 1
753
        b0 = bits[0]
754
        b1 = bits[1]
755
        b2 = bits[2]
756
        b3 = bits[3]
757
        b4 = bits[4]
758
        b5 = bits[5]
759
        b6 = bits[6]
760
        b7 = bits[7]
761
;--------------------------------------------------------
762
; internal ram data
763
;--------------------------------------------------------
764
        .area DSEG    (DATA)
765
_eeprom_select_PARM_2:
766
        .ds 1
767
_eeprom_select_PARM_3:
768
        .ds 1
769
_eeprom_read_PARM_2:
770
        .ds 2
771
_eeprom_read_PARM_3:
772
        .ds 1
773
_eeprom_write_PARM_2:
774
        .ds 2
775
_eeprom_write_PARM_3:
776
        .ds 1
777
_mac_eeprom_read_PARM_2:
778
        .ds 1
779
_mac_eeprom_read_PARM_3:
780
        .ds 1
781
_mac_eeprom_write_PARM_2:
782
        .ds 1
783
_mac_eeprom_write_PARM_3:
784
        .ds 1
785
_flash_write_PARM_2:
786
        .ds 1
787
_fpga_send_ep0_oOEC_1_1:
788
        .ds 1
789
;--------------------------------------------------------
790
; overlayable items in internal ram
791
;--------------------------------------------------------
792
        .area   OSEG    (OVR,DATA)
793
        .area   OSEG    (OVR,DATA)
794
        .area   OSEG    (OVR,DATA)
795
        .area   OSEG    (OVR,DATA)
796
        .area   OSEG    (OVR,DATA)
797
        .area   OSEG    (OVR,DATA)
798
        .area   OSEG    (OVR,DATA)
799
        .area   OSEG    (OVR,DATA)
800
_flash_read_PARM_2::
801
        .ds 1
802
        .area   OSEG    (OVR,DATA)
803
        .area   OSEG    (OVR,DATA)
804
_spi_write_PARM_2::
805
        .ds 1
806
        .area   OSEG    (OVR,DATA)
807
_sendStringDescriptor_PARM_2::
808
        .ds 1
809
_sendStringDescriptor_PARM_3::
810
        .ds 1
811
;--------------------------------------------------------
812
; Stack segment in internal ram
813
;--------------------------------------------------------
814
        .area   SSEG    (DATA)
815
__start__stack:
816
        .ds     1
817
 
818
;--------------------------------------------------------
819
; indirectly addressable internal ram data
820
;--------------------------------------------------------
821
        .area ISEG    (DATA)
822
;--------------------------------------------------------
823
; absolute internal ram data
824
;--------------------------------------------------------
825
        .area IABS    (ABS,DATA)
826
        .area IABS    (ABS,DATA)
827
;--------------------------------------------------------
828
; bit data
829
;--------------------------------------------------------
830
        .area BSEG    (BIT)
831
;--------------------------------------------------------
832
; paged external ram data
833
;--------------------------------------------------------
834
        .area PSEG    (PAG,XDATA)
835
;--------------------------------------------------------
836
; external ram data
837
;--------------------------------------------------------
838
        .area XSEG    (XDATA)
839
_GPIF_WAVE_DATA =       0xe400
840
_GPIF_WAVE0_DATA        =       0xe400
841
_GPIF_WAVE1_DATA        =       0xe420
842
_GPIF_WAVE2_DATA        =       0xe440
843
_GPIF_WAVE3_DATA        =       0xe460
844
_GPCR2  =       0xe50d
845
_CPUCS  =       0xe600
846
_IFCONFIG       =       0xe601
847
_PINFLAGSAB     =       0xe602
848
_PINFLAGSCD     =       0xe603
849
_FIFORESET      =       0xe604
850
_BREAKPT        =       0xe605
851
_BPADDRH        =       0xe606
852
_BPADDRL        =       0xe607
853
_UART230        =       0xe608
854
_FIFOPINPOLAR   =       0xe609
855
_REVID  =       0xe60a
856
_REVCTL =       0xe60b
857
_GPIFHOLDAMOUNT =       0xe60c
858
_EP1OUTCFG      =       0xe610
859
_EP1INCFG       =       0xe611
860
_EP2CFG =       0xe612
861
_EP4CFG =       0xe613
862
_EP6CFG =       0xe614
863
_EP8CFG =       0xe615
864
_EP2FIFOCFG     =       0xe618
865
_EP4FIFOCFG     =       0xe619
866
_EP6FIFOCFG     =       0xe61a
867
_EP8FIFOCFG     =       0xe61b
868
_EP2AUTOINLENH  =       0xe620
869
_EP2AUTOINLENL  =       0xe621
870
_EP4AUTOINLENH  =       0xe622
871
_EP4AUTOINLENL  =       0xe623
872
_EP6AUTOINLENH  =       0xe624
873
_EP6AUTOINLENL  =       0xe625
874
_EP8AUTOINLENH  =       0xe626
875
_EP8AUTOINLENL  =       0xe627
876
_ECCCFG =       0xe628
877
_ECCRESET       =       0xe629
878
_ECC1B0 =       0xe62a
879
_ECC1B1 =       0xe62b
880
_ECC1B2 =       0xe62c
881
_ECC2B0 =       0xe62d
882
_ECC2B1 =       0xe62e
883
_ECC2B2 =       0xe62f
884
_EP2FIFOPFH     =       0xe630
885
_EP2FIFOPFL     =       0xe631
886
_EP4FIFOPFH     =       0xe632
887
_EP4FIFOPFL     =       0xe633
888
_EP6FIFOPFH     =       0xe634
889
_EP6FIFOPFL     =       0xe635
890
_EP8FIFOPFH     =       0xe636
891
_EP8FIFOPFL     =       0xe637
892
_EP2ISOINPKTS   =       0xe640
893
_EP4ISOINPKTS   =       0xe641
894
_EP6ISOINPKTS   =       0xe642
895
_EP8ISOINPKTS   =       0xe643
896
_INPKTEND       =       0xe648
897
_OUTPKTEND      =       0xe649
898
_EP2FIFOIE      =       0xe650
899
_EP2FIFOIRQ     =       0xe651
900
_EP4FIFOIE      =       0xe652
901
_EP4FIFOIRQ     =       0xe653
902
_EP6FIFOIE      =       0xe654
903
_EP6FIFOIRQ     =       0xe655
904
_EP8FIFOIE      =       0xe656
905
_EP8FIFOIRQ     =       0xe657
906
_IBNIE  =       0xe658
907
_IBNIRQ =       0xe659
908
_NAKIE  =       0xe65a
909
_NAKIRQ =       0xe65b
910
_USBIE  =       0xe65c
911
_USBIRQ =       0xe65d
912
_EPIE   =       0xe65e
913
_EPIRQ  =       0xe65f
914
_GPIFIE =       0xe660
915
_GPIFIRQ        =       0xe661
916
_USBERRIE       =       0xe662
917
_USBERRIRQ      =       0xe663
918
_ERRCNTLIM      =       0xe664
919
_CLRERRCNT      =       0xe665
920
_INT2IVEC       =       0xe666
921
_INT4IVEC       =       0xe667
922
_INTSETUP       =       0xe668
923
_PORTACFG       =       0xe670
924
_PORTCCFG       =       0xe671
925
_PORTECFG       =       0xe672
926
_I2CS   =       0xe678
927
_I2DAT  =       0xe679
928
_I2CTL  =       0xe67a
929
_XAUTODAT1      =       0xe67b
930
_EXTAUTODAT1    =       0xe67b
931
_XAUTODAT2      =       0xe67c
932
_EXTAUTODAT2    =       0xe67c
933
_UDMACRCH       =       0xe67d
934
_UDMACRCL       =       0xe67e
935
_UDMACRCQUALIFIER       =       0xe67f
936
_USBCS  =       0xe680
937
_SUSPEND        =       0xe681
938
_WAKEUPCS       =       0xe682
939
_TOGCTL =       0xe683
940
_USBFRAMEH      =       0xe684
941
_USBFRAMEL      =       0xe685
942
_MICROFRAME     =       0xe686
943
_FNADDR =       0xe687
944
_EP0BCH =       0xe68a
945
_EP0BCL =       0xe68b
946
_EP1OUTBC       =       0xe68d
947
_EP1INBC        =       0xe68f
948
_EP2BCH =       0xe690
949
_EP2BCL =       0xe691
950
_EP4BCH =       0xe694
951
_EP4BCL =       0xe695
952
_EP6BCH =       0xe698
953
_EP6BCL =       0xe699
954
_EP8BCH =       0xe69c
955
_EP8BCL =       0xe69d
956
_EP0CS  =       0xe6a0
957
_EP1OUTCS       =       0xe6a1
958
_EP1INCS        =       0xe6a2
959
_EPXCS  =       0xe6a3
960
_EP2CS  =       0xe6a3
961
_EP4CS  =       0xe6a4
962
_EP6CS  =       0xe6a5
963
_EP8CS  =       0xe6a6
964
_EP2FIFOFLGS    =       0xe6a7
965
_EP4FIFOFLGS    =       0xe6a8
966
_EP6FIFOFLGS    =       0xe6a9
967
_EP8FIFOFLGS    =       0xe6aa
968
_EP2FIFOBCH     =       0xe6ab
969
_EP2FIFOBCL     =       0xe6ac
970
_EP4FIFOBCH     =       0xe6ad
971
_EP4FIFOBCL     =       0xe6ae
972
_EP6FIFOBCH     =       0xe6af
973
_EP6FIFOBCL     =       0xe6b0
974
_EP8FIFOBCH     =       0xe6b1
975
_EP8FIFOBCL     =       0xe6b2
976
_SUDPTRH        =       0xe6b3
977
_SUDPTRL        =       0xe6b4
978
_SUDPTRCTL      =       0xe6b5
979
_SETUPDAT       =       0xe6b8
980
_bmRequestType  =       0xe6b8
981
_bRequest       =       0xe6b9
982
_wValueL        =       0xe6ba
983
_wValueH        =       0xe6bb
984
_wIndexL        =       0xe6bc
985
_wIndexH        =       0xe6bd
986
_wLengthL       =       0xe6be
987
_wLengthH       =       0xe6bf
988
_GPIFWFSELECT   =       0xe6c0
989
_GPIFIDLECS     =       0xe6c1
990
_GPIFIDLECTL    =       0xe6c2
991
_GPIFCTLCFG     =       0xe6c3
992
_GPIFADRH       =       0xe6c4
993
_GPIFADRL       =       0xe6c5
994
_FLOWSTATE      =       0xe6c6
995
_FLOWLOGIC      =       0xe6c7
996
_FLOWEQ0CTL     =       0xe6c8
997
_FLOWEQ1CTL     =       0xe6c9
998
_FLOWHOLDOFF    =       0xe6ca
999
_FLOWSTB        =       0xe6cb
1000
_FLOWSTBEDGE    =       0xe6cc
1001
_FLOWSTBHPERIOD =       0xe6cd
1002
_GPIFTCB3       =       0xe6ce
1003
_GPIFTCB2       =       0xe6cf
1004
_GPIFTCB1       =       0xe6d0
1005
_GPIFTCB0       =       0xe6d1
1006
_EP2GPIFFLGSEL  =       0xe6d2
1007
_EP2GPIFPFSTOP  =       0xe6d3
1008
_EP2GPIFTRIG    =       0xe6d4
1009
_EP4GPIFFLGSEL  =       0xe6da
1010
_EP4GPIFPFSTOP  =       0xe6db
1011
_EP4GPIFTRIG    =       0xe6dc
1012
_EP6GPIFFLGSEL  =       0xe6e2
1013
_EP6GPIFPFSTOP  =       0xe6e3
1014
_EP6GPIFTRIG    =       0xe6e4
1015
_EP8GPIFFLGSEL  =       0xe6ea
1016
_EP8GPIFPFSTOP  =       0xe6eb
1017
_EP8GPIFTRIG    =       0xe6ec
1018
_XGPIFSGLDATH   =       0xe6f0
1019
_XGPIFSGLDATLX  =       0xe6f1
1020
_XGPIFSGLDATLNOX        =       0xe6f2
1021
_GPIFREADYCFG   =       0xe6f3
1022
_GPIFREADYSTAT  =       0xe6f4
1023
_GPIFABORT      =       0xe6f5
1024
_EP0BUF =       0xe740
1025
_EP1OUTBUF      =       0xe780
1026
_EP1INBUF       =       0xe7c0
1027
_EP2FIFOBUF     =       0xf000
1028
_EP4FIFOBUF     =       0xf400
1029
_EP6FIFOBUF     =       0xf800
1030
_EP8FIFOBUF     =       0xfc00
1031
_INT0VEC_IE0    =       0x0003
1032
_INT1VEC_T0     =       0x000b
1033
_INT2VEC_IE1    =       0x0013
1034
_INT3VEC_T1     =       0x001b
1035
_INT4VEC_USART0 =       0x0023
1036
_INT5VEC_T2     =       0x002b
1037
_INT6VEC_RESUME =       0x0033
1038
_INT7VEC_USART1 =       0x003b
1039
_INT8VEC_USB    =       0x0043
1040
_INT9VEC_I2C    =       0x004b
1041
_INT10VEC_GPIF  =       0x0053
1042
_INT11VEC_IE5   =       0x005b
1043
_INT12VEC_IE6   =       0x0063
1044
_INTVEC_SUDAV   =       0x0100
1045
_INTVEC_SOF     =       0x0104
1046
_INTVEC_SUTOK   =       0x0108
1047
_INTVEC_SUSPEND =       0x010c
1048
_INTVEC_USBRESET        =       0x0110
1049
_INTVEC_HISPEED =       0x0114
1050
_INTVEC_EP0ACK  =       0x0118
1051
_INTVEC_EP0IN   =       0x0120
1052
_INTVEC_EP0OUT  =       0x0124
1053
_INTVEC_EP1IN   =       0x0128
1054
_INTVEC_EP1OUT  =       0x012c
1055
_INTVEC_EP2     =       0x0130
1056
_INTVEC_EP4     =       0x0134
1057
_INTVEC_EP6     =       0x0138
1058
_INTVEC_EP8     =       0x013c
1059
_INTVEC_IBN     =       0x0140
1060
_INTVEC_EP0PING =       0x0148
1061
_INTVEC_EP1PING =       0x014c
1062
_INTVEC_EP2PING =       0x0150
1063
_INTVEC_EP4PING =       0x0154
1064
_INTVEC_EP6PING =       0x0158
1065
_INTVEC_EP8PING =       0x015c
1066
_INTVEC_ERRLIMIT        =       0x0160
1067
_INTVEC_EP2ISOERR       =       0x0170
1068
_INTVEC_EP4ISOERR       =       0x0174
1069
_INTVEC_EP6ISOERR       =       0x0178
1070
_INTVEC_EP8ISOERR       =       0x017c
1071
_INTVEC_EP2PF   =       0x0180
1072
_INTVEC_EP4PF   =       0x0184
1073
_INTVEC_EP6PF   =       0x0188
1074
_INTVEC_EP8PF   =       0x018c
1075
_INTVEC_EP2EF   =       0x0190
1076
_INTVEC_EP4EF   =       0x0194
1077
_INTVEC_EP6EF   =       0x0198
1078
_INTVEC_EP8EF   =       0x019c
1079
_INTVEC_EP2FF   =       0x01a0
1080
_INTVEC_EP6FF   =       0x01a8
1081
_INTVEC_EP8FF   =       0x01ac
1082
_INTVEC_GPIFDONE        =       0x01b0
1083
_INTVEC_GPIFWF  =       0x01b4
1084
_eeprom_addr::
1085
        .ds 2
1086
_eeprom_write_bytes::
1087
        .ds 2
1088
_eeprom_write_checksum::
1089
        .ds 1
1090
_mac_eeprom_addr::
1091
        .ds 1
1092
_config_data_valid::
1093
        .ds 1
1094
_flash_enabled::
1095
        .ds 1
1096
_flash_sector_size::
1097
        .ds 2
1098
_flash_sectors::
1099
        .ds 4
1100
_flash_ec::
1101
        .ds 1
1102
_spi_vendor::
1103
        .ds 1
1104
_spi_device::
1105
        .ds 1
1106
_spi_memtype::
1107
        .ds 1
1108
_spi_erase_cmd::
1109
        .ds 1
1110
_spi_last_cmd::
1111
        .ds 1
1112
_spi_buffer::
1113
        .ds 4
1114
_spi_write_addr_hi::
1115
        .ds 2
1116
_spi_write_addr_lo::
1117
        .ds 1
1118
_spi_need_pp::
1119
        .ds 1
1120
_spi_write_sector::
1121
        .ds 2
1122
_ep0_read_mode::
1123
        .ds 1
1124
_ep0_write_mode::
1125
        .ds 1
1126
_fpga_checksum::
1127
        .ds 1
1128
_fpga_bytes::
1129
        .ds 4
1130
_fpga_init_b::
1131
        .ds 1
1132
_fpga_flash_result::
1133
        .ds 1
1134
_fpga_conf_initialized::
1135
        .ds 1
1136
_OOEA::
1137
        .ds 1
1138
_fpga_first_free_sector_buf_1_1:
1139
        .ds 4
1140
_fpga_configure_from_flash_init_buf_1_1:
1141
        .ds 4
1142
_ZTEX_DESCRIPTOR        =       0x006c
1143
_ZTEX_DESCRIPTOR_VERSION        =       0x006d
1144
_ZTEXID =       0x006e
1145
_PRODUCT_ID     =       0x0072
1146
_FW_VERSION     =       0x0076
1147
_INTERFACE_VERSION      =       0x0077
1148
_INTERFACE_CAPABILITIES =       0x0078
1149
_MODULE_RESERVED        =       0x007e
1150
_SN_STRING      =       0x008a
1151
_mac_eeprom_init_buf_1_1:
1152
        .ds 5
1153
;--------------------------------------------------------
1154
; absolute external ram data
1155
;--------------------------------------------------------
1156
        .area XABS    (ABS,XDATA)
1157
;--------------------------------------------------------
1158
; external initialized ram data
1159
;--------------------------------------------------------
1160
        .area XISEG   (XDATA)
1161
_ep0_payload_remaining::
1162
        .ds 2
1163
_ep0_payload_transfer::
1164
        .ds 1
1165
_ep0_prev_setup_request::
1166
        .ds 1
1167
_ep0_vendor_cmd_setup::
1168
        .ds 1
1169
_ISOFRAME_COUNTER::
1170
        .ds 8
1171
        .area HOME    (CODE)
1172
        .area GSINIT0 (CODE)
1173
        .area GSINIT1 (CODE)
1174
        .area GSINIT2 (CODE)
1175
        .area GSINIT3 (CODE)
1176
        .area GSINIT4 (CODE)
1177
        .area GSINIT5 (CODE)
1178
        .area GSINIT  (CODE)
1179
        .area GSFINAL (CODE)
1180
        .area CSEG    (CODE)
1181
;--------------------------------------------------------
1182
; interrupt vector
1183
;--------------------------------------------------------
1184
        .area HOME    (CODE)
1185
__interrupt_vect:
1186
        ljmp    __sdcc_gsinit_startup
1187
;--------------------------------------------------------
1188
; global & static initialisations
1189
;--------------------------------------------------------
1190
        .area HOME    (CODE)
1191
        .area GSINIT  (CODE)
1192
        .area GSFINAL (CODE)
1193
        .area GSINIT  (CODE)
1194
        .globl __sdcc_gsinit_startup
1195
        .globl __sdcc_program_startup
1196
        .globl __start__stack
1197
        .globl __mcs51_genXINIT
1198
        .globl __mcs51_genXRAMCLEAR
1199
        .globl __mcs51_genRAMCLEAR
1200
        .area GSFINAL (CODE)
1201
        ljmp    __sdcc_program_startup
1202
;--------------------------------------------------------
1203
; Home
1204
;--------------------------------------------------------
1205
        .area HOME    (CODE)
1206
        .area HOME    (CODE)
1207
__sdcc_program_startup:
1208
        lcall   _main
1209
;       return from main will lock up
1210
        sjmp .
1211
;--------------------------------------------------------
1212
; code
1213
;--------------------------------------------------------
1214
        .area CSEG    (CODE)
1215
;------------------------------------------------------------
1216
;Allocation info for local variables in function 'abscode_intvec'
1217
;------------------------------------------------------------
1218
;------------------------------------------------------------
1219
;       ../../include/ezintavecs.h:92: void abscode_intvec()// _naked
1220
;       -----------------------------------------
1221
;        function abscode_intvec
1222
;       -----------------------------------------
1223
_abscode_intvec:
1224
        ar2 = 0x02
1225
        ar3 = 0x03
1226
        ar4 = 0x04
1227
        ar5 = 0x05
1228
        ar6 = 0x06
1229
        ar7 = 0x07
1230
        ar0 = 0x00
1231
        ar1 = 0x01
1232
;       ../../include/ezintavecs.h:317: ERROR: no line number 317 in file ../../include/ezintavecs.h
1233
 
1234
            .area ABSCODE (ABS,CODE)
1235
            .org 0x0000
1236
        ENTRY:
1237
         ljmp #0x0200
1238
;       # 94 "../../include/ezintavecs.h"
1239
            .org 0x0003
1240
;       # 34 "../../include/ezintavecs.h"
1241
         reti
1242
;       # 94 "../../include/ezintavecs.h"
1243
            .org 0x000b
1244
;       # 35 "../../include/ezintavecs.h"
1245
         reti
1246
;       # 94 "../../include/ezintavecs.h"
1247
            .org 0x0013
1248
;       # 36 "../../include/ezintavecs.h"
1249
         reti
1250
;       # 94 "../../include/ezintavecs.h"
1251
            .org 0x001b
1252
;       # 37 "../../include/ezintavecs.h"
1253
         reti
1254
;       # 94 "../../include/ezintavecs.h"
1255
            .org 0x0023
1256
;       # 38 "../../include/ezintavecs.h"
1257
         reti
1258
;       # 94 "../../include/ezintavecs.h"
1259
            .org 0x002b
1260
;       # 39 "../../include/ezintavecs.h"
1261
         reti
1262
;       # 94 "../../include/ezintavecs.h"
1263
            .org 0x0033
1264
;       # 40 "../../include/ezintavecs.h"
1265
         reti
1266
;       # 94 "../../include/ezintavecs.h"
1267
            .org 0x003b
1268
;       # 41 "../../include/ezintavecs.h"
1269
         reti
1270
;       # 94 "../../include/ezintavecs.h"
1271
            .org 0x0043
1272
;       # 42 "../../include/ezintavecs.h"
1273
         reti
1274
;       # 94 "../../include/ezintavecs.h"
1275
            .org 0x004b
1276
;       # 43 "../../include/ezintavecs.h"
1277
         reti
1278
;       # 94 "../../include/ezintavecs.h"
1279
            .org 0x0053
1280
;       # 44 "../../include/ezintavecs.h"
1281
         reti
1282
;       # 94 "../../include/ezintavecs.h"
1283
            .org 0x005b
1284
;       # 45 "../../include/ezintavecs.h"
1285
         reti
1286
;       # 94 "../../include/ezintavecs.h"
1287
            .org 0x0063
1288
;       # 46 "../../include/ezintavecs.h"
1289
         reti
1290
;       # 94 "../../include/ezintavecs.h"
1291
            .org 0x0100
1292
;       # 47 "../../include/ezintavecs.h"
1293
         reti
1294
;       # 94 "../../include/ezintavecs.h"
1295
            .org 0x0104
1296
;       # 48 "../../include/ezintavecs.h"
1297
         reti
1298
;       # 94 "../../include/ezintavecs.h"
1299
            .org 0x0108
1300
;       # 49 "../../include/ezintavecs.h"
1301
         reti
1302
;       # 94 "../../include/ezintavecs.h"
1303
            .org 0x010C
1304
;       # 50 "../../include/ezintavecs.h"
1305
         reti
1306
;       # 94 "../../include/ezintavecs.h"
1307
            .org 0x0110
1308
;       # 51 "../../include/ezintavecs.h"
1309
         reti
1310
;       # 94 "../../include/ezintavecs.h"
1311
            .org 0x0114
1312
;       # 52 "../../include/ezintavecs.h"
1313
         reti
1314
;       # 94 "../../include/ezintavecs.h"
1315
            .org 0x0118
1316
;       # 53 "../../include/ezintavecs.h"
1317
         reti
1318
;       # 94 "../../include/ezintavecs.h"
1319
            .org 0x0120
1320
;       # 54 "../../include/ezintavecs.h"
1321
         reti
1322
;       # 94 "../../include/ezintavecs.h"
1323
            .org 0x0124
1324
;       # 55 "../../include/ezintavecs.h"
1325
         reti
1326
;       # 94 "../../include/ezintavecs.h"
1327
            .org 0x0128
1328
;       # 56 "../../include/ezintavecs.h"
1329
         reti
1330
;       # 94 "../../include/ezintavecs.h"
1331
            .org 0x012C
1332
;       # 57 "../../include/ezintavecs.h"
1333
         reti
1334
;       # 94 "../../include/ezintavecs.h"
1335
            .org 0x0130
1336
;       # 58 "../../include/ezintavecs.h"
1337
         reti
1338
;       # 94 "../../include/ezintavecs.h"
1339
            .org 0x0134
1340
;       # 59 "../../include/ezintavecs.h"
1341
         reti
1342
;       # 94 "../../include/ezintavecs.h"
1343
            .org 0x0138
1344
;       # 60 "../../include/ezintavecs.h"
1345
         reti
1346
;       # 94 "../../include/ezintavecs.h"
1347
            .org 0x013C
1348
;       # 61 "../../include/ezintavecs.h"
1349
         reti
1350
;       # 94 "../../include/ezintavecs.h"
1351
            .org 0x0140
1352
;       # 62 "../../include/ezintavecs.h"
1353
         reti
1354
;       # 94 "../../include/ezintavecs.h"
1355
            .org 0x0148
1356
;       # 63 "../../include/ezintavecs.h"
1357
         reti
1358
;       # 94 "../../include/ezintavecs.h"
1359
            .org 0x014C
1360
;       # 64 "../../include/ezintavecs.h"
1361
         reti
1362
;       # 94 "../../include/ezintavecs.h"
1363
            .org 0x0150
1364
;       # 65 "../../include/ezintavecs.h"
1365
         reti
1366
;       # 94 "../../include/ezintavecs.h"
1367
            .org 0x0154
1368
;       # 66 "../../include/ezintavecs.h"
1369
         reti
1370
;       # 94 "../../include/ezintavecs.h"
1371
            .org 0x0158
1372
;       # 67 "../../include/ezintavecs.h"
1373
         reti
1374
;       # 94 "../../include/ezintavecs.h"
1375
            .org 0x015C
1376
;       # 68 "../../include/ezintavecs.h"
1377
         reti
1378
;       # 94 "../../include/ezintavecs.h"
1379
            .org 0x0160
1380
;       # 69 "../../include/ezintavecs.h"
1381
         reti
1382
;       # 94 "../../include/ezintavecs.h"
1383
            .org 0x0170
1384
;       # 70 "../../include/ezintavecs.h"
1385
         reti
1386
;       # 94 "../../include/ezintavecs.h"
1387
            .org 0x0174
1388
;       # 71 "../../include/ezintavecs.h"
1389
         reti
1390
;       # 94 "../../include/ezintavecs.h"
1391
            .org 0x0178
1392
;       # 72 "../../include/ezintavecs.h"
1393
         reti
1394
;       # 94 "../../include/ezintavecs.h"
1395
            .org 0x017C
1396
;       # 73 "../../include/ezintavecs.h"
1397
         reti
1398
;       # 94 "../../include/ezintavecs.h"
1399
            .org 0x0180
1400
;       # 74 "../../include/ezintavecs.h"
1401
         reti
1402
;       # 94 "../../include/ezintavecs.h"
1403
            .org 0x0184
1404
;       # 75 "../../include/ezintavecs.h"
1405
         reti
1406
;       # 94 "../../include/ezintavecs.h"
1407
            .org 0x0188
1408
;       # 76 "../../include/ezintavecs.h"
1409
         reti
1410
;       # 94 "../../include/ezintavecs.h"
1411
            .org 0x018C
1412
;       # 77 "../../include/ezintavecs.h"
1413
         reti
1414
;       # 94 "../../include/ezintavecs.h"
1415
            .org 0x0190
1416
;       # 78 "../../include/ezintavecs.h"
1417
         reti
1418
;       # 94 "../../include/ezintavecs.h"
1419
            .org 0x0194
1420
;       # 79 "../../include/ezintavecs.h"
1421
         reti
1422
;       # 94 "../../include/ezintavecs.h"
1423
            .org 0x0198
1424
;       # 80 "../../include/ezintavecs.h"
1425
         reti
1426
;       # 94 "../../include/ezintavecs.h"
1427
            .org 0x019C
1428
;       # 81 "../../include/ezintavecs.h"
1429
         reti
1430
;       # 94 "../../include/ezintavecs.h"
1431
            .org 0x01A0
1432
;       # 82 "../../include/ezintavecs.h"
1433
         reti
1434
;       # 94 "../../include/ezintavecs.h"
1435
            .org 0x01A8
1436
;       # 83 "../../include/ezintavecs.h"
1437
         reti
1438
;       # 94 "../../include/ezintavecs.h"
1439
            .org 0x01AC
1440
;       # 84 "../../include/ezintavecs.h"
1441
         reti
1442
;       # 94 "../../include/ezintavecs.h"
1443
            .org 0x01B0
1444
;       # 85 "../../include/ezintavecs.h"
1445
         reti
1446
;       # 94 "../../include/ezintavecs.h"
1447
            .org 0x01B4
1448
;       # 101 "../../include/ezintavecs.h"
1449
         reti
1450
            .org 0x01b8
1451
        INTVEC_DUMMY:
1452
                reti
1453
            .area CSEG (CODE)
1454
 
1455
        ret
1456
;------------------------------------------------------------
1457
;Allocation info for local variables in function 'wait'
1458
;------------------------------------------------------------
1459
;ms                        Allocated to registers r2 r3
1460
;i                         Allocated to registers r6 r7
1461
;j                         Allocated to registers r4 r5
1462
;------------------------------------------------------------
1463
;       ../../include/ztex-utils.h:78: void wait(WORD short ms) {         // wait in ms
1464
;       -----------------------------------------
1465
;        function wait
1466
;       -----------------------------------------
1467
_wait:
1468
        mov     r2,dpl
1469
        mov     r3,dph
1470
;       ../../include/ztex-utils.h:80: for (j=0; j
1471
        mov     r4,#0x00
1472
        mov     r5,#0x00
1473
00104$:
1474
        clr     c
1475
        mov     a,r4
1476
        subb    a,r2
1477
        mov     a,r5
1478
        subb    a,r3
1479
        jnc     00108$
1480
;       ../../include/ztex-utils.h:81: for (i=0; i<1200; i++);
1481
        mov     r6,#0xB0
1482
        mov     r7,#0x04
1483
00103$:
1484
        dec     r6
1485
        cjne    r6,#0xff,00117$
1486
        dec     r7
1487
00117$:
1488
        mov     a,r6
1489
        orl     a,r7
1490
        jnz     00103$
1491
;       ../../include/ztex-utils.h:80: for (j=0; j
1492
        inc     r4
1493
        cjne    r4,#0x00,00104$
1494
        inc     r5
1495
        sjmp    00104$
1496
00108$:
1497
        ret
1498
;------------------------------------------------------------
1499
;Allocation info for local variables in function 'uwait'
1500
;------------------------------------------------------------
1501
;us                        Allocated to registers r2 r3
1502
;i                         Allocated to registers r6 r7
1503
;j                         Allocated to registers r4 r5
1504
;------------------------------------------------------------
1505
;       ../../include/ztex-utils.h:88: void uwait(WORD short us) {        // wait in 10µs steps
1506
;       -----------------------------------------
1507
;        function uwait
1508
;       -----------------------------------------
1509
_uwait:
1510
        mov     r2,dpl
1511
        mov     r3,dph
1512
;       ../../include/ztex-utils.h:90: for (j=0; j
1513
        mov     r4,#0x00
1514
        mov     r5,#0x00
1515
00104$:
1516
        clr     c
1517
        mov     a,r4
1518
        subb    a,r2
1519
        mov     a,r5
1520
        subb    a,r3
1521
        jnc     00108$
1522
;       ../../include/ztex-utils.h:91: for (i=0; i<10; i++);
1523
        mov     r6,#0x0A
1524
        mov     r7,#0x00
1525
00103$:
1526
        dec     r6
1527
        cjne    r6,#0xff,00117$
1528
        dec     r7
1529
00117$:
1530
        mov     a,r6
1531
        orl     a,r7
1532
        jnz     00103$
1533
;       ../../include/ztex-utils.h:90: for (j=0; j
1534
        inc     r4
1535
        cjne    r4,#0x00,00104$
1536
        inc     r5
1537
        sjmp    00104$
1538
00108$:
1539
        ret
1540
;------------------------------------------------------------
1541
;Allocation info for local variables in function 'MEM_COPY1_int'
1542
;------------------------------------------------------------
1543
;------------------------------------------------------------
1544
;       ../../include/ztex-utils.h:99: void MEM_COPY1_int() // __naked
1545
;       -----------------------------------------
1546
;        function MEM_COPY1_int
1547
;       -----------------------------------------
1548
_MEM_COPY1_int:
1549
;       ../../include/ztex-utils.h:110: __endasm;
1550
 
1551
        020001$:
1552
             mov _AUTOPTRSETUP,#0x07
1553
             mov dptr,#_XAUTODAT1
1554
             movx a,@dptr
1555
             mov dptr,#_XAUTODAT2
1556
             movx @dptr,a
1557
             djnz r2, 020001$
1558
             ret
1559
 
1560
        ret
1561
;------------------------------------------------------------
1562
;Allocation info for local variables in function 'i2c_waitWrite'
1563
;------------------------------------------------------------
1564
;i2csbuf                   Allocated to registers r2
1565
;toc                       Allocated to registers r2
1566
;------------------------------------------------------------
1567
;       ../../include/ztex-eeprom.h:41: BYTE i2c_waitWrite()
1568
;       -----------------------------------------
1569
;        function i2c_waitWrite
1570
;       -----------------------------------------
1571
_i2c_waitWrite:
1572
;       ../../include/ztex-eeprom.h:44: for ( toc=0; toc<255 && !(I2CS & bmBIT0); toc++ );
1573
        mov     r2,#0x00
1574
00105$:
1575
        cjne    r2,#0xFF,00116$
1576
00116$:
1577
        jnc     00108$
1578
        mov     dptr,#_I2CS
1579
        movx    a,@dptr
1580
        mov     r3,a
1581
        jb      acc.0,00108$
1582
        inc     r2
1583
        sjmp    00105$
1584
00108$:
1585
;       ../../include/ztex-eeprom.h:45: i2csbuf = I2CS;
1586
        mov     dptr,#_I2CS
1587
        movx    a,@dptr
1588
;       ../../include/ztex-eeprom.h:46: if ( (i2csbuf & bmBIT2) || (!(i2csbuf & bmBIT1)) ) {
1589
        mov     r2,a
1590
        jb      acc.2,00101$
1591
        mov     a,r2
1592
        jb      acc.1,00102$
1593
00101$:
1594
;       ../../include/ztex-eeprom.h:47: I2CS |= bmBIT6;
1595
        mov     dptr,#_I2CS
1596
        movx    a,@dptr
1597
        orl     a,#0x40
1598
        movx    @dptr,a
1599
;       ../../include/ztex-eeprom.h:48: return 1;
1600
        mov     dpl,#0x01
1601
;       ../../include/ztex-eeprom.h:50: return 0;
1602
        ret
1603
00102$:
1604
        mov     dpl,#0x00
1605
        ret
1606
;------------------------------------------------------------
1607
;Allocation info for local variables in function 'i2c_waitRead'
1608
;------------------------------------------------------------
1609
;i2csbuf                   Allocated to registers r2
1610
;toc                       Allocated to registers r2
1611
;------------------------------------------------------------
1612
;       ../../include/ztex-eeprom.h:57: BYTE i2c_waitRead(void)
1613
;       -----------------------------------------
1614
;        function i2c_waitRead
1615
;       -----------------------------------------
1616
_i2c_waitRead:
1617
;       ../../include/ztex-eeprom.h:60: for ( toc=0; toc<255 && !(I2CS & bmBIT0); toc++ );
1618
        mov     r2,#0x00
1619
00104$:
1620
        cjne    r2,#0xFF,00115$
1621
00115$:
1622
        jnc     00107$
1623
        mov     dptr,#_I2CS
1624
        movx    a,@dptr
1625
        mov     r3,a
1626
        jb      acc.0,00107$
1627
        inc     r2
1628
        sjmp    00104$
1629
00107$:
1630
;       ../../include/ztex-eeprom.h:61: i2csbuf = I2CS;
1631
        mov     dptr,#_I2CS
1632
        movx    a,@dptr
1633
;       ../../include/ztex-eeprom.h:62: if (i2csbuf & bmBIT2) {
1634
        mov     r2,a
1635
        jnb     acc.2,00102$
1636
;       ../../include/ztex-eeprom.h:63: I2CS |= bmBIT6;
1637
        mov     dptr,#_I2CS
1638
        movx    a,@dptr
1639
        orl     a,#0x40
1640
        movx    @dptr,a
1641
;       ../../include/ztex-eeprom.h:64: return 1;
1642
        mov     dpl,#0x01
1643
;       ../../include/ztex-eeprom.h:66: return 0;
1644
        ret
1645
00102$:
1646
        mov     dpl,#0x00
1647
        ret
1648
;------------------------------------------------------------
1649
;Allocation info for local variables in function 'i2c_waitStart'
1650
;------------------------------------------------------------
1651
;toc                       Allocated to registers r2
1652
;------------------------------------------------------------
1653
;       ../../include/ztex-eeprom.h:73: BYTE i2c_waitStart()
1654
;       -----------------------------------------
1655
;        function i2c_waitStart
1656
;       -----------------------------------------
1657
_i2c_waitStart:
1658
;       ../../include/ztex-eeprom.h:76: for ( toc=0; toc<255; toc++ ) {
1659
        mov     r2,#0x00
1660
00103$:
1661
        cjne    r2,#0xFF,00112$
1662
00112$:
1663
        jnc     00106$
1664
;       ../../include/ztex-eeprom.h:77: if ( ! (I2CS & bmBIT2) )
1665
        mov     dptr,#_I2CS
1666
        movx    a,@dptr
1667
        mov     r3,a
1668
        jb      acc.2,00105$
1669
;       ../../include/ztex-eeprom.h:78: return 0;
1670
        mov     dpl,#0x00
1671
        ret
1672
00105$:
1673
;       ../../include/ztex-eeprom.h:76: for ( toc=0; toc<255; toc++ ) {
1674
        inc     r2
1675
        sjmp    00103$
1676
00106$:
1677
;       ../../include/ztex-eeprom.h:80: return 1;
1678
        mov     dpl,#0x01
1679
        ret
1680
;------------------------------------------------------------
1681
;Allocation info for local variables in function 'i2c_waitStop'
1682
;------------------------------------------------------------
1683
;toc                       Allocated to registers r2
1684
;------------------------------------------------------------
1685
;       ../../include/ztex-eeprom.h:87: BYTE i2c_waitStop()
1686
;       -----------------------------------------
1687
;        function i2c_waitStop
1688
;       -----------------------------------------
1689
_i2c_waitStop:
1690
;       ../../include/ztex-eeprom.h:90: for ( toc=0; toc<255; toc++ ) {
1691
        mov     r2,#0x00
1692
00103$:
1693
        cjne    r2,#0xFF,00112$
1694
00112$:
1695
        jnc     00106$
1696
;       ../../include/ztex-eeprom.h:91: if ( ! (I2CS & bmBIT6) )
1697
        mov     dptr,#_I2CS
1698
        movx    a,@dptr
1699
        mov     r3,a
1700
        jb      acc.6,00105$
1701
;       ../../include/ztex-eeprom.h:92: return 0;
1702
        mov     dpl,#0x00
1703
        ret
1704
00105$:
1705
;       ../../include/ztex-eeprom.h:90: for ( toc=0; toc<255; toc++ ) {
1706
        inc     r2
1707
        sjmp    00103$
1708
00106$:
1709
;       ../../include/ztex-eeprom.h:94: return 1;
1710
        mov     dpl,#0x01
1711
        ret
1712
;------------------------------------------------------------
1713
;Allocation info for local variables in function 'eeprom_select'
1714
;------------------------------------------------------------
1715
;to                        Allocated with name '_eeprom_select_PARM_2'
1716
;stop                      Allocated with name '_eeprom_select_PARM_3'
1717
;addr                      Allocated to registers r2
1718
;toc                       Allocated to registers
1719
;------------------------------------------------------------
1720
;       ../../include/ztex-eeprom.h:103: BYTE eeprom_select (BYTE addr, BYTE to, BYTE stop ) {
1721
;       -----------------------------------------
1722
;        function eeprom_select
1723
;       -----------------------------------------
1724
_eeprom_select:
1725
        mov     r2,dpl
1726
;       ../../include/ztex-eeprom.h:105: eeprom_select_start:
1727
        clr     c
1728
        clr     a
1729
        subb    a,_eeprom_select_PARM_2
1730
        clr     a
1731
        rlc     a
1732
        mov     r3,a
1733
00101$:
1734
;       ../../include/ztex-eeprom.h:106: I2CS |= bmBIT7;                // start bit
1735
        mov     dptr,#_I2CS
1736
        movx    a,@dptr
1737
        orl     a,#0x80
1738
        movx    @dptr,a
1739
;       ../../include/ztex-eeprom.h:107: i2c_waitStart();
1740
        push    ar2
1741
        push    ar3
1742
        lcall   _i2c_waitStart
1743
        pop     ar3
1744
        pop     ar2
1745
;       ../../include/ztex-eeprom.h:108: I2DAT = addr;          // select device for writing
1746
        mov     dptr,#_I2DAT
1747
        mov     a,r2
1748
        movx    @dptr,a
1749
;       ../../include/ztex-eeprom.h:109: if ( ! i2c_waitWrite() ) {
1750
        push    ar2
1751
        push    ar3
1752
        lcall   _i2c_waitWrite
1753
        mov     a,dpl
1754
        pop     ar3
1755
        pop     ar2
1756
        jnz     00107$
1757
;       ../../include/ztex-eeprom.h:110: if ( stop ) {
1758
        mov     a,_eeprom_select_PARM_3
1759
        jz      00103$
1760
;       ../../include/ztex-eeprom.h:111: I2CS |= bmBIT6;
1761
        mov     dptr,#_I2CS
1762
        movx    a,@dptr
1763
        orl     a,#0x40
1764
        movx    @dptr,a
1765
;       ../../include/ztex-eeprom.h:112: i2c_waitStop();
1766
        lcall   _i2c_waitStop
1767
00103$:
1768
;       ../../include/ztex-eeprom.h:114: return 0;
1769
        mov     dpl,#0x00
1770
        ret
1771
00107$:
1772
;       ../../include/ztex-eeprom.h:116: else if (toc
1773
        mov     a,r3
1774
        jz      00108$
1775
;       ../../include/ztex-eeprom.h:117: uwait(10);
1776
        mov     dptr,#0x000A
1777
        push    ar2
1778
        push    ar3
1779
        lcall   _uwait
1780
        pop     ar3
1781
        pop     ar2
1782
;       ../../include/ztex-eeprom.h:118: goto eeprom_select_start;
1783
        sjmp    00101$
1784
00108$:
1785
;       ../../include/ztex-eeprom.h:120: if ( stop ) {
1786
        mov     a,_eeprom_select_PARM_3
1787
        jz      00110$
1788
;       ../../include/ztex-eeprom.h:121: I2CS |= bmBIT6;
1789
        mov     dptr,#_I2CS
1790
        movx    a,@dptr
1791
        mov     r2,a
1792
        orl     a,#0x40
1793
        movx    @dptr,a
1794
00110$:
1795
;       ../../include/ztex-eeprom.h:123: return 1;
1796
        mov     dpl,#0x01
1797
        ret
1798
;------------------------------------------------------------
1799
;Allocation info for local variables in function 'eeprom_read'
1800
;------------------------------------------------------------
1801
;addr                      Allocated with name '_eeprom_read_PARM_2'
1802
;length                    Allocated with name '_eeprom_read_PARM_3'
1803
;buf                       Allocated to registers r2 r3
1804
;bytes                     Allocated to registers r4
1805
;i                         Allocated to registers
1806
;------------------------------------------------------------
1807
;       ../../include/ztex-eeprom.h:131: BYTE eeprom_read ( __xdata BYTE *buf, WORD addr, BYTE length ) {
1808
;       -----------------------------------------
1809
;        function eeprom_read
1810
;       -----------------------------------------
1811
_eeprom_read:
1812
        mov     r2,dpl
1813
        mov     r3,dph
1814
;       ../../include/ztex-eeprom.h:132: BYTE bytes = 0,i;
1815
        mov     r4,#0x00
1816
;       ../../include/ztex-eeprom.h:134: if ( length == 0 )
1817
        mov     a,_eeprom_read_PARM_3
1818
;       ../../include/ztex-eeprom.h:135: return 0;
1819
        jnz     00102$
1820
        mov     dpl,a
1821
        ret
1822
00102$:
1823
;       ../../include/ztex-eeprom.h:137: if ( eeprom_select(EEPROM_ADDR, 100,0) )
1824
        mov     _eeprom_select_PARM_2,#0x64
1825
        mov     _eeprom_select_PARM_3,#0x00
1826
        mov     dpl,#0xA2
1827
        push    ar2
1828
        push    ar3
1829
        push    ar4
1830
        lcall   _eeprom_select
1831
        mov     a,dpl
1832
        pop     ar4
1833
        pop     ar3
1834
        pop     ar2
1835
        jz      00134$
1836
        ljmp    00117$
1837
00134$:
1838
;       ../../include/ztex-eeprom.h:140: I2DAT = HI(addr);              // write address
1839
        mov     dptr,#_I2DAT
1840
        mov     a,(_eeprom_read_PARM_2 + 1)
1841
        movx    @dptr,a
1842
;       ../../include/ztex-eeprom.h:141: if ( i2c_waitWrite() ) goto eeprom_read_end;
1843
        push    ar2
1844
        push    ar3
1845
        push    ar4
1846
        lcall   _i2c_waitWrite
1847
        mov     a,dpl
1848
        pop     ar4
1849
        pop     ar3
1850
        pop     ar2
1851
        jz      00135$
1852
        ljmp    00117$
1853
00135$:
1854
;       ../../include/ztex-eeprom.h:142: I2DAT = LO(addr);              // write address
1855
        mov     dptr,#_I2DAT
1856
        mov     a,_eeprom_read_PARM_2
1857
        movx    @dptr,a
1858
;       ../../include/ztex-eeprom.h:143: if ( i2c_waitWrite() ) goto eeprom_read_end;
1859
        push    ar2
1860
        push    ar3
1861
        push    ar4
1862
        lcall   _i2c_waitWrite
1863
        mov     a,dpl
1864
        pop     ar4
1865
        pop     ar3
1866
        pop     ar2
1867
        jz      00136$
1868
        ljmp    00117$
1869
00136$:
1870
;       ../../include/ztex-eeprom.h:144: I2CS |= bmBIT6;
1871
        mov     dptr,#_I2CS
1872
        movx    a,@dptr
1873
        orl     a,#0x40
1874
        movx    @dptr,a
1875
;       ../../include/ztex-eeprom.h:145: i2c_waitStop();
1876
        push    ar2
1877
        push    ar3
1878
        push    ar4
1879
        lcall   _i2c_waitStop
1880
;       ../../include/ztex-eeprom.h:147: I2CS |= bmBIT7;                // start bit
1881
        mov     dptr,#_I2CS
1882
        movx    a,@dptr
1883
        orl     a,#0x80
1884
        movx    @dptr,a
1885
;       ../../include/ztex-eeprom.h:148: i2c_waitStart();
1886
        lcall   _i2c_waitStart
1887
;       ../../include/ztex-eeprom.h:149: I2DAT = EEPROM_ADDR | 1;       // select device for reading
1888
        mov     dptr,#_I2DAT
1889
        mov     a,#0xA3
1890
        movx    @dptr,a
1891
;       ../../include/ztex-eeprom.h:150: if ( i2c_waitWrite() ) goto eeprom_read_end;
1892
        lcall   _i2c_waitWrite
1893
        mov     a,dpl
1894
        pop     ar4
1895
        pop     ar3
1896
        pop     ar2
1897
        jnz     00117$
1898
;       ../../include/ztex-eeprom.h:152: *buf = I2DAT;          // dummy read
1899
        mov     dptr,#_I2DAT
1900
        movx    a,@dptr
1901
        mov     dpl,r2
1902
        mov     dph,r3
1903
        movx    @dptr,a
1904
;       ../../include/ztex-eeprom.h:153: if ( i2c_waitRead()) goto eeprom_read_end;
1905
        push    ar2
1906
        push    ar3
1907
        push    ar4
1908
        lcall   _i2c_waitRead
1909
        mov     a,dpl
1910
        pop     ar4
1911
        pop     ar3
1912
        pop     ar2
1913
        jnz     00117$
1914
        mov     r5,a
1915
00118$:
1916
;       ../../include/ztex-eeprom.h:154: for (; bytes
1917
        clr     c
1918
        mov     a,r5
1919
        subb    a,_eeprom_read_PARM_3
1920
        jnc     00121$
1921
;       ../../include/ztex-eeprom.h:155: *buf = I2DAT;          // read data
1922
        mov     dptr,#_I2DAT
1923
        movx    a,@dptr
1924
        mov     dpl,r2
1925
        mov     dph,r3
1926
        movx    @dptr,a
1927
        inc     dptr
1928
        mov     r2,dpl
1929
        mov     r3,dph
1930
;       ../../include/ztex-eeprom.h:156: buf++;
1931
;       ../../include/ztex-eeprom.h:157: if ( i2c_waitRead()) goto eeprom_read_end;
1932
        push    ar2
1933
        push    ar3
1934
        push    ar4
1935
        push    ar5
1936
        lcall   _i2c_waitRead
1937
        mov     a,dpl
1938
        pop     ar5
1939
        pop     ar4
1940
        pop     ar3
1941
        pop     ar2
1942
        jnz     00117$
1943
;       ../../include/ztex-eeprom.h:154: for (; bytes
1944
        inc     r5
1945
        mov     ar4,r5
1946
        sjmp    00118$
1947
00121$:
1948
;       ../../include/ztex-eeprom.h:160: I2CS |= bmBIT5;                // no ACK
1949
        mov     dptr,#_I2CS
1950
        movx    a,@dptr
1951
        orl     a,#0x20
1952
        movx    @dptr,a
1953
;       ../../include/ztex-eeprom.h:161: i = I2DAT;                     // dummy read
1954
        mov     dptr,#_I2DAT
1955
        movx    a,@dptr
1956
;       ../../include/ztex-eeprom.h:162: if ( i2c_waitRead()) goto eeprom_read_end;
1957
        push    ar4
1958
        lcall   _i2c_waitRead
1959
        mov     a,dpl
1960
        pop     ar4
1961
        jnz     00117$
1962
;       ../../include/ztex-eeprom.h:164: I2CS |= bmBIT6;                // stop bit
1963
        mov     dptr,#_I2CS
1964
        movx    a,@dptr
1965
        orl     a,#0x40
1966
        movx    @dptr,a
1967
;       ../../include/ztex-eeprom.h:165: i = I2DAT;                     // dummy read
1968
        mov     dptr,#_I2DAT
1969
        movx    a,@dptr
1970
;       ../../include/ztex-eeprom.h:166: i2c_waitStop();
1971
        push    ar4
1972
        lcall   _i2c_waitStop
1973
        pop     ar4
1974
;       ../../include/ztex-eeprom.h:168: eeprom_read_end:
1975
00117$:
1976
;       ../../include/ztex-eeprom.h:169: return bytes;
1977
        mov     dpl,r4
1978
        ret
1979
;------------------------------------------------------------
1980
;Allocation info for local variables in function 'eeprom_write'
1981
;------------------------------------------------------------
1982
;addr                      Allocated with name '_eeprom_write_PARM_2'
1983
;length                    Allocated with name '_eeprom_write_PARM_3'
1984
;buf                       Allocated to registers r2 r3
1985
;bytes                     Allocated to registers r4
1986
;------------------------------------------------------------
1987
;       ../../include/ztex-eeprom.h:178: BYTE eeprom_write ( __xdata BYTE *buf, WORD addr, BYTE length ) {
1988
;       -----------------------------------------
1989
;        function eeprom_write
1990
;       -----------------------------------------
1991
_eeprom_write:
1992
        mov     r2,dpl
1993
        mov     r3,dph
1994
;       ../../include/ztex-eeprom.h:179: BYTE bytes = 0;
1995
        mov     r4,#0x00
1996
;       ../../include/ztex-eeprom.h:181: if ( length == 0 )
1997
        mov     a,_eeprom_write_PARM_3
1998
;       ../../include/ztex-eeprom.h:182: return 0;
1999
        jnz     00102$
2000
        mov     dpl,a
2001
        ret
2002
00102$:
2003
;       ../../include/ztex-eeprom.h:184: if ( eeprom_select(EEPROM_ADDR, 100,0) )
2004
        mov     _eeprom_select_PARM_2,#0x64
2005
        mov     _eeprom_select_PARM_3,#0x00
2006
        mov     dpl,#0xA2
2007
        push    ar2
2008
        push    ar3
2009
        push    ar4
2010
        lcall   _eeprom_select
2011
        mov     a,dpl
2012
        pop     ar4
2013
        pop     ar3
2014
        pop     ar2
2015
        jz      00125$
2016
        ljmp    00111$
2017
00125$:
2018
;       ../../include/ztex-eeprom.h:187: I2DAT = HI(addr);              // write address
2019
        mov     dptr,#_I2DAT
2020
        mov     a,(_eeprom_write_PARM_2 + 1)
2021
        movx    @dptr,a
2022
;       ../../include/ztex-eeprom.h:188: if ( i2c_waitWrite() ) goto eeprom_write_end;
2023
        push    ar2
2024
        push    ar3
2025
        push    ar4
2026
        lcall   _i2c_waitWrite
2027
        mov     a,dpl
2028
        pop     ar4
2029
        pop     ar3
2030
        pop     ar2
2031
        jz      00126$
2032
        ljmp    00111$
2033
00126$:
2034
;       ../../include/ztex-eeprom.h:189: I2DAT = LO(addr);              // write address
2035
        mov     dptr,#_I2DAT
2036
        mov     a,_eeprom_write_PARM_2
2037
        movx    @dptr,a
2038
;       ../../include/ztex-eeprom.h:190: if ( i2c_waitWrite() ) goto eeprom_write_end;
2039
        push    ar2
2040
        push    ar3
2041
        push    ar4
2042
        lcall   _i2c_waitWrite
2043
        mov     a,dpl
2044
        pop     ar4
2045
        pop     ar3
2046
        pop     ar2
2047
        jnz     00111$
2048
        mov     r5,a
2049
00112$:
2050
;       ../../include/ztex-eeprom.h:192: for (; bytes
2051
        clr     c
2052
        mov     a,r5
2053
        subb    a,_eeprom_write_PARM_3
2054
        jnc     00115$
2055
;       ../../include/ztex-eeprom.h:193: I2DAT = *buf;          // write data
2056
        mov     dpl,r2
2057
        mov     dph,r3
2058
        movx    a,@dptr
2059
        mov     r6,a
2060
        inc     dptr
2061
        mov     r2,dpl
2062
        mov     r3,dph
2063
        mov     dptr,#_I2DAT
2064
        mov     a,r6
2065
        movx    @dptr,a
2066
;       ../../include/ztex-eeprom.h:194: eeprom_write_checksum += *buf;
2067
        mov     dptr,#_eeprom_write_checksum
2068
        movx    a,@dptr
2069
        mov     r7,a
2070
        mov     a,r6
2071
        add     a,r7
2072
        movx    @dptr,a
2073
;       ../../include/ztex-eeprom.h:195: buf++;
2074
;       ../../include/ztex-eeprom.h:196: eeprom_write_bytes+=1;
2075
        mov     dptr,#_eeprom_write_bytes
2076
        movx    a,@dptr
2077
        mov     r6,a
2078
        inc     dptr
2079
        movx    a,@dptr
2080
        mov     r7,a
2081
        mov     dptr,#_eeprom_write_bytes
2082
        mov     a,#0x01
2083
        add     a,r6
2084
        movx    @dptr,a
2085
        clr     a
2086
        addc    a,r7
2087
        inc     dptr
2088
        movx    @dptr,a
2089
;       ../../include/ztex-eeprom.h:197: if ( i2c_waitWrite() ) goto eeprom_write_end;
2090
        push    ar2
2091
        push    ar3
2092
        push    ar4
2093
        push    ar5
2094
        lcall   _i2c_waitWrite
2095
        mov     a,dpl
2096
        pop     ar5
2097
        pop     ar4
2098
        pop     ar3
2099
        pop     ar2
2100
        jnz     00111$
2101
;       ../../include/ztex-eeprom.h:192: for (; bytes
2102
        inc     r5
2103
        mov     ar4,r5
2104
        sjmp    00112$
2105
00115$:
2106
;       ../../include/ztex-eeprom.h:199: I2CS |= bmBIT6;                // stop bit
2107
        mov     dptr,#_I2CS
2108
        movx    a,@dptr
2109
        orl     a,#0x40
2110
        movx    @dptr,a
2111
;       ../../include/ztex-eeprom.h:200: i2c_waitStop();
2112
        push    ar4
2113
        lcall   _i2c_waitStop
2114
        pop     ar4
2115
;       ../../include/ztex-eeprom.h:202: eeprom_write_end:
2116
00111$:
2117
;       ../../include/ztex-eeprom.h:203: return bytes;
2118
        mov     dpl,r4
2119
        ret
2120
;------------------------------------------------------------
2121
;Allocation info for local variables in function 'eeprom_read_ep0'
2122
;------------------------------------------------------------
2123
;i                         Allocated to registers r3
2124
;b                         Allocated to registers r2
2125
;------------------------------------------------------------
2126
;       ../../include/ztex-eeprom.h:209: BYTE eeprom_read_ep0 () {
2127
;       -----------------------------------------
2128
;        function eeprom_read_ep0
2129
;       -----------------------------------------
2130
_eeprom_read_ep0:
2131
;       ../../include/ztex-eeprom.h:211: b = ep0_payload_transfer;
2132
        mov     dptr,#_ep0_payload_transfer
2133
        movx    a,@dptr
2134
        mov     r2,a
2135
;       ../../include/ztex-eeprom.h:212: i = eeprom_read(EP0BUF, eeprom_addr, b);
2136
        mov     dptr,#_eeprom_addr
2137
        movx    a,@dptr
2138
        mov     _eeprom_read_PARM_2,a
2139
        inc     dptr
2140
        movx    a,@dptr
2141
        mov     (_eeprom_read_PARM_2 + 1),a
2142
        mov     _eeprom_read_PARM_3,r2
2143
        mov     dptr,#_EP0BUF
2144
        push    ar2
2145
        lcall   _eeprom_read
2146
        mov     r3,dpl
2147
        pop     ar2
2148
;       ../../include/ztex-eeprom.h:213: eeprom_addr += b;
2149
        mov     r4,#0x00
2150
        mov     dptr,#_eeprom_addr
2151
        movx    a,@dptr
2152
        mov     r5,a
2153
        inc     dptr
2154
        movx    a,@dptr
2155
        mov     r6,a
2156
        mov     dptr,#_eeprom_addr
2157
        mov     a,r2
2158
        add     a,r5
2159
        movx    @dptr,a
2160
        mov     a,r4
2161
        addc    a,r6
2162
        inc     dptr
2163
        movx    @dptr,a
2164
;       ../../include/ztex-eeprom.h:214: return i;
2165
        mov     dpl,r3
2166
        ret
2167
;------------------------------------------------------------
2168
;Allocation info for local variables in function 'eeprom_write_ep0'
2169
;------------------------------------------------------------
2170
;length                    Allocated to registers r2
2171
;------------------------------------------------------------
2172
;       ../../include/ztex-eeprom.h:230: void eeprom_write_ep0 ( BYTE length ) {
2173
;       -----------------------------------------
2174
;        function eeprom_write_ep0
2175
;       -----------------------------------------
2176
_eeprom_write_ep0:
2177
        mov     r2,dpl
2178
;       ../../include/ztex-eeprom.h:231: eeprom_write(EP0BUF, eeprom_addr, length);
2179
        mov     dptr,#_eeprom_addr
2180
        movx    a,@dptr
2181
        mov     _eeprom_write_PARM_2,a
2182
        inc     dptr
2183
        movx    a,@dptr
2184
        mov     (_eeprom_write_PARM_2 + 1),a
2185
        mov     _eeprom_write_PARM_3,r2
2186
        mov     dptr,#_EP0BUF
2187
        push    ar2
2188
        lcall   _eeprom_write
2189
        pop     ar2
2190
;       ../../include/ztex-eeprom.h:232: eeprom_addr += length;
2191
        mov     r3,#0x00
2192
        mov     dptr,#_eeprom_addr
2193
        movx    a,@dptr
2194
        mov     r4,a
2195
        inc     dptr
2196
        movx    a,@dptr
2197
        mov     r5,a
2198
        mov     dptr,#_eeprom_addr
2199
        mov     a,r2
2200
        add     a,r4
2201
        movx    @dptr,a
2202
        mov     a,r3
2203
        addc    a,r5
2204
        inc     dptr
2205
        movx    @dptr,a
2206
        ret
2207
;------------------------------------------------------------
2208
;Allocation info for local variables in function 'mac_eeprom_read'
2209
;------------------------------------------------------------
2210
;addr                      Allocated with name '_mac_eeprom_read_PARM_2'
2211
;length                    Allocated with name '_mac_eeprom_read_PARM_3'
2212
;buf                       Allocated to registers r2 r3
2213
;bytes                     Allocated to registers r4
2214
;i                         Allocated to registers
2215
;------------------------------------------------------------
2216
;       ../../include/ztex-eeprom.h:272: BYTE mac_eeprom_read ( __xdata BYTE *buf, BYTE addr, BYTE length ) {
2217
;       -----------------------------------------
2218
;        function mac_eeprom_read
2219
;       -----------------------------------------
2220
_mac_eeprom_read:
2221
        mov     r2,dpl
2222
        mov     r3,dph
2223
;       ../../include/ztex-eeprom.h:273: BYTE bytes = 0,i;
2224
        mov     r4,#0x00
2225
;       ../../include/ztex-eeprom.h:275: if ( length == 0 )
2226
        mov     a,_mac_eeprom_read_PARM_3
2227
;       ../../include/ztex-eeprom.h:276: return 0;
2228
        jnz     00102$
2229
        mov     dpl,a
2230
        ret
2231
00102$:
2232
;       ../../include/ztex-eeprom.h:278: if ( eeprom_select(EEPROM_MAC_ADDR, 100,0) )
2233
        mov     _eeprom_select_PARM_2,#0x64
2234
        mov     _eeprom_select_PARM_3,#0x00
2235
        mov     dpl,#0xA6
2236
        push    ar2
2237
        push    ar3
2238
        push    ar4
2239
        lcall   _eeprom_select
2240
        mov     a,dpl
2241
        pop     ar4
2242
        pop     ar3
2243
        pop     ar2
2244
        jz      00131$
2245
        ljmp    00115$
2246
00131$:
2247
;       ../../include/ztex-eeprom.h:281: I2DAT = addr;          // write address
2248
        mov     dptr,#_I2DAT
2249
        mov     a,_mac_eeprom_read_PARM_2
2250
        movx    @dptr,a
2251
;       ../../include/ztex-eeprom.h:282: if ( i2c_waitWrite() ) goto mac_eeprom_read_end;
2252
        push    ar2
2253
        push    ar3
2254
        push    ar4
2255
        lcall   _i2c_waitWrite
2256
        mov     a,dpl
2257
        pop     ar4
2258
        pop     ar3
2259
        pop     ar2
2260
        jz      00132$
2261
        ljmp    00115$
2262
00132$:
2263
;       ../../include/ztex-eeprom.h:283: I2CS |= bmBIT6;
2264
        mov     dptr,#_I2CS
2265
        movx    a,@dptr
2266
        orl     a,#0x40
2267
        movx    @dptr,a
2268
;       ../../include/ztex-eeprom.h:284: i2c_waitStop();
2269
        push    ar2
2270
        push    ar3
2271
        push    ar4
2272
        lcall   _i2c_waitStop
2273
;       ../../include/ztex-eeprom.h:286: I2CS |= bmBIT7;                // start bit
2274
        mov     dptr,#_I2CS
2275
        movx    a,@dptr
2276
        orl     a,#0x80
2277
        movx    @dptr,a
2278
;       ../../include/ztex-eeprom.h:287: i2c_waitStart();
2279
        lcall   _i2c_waitStart
2280
;       ../../include/ztex-eeprom.h:288: I2DAT = EEPROM_MAC_ADDR | 1;  // select device for reading
2281
        mov     dptr,#_I2DAT
2282
        mov     a,#0xA7
2283
        movx    @dptr,a
2284
;       ../../include/ztex-eeprom.h:289: if ( i2c_waitWrite() ) goto mac_eeprom_read_end;
2285
        lcall   _i2c_waitWrite
2286
        mov     a,dpl
2287
        pop     ar4
2288
        pop     ar3
2289
        pop     ar2
2290
        jnz     00115$
2291
;       ../../include/ztex-eeprom.h:291: *buf = I2DAT;          // dummy read
2292
        mov     dptr,#_I2DAT
2293
        movx    a,@dptr
2294
        mov     dpl,r2
2295
        mov     dph,r3
2296
        movx    @dptr,a
2297
;       ../../include/ztex-eeprom.h:292: if ( i2c_waitRead()) goto mac_eeprom_read_end;
2298
        push    ar2
2299
        push    ar3
2300
        push    ar4
2301
        lcall   _i2c_waitRead
2302
        mov     a,dpl
2303
        pop     ar4
2304
        pop     ar3
2305
        pop     ar2
2306
        jnz     00115$
2307
        mov     r5,a
2308
00116$:
2309
;       ../../include/ztex-eeprom.h:293: for (; bytes
2310
        clr     c
2311
        mov     a,r5
2312
        subb    a,_mac_eeprom_read_PARM_3
2313
        jnc     00119$
2314
;       ../../include/ztex-eeprom.h:294: *buf = I2DAT;          // read data
2315
        mov     dptr,#_I2DAT
2316
        movx    a,@dptr
2317
        mov     dpl,r2
2318
        mov     dph,r3
2319
        movx    @dptr,a
2320
        inc     dptr
2321
        mov     r2,dpl
2322
        mov     r3,dph
2323
;       ../../include/ztex-eeprom.h:295: buf++;
2324
;       ../../include/ztex-eeprom.h:296: if ( i2c_waitRead()) goto mac_eeprom_read_end;
2325
        push    ar2
2326
        push    ar3
2327
        push    ar4
2328
        push    ar5
2329
        lcall   _i2c_waitRead
2330
        mov     a,dpl
2331
        pop     ar5
2332
        pop     ar4
2333
        pop     ar3
2334
        pop     ar2
2335
        jnz     00115$
2336
;       ../../include/ztex-eeprom.h:293: for (; bytes
2337
        inc     r5
2338
        mov     ar4,r5
2339
        sjmp    00116$
2340
00119$:
2341
;       ../../include/ztex-eeprom.h:299: I2CS |= bmBIT5;                // no ACK
2342
        mov     dptr,#_I2CS
2343
        movx    a,@dptr
2344
        orl     a,#0x20
2345
        movx    @dptr,a
2346
;       ../../include/ztex-eeprom.h:300: i = I2DAT;                     // dummy read
2347
        mov     dptr,#_I2DAT
2348
        movx    a,@dptr
2349
;       ../../include/ztex-eeprom.h:301: if ( i2c_waitRead()) goto mac_eeprom_read_end;
2350
        push    ar4
2351
        lcall   _i2c_waitRead
2352
        mov     a,dpl
2353
        pop     ar4
2354
        jnz     00115$
2355
;       ../../include/ztex-eeprom.h:303: I2CS |= bmBIT6;                // stop bit
2356
        mov     dptr,#_I2CS
2357
        movx    a,@dptr
2358
        orl     a,#0x40
2359
        movx    @dptr,a
2360
;       ../../include/ztex-eeprom.h:304: i = I2DAT;                     // dummy read
2361
        mov     dptr,#_I2DAT
2362
        movx    a,@dptr
2363
;       ../../include/ztex-eeprom.h:305: i2c_waitStop();
2364
        push    ar4
2365
        lcall   _i2c_waitStop
2366
        pop     ar4
2367
;       ../../include/ztex-eeprom.h:307: mac_eeprom_read_end:
2368
00115$:
2369
;       ../../include/ztex-eeprom.h:308: return bytes;
2370
        mov     dpl,r4
2371
        ret
2372
;------------------------------------------------------------
2373
;Allocation info for local variables in function 'mac_eeprom_write'
2374
;------------------------------------------------------------
2375
;addr                      Allocated with name '_mac_eeprom_write_PARM_2'
2376
;length                    Allocated with name '_mac_eeprom_write_PARM_3'
2377
;buf                       Allocated to registers r2 r3
2378
;bytes                     Allocated to registers r4
2379
;------------------------------------------------------------
2380
;       ../../include/ztex-eeprom.h:317: BYTE mac_eeprom_write ( __xdata BYTE *buf, BYTE addr, BYTE length ) {
2381
;       -----------------------------------------
2382
;        function mac_eeprom_write
2383
;       -----------------------------------------
2384
_mac_eeprom_write:
2385
        mov     r2,dpl
2386
        mov     r3,dph
2387
;       ../../include/ztex-eeprom.h:318: BYTE bytes = 0;
2388
        mov     r4,#0x00
2389
;       ../../include/ztex-eeprom.h:320: if ( length == 0 )
2390
        mov     a,_mac_eeprom_write_PARM_3
2391
;       ../../include/ztex-eeprom.h:321: return 0;
2392
        jnz     00102$
2393
        mov     dpl,a
2394
        ret
2395
00102$:
2396
;       ../../include/ztex-eeprom.h:323: if ( eeprom_select(EEPROM_MAC_ADDR, 100,0) )
2397
        mov     _eeprom_select_PARM_2,#0x64
2398
        mov     _eeprom_select_PARM_3,#0x00
2399
        mov     dpl,#0xA6
2400
        push    ar2
2401
        push    ar3
2402
        push    ar4
2403
        lcall   _eeprom_select
2404
        mov     a,dpl
2405
        pop     ar4
2406
        pop     ar3
2407
        pop     ar2
2408
        jz      00132$
2409
        ljmp    00119$
2410
00132$:
2411
;       ../../include/ztex-eeprom.h:326: I2DAT = addr;                  // write address
2412
        mov     dptr,#_I2DAT
2413
        mov     a,_mac_eeprom_write_PARM_2
2414
        movx    @dptr,a
2415
;       ../../include/ztex-eeprom.h:327: if ( i2c_waitWrite() ) goto mac_eeprom_write_end;
2416
        push    ar2
2417
        push    ar3
2418
        push    ar4
2419
        lcall   _i2c_waitWrite
2420
        mov     a,dpl
2421
        pop     ar4
2422
        pop     ar3
2423
        pop     ar2
2424
        jz      00133$
2425
        ljmp    00119$
2426
00133$:
2427
;       ../../include/ztex-eeprom.h:329: while ( bytes
2428
        mov     r5,_mac_eeprom_write_PARM_2
2429
        mov     r6,#0x00
2430
00116$:
2431
        clr     c
2432
        mov     a,r6
2433
        subb    a,_mac_eeprom_write_PARM_3
2434
        jc      00134$
2435
        ljmp    00118$
2436
00134$:
2437
;       ../../include/ztex-eeprom.h:330: I2DAT = *buf;          // write data
2438
        mov     dpl,r2
2439
        mov     dph,r3
2440
        movx    a,@dptr
2441
        mov     r7,a
2442
        inc     dptr
2443
        mov     r2,dpl
2444
        mov     r3,dph
2445
        mov     dptr,#_I2DAT
2446
        mov     a,r7
2447
        movx    @dptr,a
2448
;       ../../include/ztex-eeprom.h:331: buf++;
2449
;       ../../include/ztex-eeprom.h:332: if ( i2c_waitWrite() ) goto mac_eeprom_write_end;
2450
        push    ar2
2451
        push    ar3
2452
        push    ar4
2453
        push    ar5
2454
        push    ar6
2455
        lcall   _i2c_waitWrite
2456
        mov     a,dpl
2457
        pop     ar6
2458
        pop     ar5
2459
        pop     ar4
2460
        pop     ar3
2461
        pop     ar2
2462
        jnz     00119$
2463
;       ../../include/ztex-eeprom.h:334: addr++;
2464
        inc     r5
2465
        mov     _mac_eeprom_write_PARM_2,r5
2466
;       ../../include/ztex-eeprom.h:335: bytes++;
2467
        inc     r6
2468
        mov     ar4,r6
2469
;       ../../include/ztex-eeprom.h:336: if ( ( (addr & 8) == 0 ) && ( bytes
2470
        mov     a,r5
2471
        jb      acc.3,00116$
2472
        clr     c
2473
        mov     a,r6
2474
        subb    a,_mac_eeprom_write_PARM_3
2475
        jnc     00116$
2476
;       ../../include/ztex-eeprom.h:337: I2CS |= bmBIT6;                // stop bit
2477
        mov     dptr,#_I2CS
2478
        movx    a,@dptr
2479
        orl     a,#0x40
2480
        movx    @dptr,a
2481
;       ../../include/ztex-eeprom.h:338: i2c_waitStop();
2482
        push    ar2
2483
        push    ar3
2484
        push    ar4
2485
        push    ar5
2486
        push    ar6
2487
        lcall   _i2c_waitStop
2488
;       ../../include/ztex-eeprom.h:340: if ( eeprom_select(EEPROM_MAC_ADDR, 100,0) )
2489
        mov     _eeprom_select_PARM_2,#0x64
2490
        mov     _eeprom_select_PARM_3,#0x00
2491
        mov     dpl,#0xA6
2492
        lcall   _eeprom_select
2493
        mov     a,dpl
2494
        pop     ar6
2495
        pop     ar5
2496
        pop     ar4
2497
        pop     ar3
2498
        pop     ar2
2499
        jnz     00119$
2500
;       ../../include/ztex-eeprom.h:343: I2DAT = addr;                  // write address
2501
        mov     dptr,#_I2DAT
2502
        mov     a,r5
2503
        movx    @dptr,a
2504
;       ../../include/ztex-eeprom.h:344: if ( i2c_waitWrite() ) goto mac_eeprom_write_end;
2505
        push    ar2
2506
        push    ar3
2507
        push    ar4
2508
        push    ar5
2509
        push    ar6
2510
        lcall   _i2c_waitWrite
2511
        mov     a,dpl
2512
        pop     ar6
2513
        pop     ar5
2514
        pop     ar4
2515
        pop     ar3
2516
        pop     ar2
2517
        jnz     00119$
2518
        ljmp    00116$
2519
00118$:
2520
;       ../../include/ztex-eeprom.h:347: I2CS |= bmBIT6;                // stop bit
2521
        mov     dptr,#_I2CS
2522
        movx    a,@dptr
2523
        orl     a,#0x40
2524
        movx    @dptr,a
2525
;       ../../include/ztex-eeprom.h:348: i2c_waitStop();
2526
        push    ar4
2527
        lcall   _i2c_waitStop
2528
        pop     ar4
2529
;       ../../include/ztex-eeprom.h:350: mac_eeprom_write_end:
2530
00119$:
2531
;       ../../include/ztex-eeprom.h:351: mac_eeprom_addr = addr;
2532
        mov     dptr,#_mac_eeprom_addr
2533
        mov     a,_mac_eeprom_write_PARM_2
2534
        movx    @dptr,a
2535
;       ../../include/ztex-eeprom.h:352: return bytes;
2536
        mov     dpl,r4
2537
        ret
2538
;------------------------------------------------------------
2539
;Allocation info for local variables in function 'mac_eeprom_read_ep0'
2540
;------------------------------------------------------------
2541
;i                         Allocated to registers r3
2542
;b                         Allocated to registers r2
2543
;------------------------------------------------------------
2544
;       ../../include/ztex-eeprom.h:358: BYTE mac_eeprom_read_ep0 () {
2545
;       -----------------------------------------
2546
;        function mac_eeprom_read_ep0
2547
;       -----------------------------------------
2548
_mac_eeprom_read_ep0:
2549
;       ../../include/ztex-eeprom.h:360: b = ep0_payload_transfer;
2550
        mov     dptr,#_ep0_payload_transfer
2551
        movx    a,@dptr
2552
        mov     r2,a
2553
;       ../../include/ztex-eeprom.h:361: i = mac_eeprom_read(EP0BUF, mac_eeprom_addr, b);
2554
        mov     dptr,#_mac_eeprom_addr
2555
        movx    a,@dptr
2556
        mov     _mac_eeprom_read_PARM_2,a
2557
        mov     _mac_eeprom_read_PARM_3,r2
2558
        mov     dptr,#_EP0BUF
2559
        push    ar2
2560
        lcall   _mac_eeprom_read
2561
        mov     r3,dpl
2562
        pop     ar2
2563
;       ../../include/ztex-eeprom.h:362: mac_eeprom_addr += b;
2564
        mov     dptr,#_mac_eeprom_addr
2565
        movx    a,@dptr
2566
        mov     r4,a
2567
        mov     a,r2
2568
        add     a,r4
2569
        movx    @dptr,a
2570
;       ../../include/ztex-eeprom.h:363: return i;
2571
        mov     dpl,r3
2572
        ret
2573
;------------------------------------------------------------
2574
;Allocation info for local variables in function 'spi_clocks'
2575
;------------------------------------------------------------
2576
;c                         Allocated to registers
2577
;------------------------------------------------------------
2578
;       ../../include/ztex-flash2.h:98: void spi_clocks (BYTE c) {
2579
;       -----------------------------------------
2580
;        function spi_clocks
2581
;       -----------------------------------------
2582
_spi_clocks:
2583
;       ../../include/ztex-flash2.h:110: }
2584
 
2585
         mov r2,dpl
2586
        010014$:
2587
                setb _IOA0
2588
                nop
2589
                nop
2590
                nop
2591
                clr _IOA0
2592
         djnz r2,010014$
2593
;       # 109 "../../include/ztex-flash2.h"
2594
        ret
2595
;------------------------------------------------------------
2596
;Allocation info for local variables in function 'flash_read_byte'
2597
;------------------------------------------------------------
2598
;------------------------------------------------------------
2599
;       ../../include/ztex-flash2.h:118: __asm
2600
;       -----------------------------------------
2601
;        function flash_read_byte
2602
;       -----------------------------------------
2603
_flash_read_byte:
2604
;       ../../include/ztex-flash2.h:169: void flash_read(__xdata BYTE *buf, BYTE len) {
2605
 
2606
 
2607
         mov c,_IOC0
2608
;       # 121 "../../include/ztex-flash2.h"
2609
                setb _IOA0
2610
                rlc a
2611
                clr _IOA0
2612
 
2613
                mov c,_IOC0
2614
;       # 126 "../../include/ztex-flash2.h"
2615
                setb _IOA0
2616
                rlc a
2617
                clr _IOA0
2618
 
2619
                mov c,_IOC0
2620
;       # 131 "../../include/ztex-flash2.h"
2621
                setb _IOA0
2622
                rlc a
2623
                clr _IOA0
2624
 
2625
                mov c,_IOC0
2626
;       # 136 "../../include/ztex-flash2.h"
2627
                setb _IOA0
2628
                rlc a
2629
                clr _IOA0
2630
 
2631
                mov c,_IOC0
2632
;       # 141 "../../include/ztex-flash2.h"
2633
                setb _IOA0
2634
                rlc a
2635
                clr _IOA0
2636
 
2637
                mov c,_IOC0
2638
;       # 146 "../../include/ztex-flash2.h"
2639
                setb _IOA0
2640
                rlc a
2641
                clr _IOA0
2642
 
2643
                mov c,_IOC0
2644
;       # 151 "../../include/ztex-flash2.h"
2645
                setb _IOA0
2646
                rlc a
2647
                clr _IOA0
2648
 
2649
                mov c,_IOC0
2650
;       # 156 "../../include/ztex-flash2.h"
2651
                setb _IOA0
2652
                rlc a
2653
                clr _IOA0
2654
                mov dpl,a
2655
                ret
2656
;       ../../include/ztex-flash2.h:170: *buf;                                  // this avoids stupid warnings
2657
        mov     dpl,#0x00
2658
        ret
2659
;------------------------------------------------------------
2660
;Allocation info for local variables in function 'flash_read'
2661
;------------------------------------------------------------
2662
;len                       Allocated with name '_flash_read_PARM_2'
2663
;buf                       Allocated to registers
2664
;------------------------------------------------------------
2665
;       ../../include/ztex-flash2.h:169: void flash_read(__xdata BYTE *buf, BYTE len) {
2666
;       -----------------------------------------
2667
;        function flash_read
2668
;       -----------------------------------------
2669
_flash_read:
2670
;       ../../include/ztex-flash2.h:228: __asm
2671
 
2672
;       # 173 "../../include/ztex-flash2.h"
2673
         mov r2,_flash_read_PARM_2
2674
        010012$:
2675
 
2676
         mov c,_IOC0
2677
;       # 177 "../../include/ztex-flash2.h"
2678
                setb _IOA0
2679
                rlc a
2680
                clr _IOA0
2681
 
2682
                mov c,_IOC0
2683
;       # 182 "../../include/ztex-flash2.h"
2684
                setb _IOA0
2685
                rlc a
2686
                clr _IOA0
2687
 
2688
                mov c,_IOC0
2689
;       # 187 "../../include/ztex-flash2.h"
2690
                setb _IOA0
2691
                rlc a
2692
                clr _IOA0
2693
 
2694
                mov c,_IOC0
2695
;       # 192 "../../include/ztex-flash2.h"
2696
                setb _IOA0
2697
                rlc a
2698
                clr _IOA0
2699
 
2700
                mov c,_IOC0
2701
;       # 197 "../../include/ztex-flash2.h"
2702
                setb _IOA0
2703
                rlc a
2704
                clr _IOA0
2705
 
2706
                mov c,_IOC0
2707
;       # 202 "../../include/ztex-flash2.h"
2708
                setb _IOA0
2709
                rlc a
2710
                clr _IOA0
2711
 
2712
                mov c,_IOC0
2713
;       # 207 "../../include/ztex-flash2.h"
2714
                setb _IOA0
2715
                rlc a
2716
                clr _IOA0
2717
 
2718
                mov c,_IOC0
2719
;       # 212 "../../include/ztex-flash2.h"
2720
                setb _IOA0
2721
                rlc a
2722
                clr _IOA0
2723
 
2724
         movx @dptr,a
2725
         inc dptr
2726
         djnz r2,010012$
2727
        ret
2728
;------------------------------------------------------------
2729
;Allocation info for local variables in function 'spi_write_byte'
2730
;------------------------------------------------------------
2731
;b                         Allocated to registers
2732
;------------------------------------------------------------
2733
;       ../../include/ztex-flash2.h:235: rlc    a               // 6
2734
;       -----------------------------------------
2735
;        function spi_write_byte
2736
;       -----------------------------------------
2737
_spi_write_byte:
2738
;       ../../include/ztex-flash2.h:280: *buf;                                  // this avoids stupid warnings
2739
 
2740
;       # 230 "../../include/ztex-flash2.h"
2741
         mov a,dpl
2742
         rlc a
2743
;       # 232 "../../include/ztex-flash2.h"
2744
 
2745
         mov _IOA1,c
2746
                setb _IOA0
2747
         rlc a
2748
;       # 236 "../../include/ztex-flash2.h"
2749
                clr _IOA0
2750
 
2751
         mov _IOA1,c
2752
                setb _IOA0
2753
         rlc a
2754
;       # 241 "../../include/ztex-flash2.h"
2755
                clr _IOA0
2756
 
2757
         mov _IOA1,c
2758
                setb _IOA0
2759
         rlc a
2760
;       # 246 "../../include/ztex-flash2.h"
2761
                clr _IOA0
2762
 
2763
         mov _IOA1,c
2764
                setb _IOA0
2765
         rlc a
2766
;       # 251 "../../include/ztex-flash2.h"
2767
                clr _IOA0
2768
 
2769
         mov _IOA1,c
2770
                setb _IOA0
2771
         rlc a
2772
;       # 256 "../../include/ztex-flash2.h"
2773
                clr _IOA0
2774
 
2775
         mov _IOA1,c
2776
                setb _IOA0
2777
         rlc a
2778
;       # 261 "../../include/ztex-flash2.h"
2779
                clr _IOA0
2780
 
2781
         mov _IOA1,c
2782
                setb _IOA0
2783
         rlc a
2784
;       # 266 "../../include/ztex-flash2.h"
2785
                clr _IOA0
2786
 
2787
         mov _IOA1,c
2788
                setb _IOA0
2789
         nop
2790
                clr _IOA0
2791
        ret
2792
;------------------------------------------------------------
2793
;Allocation info for local variables in function 'spi_write'
2794
;------------------------------------------------------------
2795
;len                       Allocated with name '_spi_write_PARM_2'
2796
;buf                       Allocated to registers
2797
;------------------------------------------------------------
2798
;       ../../include/ztex-flash2.h:279: void spi_write(__xdata BYTE *buf, BYTE len) {
2799
;       -----------------------------------------
2800
;        function spi_write
2801
;       -----------------------------------------
2802
_spi_write:
2803
;       ../../include/ztex-flash2.h:339: void spi_select() {
2804
 
2805
;       # 283 "../../include/ztex-flash2.h"
2806
         mov r2,_flash_read_PARM_2
2807
        010013$:
2808
;       # 286 "../../include/ztex-flash2.h"
2809
         movx a,@dptr
2810
         rlc a
2811
;       # 288 "../../include/ztex-flash2.h"
2812
 
2813
         mov _IOA1,c
2814
                setb _IOA0
2815
         rlc a
2816
;       # 292 "../../include/ztex-flash2.h"
2817
                clr _IOA0
2818
 
2819
         mov _IOA1,c
2820
                setb _IOA0
2821
         rlc a
2822
;       # 297 "../../include/ztex-flash2.h"
2823
                clr _IOA0
2824
 
2825
         mov _IOA1,c
2826
                setb _IOA0
2827
         rlc a
2828
;       # 302 "../../include/ztex-flash2.h"
2829
                clr _IOA0
2830
 
2831
         mov _IOA1,c
2832
                setb _IOA0
2833
         rlc a
2834
;       # 307 "../../include/ztex-flash2.h"
2835
                clr _IOA0
2836
 
2837
         mov _IOA1,c
2838
                setb _IOA0
2839
         rlc a
2840
;       # 312 "../../include/ztex-flash2.h"
2841
                clr _IOA0
2842
 
2843
         mov _IOA1,c
2844
                setb _IOA0
2845
         rlc a
2846
;       # 317 "../../include/ztex-flash2.h"
2847
                clr _IOA0
2848
 
2849
         mov _IOA1,c
2850
                setb _IOA0
2851
         rlc a
2852
;       # 322 "../../include/ztex-flash2.h"
2853
                clr _IOA0
2854
 
2855
         mov _IOA1,c
2856
                setb _IOA0
2857
         inc dptr
2858
                clr _IOA0
2859
 
2860
         djnz r2,010013$
2861
        ret
2862
;------------------------------------------------------------
2863
;Allocation info for local variables in function 'spi_select'
2864
;------------------------------------------------------------
2865
;------------------------------------------------------------
2866
;       ../../include/ztex-flash2.h:348: // de-select the flash (CS)
2867
;       -----------------------------------------
2868
;        function spi_select
2869
;       -----------------------------------------
2870
_spi_select:
2871
;       ../../include/ztex-flash2.h:349: void spi_deselect() {
2872
        setb    _IOA3
2873
;       ../../include/ztex-flash2.h:350: SPI_CS = 1;                                    // CS = 1;
2874
        mov     dpl,#0x08
2875
        lcall   _spi_clocks
2876
;       ../../include/ztex-flash2.h:342: SPI_CS = 0;
2877
        clr     _IOA3
2878
        ret
2879
;------------------------------------------------------------
2880
;Allocation info for local variables in function 'spi_deselect'
2881
;------------------------------------------------------------
2882
;------------------------------------------------------------
2883
;       ../../include/ztex-flash2.h:349: void spi_deselect() {
2884
;       -----------------------------------------
2885
;        function spi_deselect
2886
;       -----------------------------------------
2887
_spi_deselect:
2888
;       ../../include/ztex-flash2.h:350: SPI_CS = 1;                                    // CS = 1;
2889
        setb    _IOA3
2890
;       ../../include/ztex-flash2.h:351: spi_clocks(8);                         // 8 dummy clocks to finish a previous command
2891
        mov     dpl,#0x08
2892
        ljmp    _spi_clocks
2893
;------------------------------------------------------------
2894
;Allocation info for local variables in function 'spi_wait'
2895
;------------------------------------------------------------
2896
;i                         Allocated to registers r2 r3
2897
;------------------------------------------------------------
2898
;       ../../include/ztex-flash2.h:371: BYTE spi_wait() {
2899
;       -----------------------------------------
2900
;        function spi_wait
2901
;       -----------------------------------------
2902
_spi_wait:
2903
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
2904
        mov     dptr,#_spi_last_cmd
2905
        mov     a,#0x05
2906
        movx    @dptr,a
2907
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
2908
        lcall   _spi_select
2909
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
2910
        mov     dpl,#0x05
2911
        lcall   _spi_write_byte
2912
;       ../../include/ztex-flash2.h:375: for (i=0; (flash_read_byte() & bmBIT0) && i<65535; i++ ) {
2913
        mov     r2,#0x00
2914
        mov     r3,#0x00
2915
00102$:
2916
        push    ar2
2917
        push    ar3
2918
        lcall   _flash_read_byte
2919
        mov     a,dpl
2920
        pop     ar3
2921
        pop     ar2
2922
        jnb     acc.0,00105$
2923
        mov     ar4,r2
2924
        mov     ar5,r3
2925
        mov     r6,#0x00
2926
        mov     r7,#0x00
2927
        clr     c
2928
        mov     a,r4
2929
        subb    a,#0xFF
2930
        mov     a,r5
2931
        subb    a,#0xFF
2932
        mov     a,r6
2933
        subb    a,#0x00
2934
        mov     a,r7
2935
        xrl     a,#0x80
2936
        subb    a,#0x80
2937
        jnc     00105$
2938
;       ../../include/ztex-flash2.h:376: spi_clocks(0);                         // 256 dummy clocks
2939
        mov     dpl,#0x00
2940
        push    ar2
2941
        push    ar3
2942
        lcall   _spi_clocks
2943
        pop     ar3
2944
        pop     ar2
2945
;       ../../include/ztex-flash2.h:375: for (i=0; (flash_read_byte() & bmBIT0) && i<65535; i++ ) {
2946
        inc     r2
2947
        cjne    r2,#0x00,00102$
2948
        inc     r3
2949
        sjmp    00102$
2950
00105$:
2951
;       ../../include/ztex-flash2.h:379: flash_ec = flash_read_byte() & bmBIT0 ? FLASH_EC_TIMEOUT : 0;
2952
        lcall   _flash_read_byte
2953
        mov     a,dpl
2954
        jnb     acc.0,00108$
2955
        mov     r2,#0x02
2956
        sjmp    00109$
2957
00108$:
2958
        mov     r2,#0x00
2959
00109$:
2960
        mov     dptr,#_flash_ec
2961
        mov     a,r2
2962
        movx    @dptr,a
2963
;       ../../include/ztex-flash2.h:380: spi_deselect();
2964
        lcall   _spi_deselect
2965
;       ../../include/ztex-flash2.h:381: return flash_ec;
2966
        mov     dptr,#_flash_ec
2967
        movx    a,@dptr
2968
        mov     dpl,a
2969
        ret
2970
;------------------------------------------------------------
2971
;Allocation info for local variables in function 'flash_read_init'
2972
;------------------------------------------------------------
2973
;s                         Allocated to registers r2 r3
2974
;------------------------------------------------------------
2975
;       ../../include/ztex-flash2.h:391: BYTE flash_read_init(WORD s) {
2976
;       -----------------------------------------
2977
;        function flash_read_init
2978
;       -----------------------------------------
2979
_flash_read_init:
2980
        mov     r2,dpl
2981
        mov     r3,dph
2982
;       ../../include/ztex-flash2.h:396: OESPI_OPORT &= ~bmBITSPI_BIT_DO;
2983
        jb      _IOA3,00102$
2984
;       ../../include/ztex-flash2.h:393: flash_ec = FLASH_EC_PENDING;
2985
        mov     dptr,#_flash_ec
2986
        mov     a,#0x04
2987
        movx    @dptr,a
2988
;       ../../include/ztex-flash2.h:394: return FLASH_EC_PENDING;               // we interrupted a pending Flash operation
2989
        mov     dpl,#0x04
2990
        ret
2991
00102$:
2992
;       ../../include/ztex-flash2.h:396: OESPI_OPORT &= ~bmBITSPI_BIT_DO;
2993
        anl     _OEC,#0xFE
2994
;       ../../include/ztex-flash2.h:397: OESPI_PORT |= bmBITSPI_BIT_CS | bmBITSPI_BIT_DI | bmBITSPI_BIT_CLK;
2995
        orl     _OEA,#0x0B
2996
;       ../../include/ztex-flash2.h:398: if ( spi_wait() ) {
2997
        push    ar2
2998
        push    ar3
2999
        lcall   _spi_wait
3000
        mov     a,dpl
3001
        pop     ar3
3002
        pop     ar2
3003
        jz      00104$
3004
;       ../../include/ztex-flash2.h:399: return flash_ec;
3005
        mov     dptr,#_flash_ec
3006
        movx    a,@dptr
3007
        mov     dpl,a
3008
        ret
3009
00104$:
3010
;       ../../include/ztex-flash2.h:402: s = s << ((BYTE)flash_sector_size - 8);
3011
        mov     dptr,#_flash_sector_size
3012
        movx    a,@dptr
3013
        mov     r4,a
3014
        inc     dptr
3015
        movx    a,@dptr
3016
        mov     r5,#0x00
3017
        mov     a,r4
3018
        add     a,#0xf8
3019
        mov     r4,a
3020
        mov     a,r5
3021
        addc    a,#0xff
3022
        mov     r5,a
3023
        mov     b,r4
3024
        inc     b
3025
        sjmp    00112$
3026
00111$:
3027
        mov     a,r2
3028
        add     a,r2
3029
        mov     r2,a
3030
        mov     a,r3
3031
        rlc     a
3032
        mov     r3,a
3033
00112$:
3034
        djnz    b,00111$
3035
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3036
        mov     dptr,#_spi_last_cmd
3037
        mov     a,#0x0B
3038
        movx    @dptr,a
3039
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3040
        push    ar2
3041
        push    ar3
3042
        lcall   _spi_select
3043
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3044
        mov     dpl,#0x0B
3045
        lcall   _spi_write_byte
3046
        pop     ar3
3047
;       ../../include/ztex-flash2.h:363:
3048
        mov     dpl,r3
3049
        push    ar3
3050
        lcall   _spi_write_byte
3051
        pop     ar3
3052
        pop     ar2
3053
;       ../../include/ztex-flash2.h:405: spi_write_byte(s & 255);
3054
        mov     dpl,r2
3055
        lcall   _spi_write_byte
3056
;       ../../include/ztex-flash2.h:406: spi_write_byte(0);
3057
        mov     dpl,#0x00
3058
        lcall   _spi_write_byte
3059
;       ../../include/ztex-flash2.h:407: spi_clocks(8);                         // 8 dummy clocks
3060
        mov     dpl,#0x08
3061
        lcall   _spi_clocks
3062
;       ../../include/ztex-flash2.h:408: return 0;
3063
        mov     dpl,#0x00
3064
        ret
3065
;------------------------------------------------------------
3066
;Allocation info for local variables in function 'flash_read_next'
3067
;------------------------------------------------------------
3068
;------------------------------------------------------------
3069
;       ../../include/ztex-flash2.h:417: BYTE flash_read_next() {
3070
;       -----------------------------------------
3071
;        function flash_read_next
3072
;       -----------------------------------------
3073
_flash_read_next:
3074
;       ../../include/ztex-flash2.h:418: return 0;
3075
        mov     dpl,#0x00
3076
        ret
3077
;------------------------------------------------------------
3078
;Allocation info for local variables in function 'flash_read_finish'
3079
;------------------------------------------------------------
3080
;n                         Allocated to registers
3081
;------------------------------------------------------------
3082
;       ../../include/ztex-flash2.h:428: void flash_read_finish(WORD n) {
3083
;       -----------------------------------------
3084
;        function flash_read_finish
3085
;       -----------------------------------------
3086
_flash_read_finish:
3087
;       ../../include/ztex-flash2.h:430: spi_deselect();
3088
        ljmp    _spi_deselect
3089
;------------------------------------------------------------
3090
;Allocation info for local variables in function 'spi_pp'
3091
;------------------------------------------------------------
3092
;------------------------------------------------------------
3093
;       ../../include/ztex-flash2.h:437: BYTE spi_pp () {
3094
;       -----------------------------------------
3095
;        function spi_pp
3096
;       -----------------------------------------
3097
_spi_pp:
3098
;       ../../include/ztex-flash2.h:438: spi_deselect();                                // finish previous write cmd
3099
        lcall   _spi_deselect
3100
;       ../../include/ztex-flash2.h:440: spi_need_pp = 0;
3101
        mov     dptr,#_spi_need_pp
3102
        clr     a
3103
        movx    @dptr,a
3104
;       ../../include/ztex-flash2.h:442: if ( spi_wait() ) {
3105
        lcall   _spi_wait
3106
        mov     a,dpl
3107
        jz      00102$
3108
;       ../../include/ztex-flash2.h:443: return flash_ec;
3109
        mov     dptr,#_flash_ec
3110
        movx    a,@dptr
3111
        mov     dpl,a
3112
        ret
3113
00102$:
3114
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3115
        mov     dptr,#_spi_last_cmd
3116
        mov     a,#0x06
3117
        movx    @dptr,a
3118
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3119
        lcall   _spi_select
3120
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3121
        mov     dpl,#0x06
3122
        lcall   _spi_write_byte
3123
;       ../../include/ztex-flash2.h:446: spi_deselect();
3124
        lcall   _spi_deselect
3125
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3126
        mov     dptr,#_spi_last_cmd
3127
        mov     a,#0x02
3128
        movx    @dptr,a
3129
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3130
        lcall   _spi_select
3131
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3132
        mov     dpl,#0x02
3133
        lcall   _spi_write_byte
3134
;       ../../include/ztex-flash2.h:363:
3135
        mov     dptr,#_spi_write_addr_hi
3136
        movx    a,@dptr
3137
        inc     dptr
3138
        movx    a,@dptr
3139
        mov     dpl,a
3140
        lcall   _spi_write_byte
3141
;       ../../include/ztex-flash2.h:450: spi_write_byte(spi_write_addr_hi & 255);
3142
        mov     dptr,#_spi_write_addr_hi
3143
        movx    a,@dptr
3144
        mov     r2,a
3145
        inc     dptr
3146
        movx    a,@dptr
3147
        mov     dpl,r2
3148
        lcall   _spi_write_byte
3149
;       ../../include/ztex-flash2.h:451: spi_write_byte(0);
3150
        mov     dpl,#0x00
3151
        lcall   _spi_write_byte
3152
;       ../../include/ztex-flash2.h:452: return 0;
3153
        mov     dpl,#0x00
3154
        ret
3155
;------------------------------------------------------------
3156
;Allocation info for local variables in function 'flash_write_byte'
3157
;------------------------------------------------------------
3158
;b                         Allocated to registers r2
3159
;------------------------------------------------------------
3160
;       ../../include/ztex-flash2.h:459: BYTE flash_write_byte (BYTE b) {
3161
;       -----------------------------------------
3162
;        function flash_write_byte
3163
;       -----------------------------------------
3164
_flash_write_byte:
3165
        mov     r2,dpl
3166
;       ../../include/ztex-flash2.h:460: if ( spi_need_pp && spi_pp() ) return flash_ec;
3167
        mov     dptr,#_spi_need_pp
3168
        movx    a,@dptr
3169
        mov     r3,a
3170
        jz      00102$
3171
        push    ar2
3172
        lcall   _spi_pp
3173
        mov     a,dpl
3174
        pop     ar2
3175
        jz      00102$
3176
        mov     dptr,#_flash_ec
3177
        movx    a,@dptr
3178
        mov     dpl,a
3179
        ret
3180
00102$:
3181
;       ../../include/ztex-flash2.h:461: spi_write_byte(b);
3182
        mov     dpl,r2
3183
        lcall   _spi_write_byte
3184
;       ../../include/ztex-flash2.h:462: spi_write_addr_lo++;
3185
        mov     dptr,#_spi_write_addr_lo
3186
        movx    a,@dptr
3187
        mov     dptr,#_spi_write_addr_lo
3188
        inc     a
3189
        movx    @dptr,a
3190
;       ../../include/ztex-flash2.h:463: if ( spi_write_addr_lo == 0 ) {
3191
        mov     dptr,#_spi_write_addr_lo
3192
        movx    a,@dptr
3193
        mov     r2,a
3194
        jnz     00105$
3195
;       ../../include/ztex-flash2.h:464: spi_write_addr_hi++;
3196
        mov     dptr,#_spi_write_addr_hi
3197
        movx    a,@dptr
3198
        mov     r2,a
3199
        inc     dptr
3200
        movx    a,@dptr
3201
        mov     r3,a
3202
        mov     dptr,#_spi_write_addr_hi
3203
        mov     a,#0x01
3204
        add     a,r2
3205
        movx    @dptr,a
3206
        clr     a
3207
        addc    a,r3
3208
        inc     dptr
3209
        movx    @dptr,a
3210
;       ../../include/ztex-flash2.h:465: spi_deselect();                                // finish write cmd
3211
        lcall   _spi_deselect
3212
;       ../../include/ztex-flash2.h:466: spi_need_pp = 1;
3213
        mov     dptr,#_spi_need_pp
3214
        mov     a,#0x01
3215
        movx    @dptr,a
3216
00105$:
3217
;       ../../include/ztex-flash2.h:468: return 0;
3218
        mov     dpl,#0x00
3219
        ret
3220
;------------------------------------------------------------
3221
;Allocation info for local variables in function 'flash_write'
3222
;------------------------------------------------------------
3223
;len                       Allocated with name '_flash_write_PARM_2'
3224
;buf                       Allocated to registers r2 r3
3225
;b                         Allocated to registers r4
3226
;------------------------------------------------------------
3227
;       ../../include/ztex-flash2.h:476: BYTE flash_write(__xdata BYTE *buf, BYTE len) {
3228
;       -----------------------------------------
3229
;        function flash_write
3230
;       -----------------------------------------
3231
_flash_write:
3232
        mov     r2,dpl
3233
        mov     r3,dph
3234
;       ../../include/ztex-flash2.h:478: if ( spi_need_pp && spi_pp() ) return flash_ec;
3235
        mov     dptr,#_spi_need_pp
3236
        movx    a,@dptr
3237
        mov     r4,a
3238
        jz      00102$
3239
        push    ar2
3240
        push    ar3
3241
        lcall   _spi_pp
3242
        mov     a,dpl
3243
        pop     ar3
3244
        pop     ar2
3245
        jz      00102$
3246
        mov     dptr,#_flash_ec
3247
        movx    a,@dptr
3248
        mov     dpl,a
3249
        ret
3250
00102$:
3251
;       ../../include/ztex-flash2.h:480: if ( spi_write_addr_lo == 0 ) {
3252
        mov     dptr,#_spi_write_addr_lo
3253
        movx    a,@dptr
3254
        mov     r4,a
3255
        jnz     00110$
3256
;       ../../include/ztex-flash2.h:481: spi_write(buf,len);
3257
        mov     _spi_write_PARM_2,_flash_write_PARM_2
3258
        mov     dpl,r2
3259
        mov     dph,r3
3260
        lcall   _spi_write
3261
        sjmp    00111$
3262
00110$:
3263
;       ../../include/ztex-flash2.h:484: b = (~spi_write_addr_lo) + 1;
3264
        mov     a,r4
3265
        cpl     a
3266
        mov     r4,a
3267
        inc     r4
3268
;       ../../include/ztex-flash2.h:485: if ( len==0 || len>b ) {
3269
        mov     a,_flash_write_PARM_2
3270
        jz      00106$
3271
        clr     c
3272
        mov     a,r4
3273
        subb    a,_flash_write_PARM_2
3274
        jnc     00107$
3275
00106$:
3276
;       ../../include/ztex-flash2.h:486: spi_write(buf,b);
3277
        mov     _spi_write_PARM_2,r4
3278
        mov     dpl,r2
3279
        mov     dph,r3
3280
        push    ar2
3281
        push    ar3
3282
        push    ar4
3283
        lcall   _spi_write
3284
        pop     ar4
3285
        pop     ar3
3286
        pop     ar2
3287
;       ../../include/ztex-flash2.h:487: len-=b;
3288
        mov     a,_flash_write_PARM_2
3289
        clr     c
3290
        subb    a,r4
3291
        mov     _flash_write_PARM_2,a
3292
;       ../../include/ztex-flash2.h:488: spi_write_addr_hi++;
3293
        mov     dptr,#_spi_write_addr_hi
3294
        movx    a,@dptr
3295
        mov     r5,a
3296
        inc     dptr
3297
        movx    a,@dptr
3298
        mov     r6,a
3299
        mov     dptr,#_spi_write_addr_hi
3300
        mov     a,#0x01
3301
        add     a,r5
3302
        movx    @dptr,a
3303
        clr     a
3304
        addc    a,r6
3305
        inc     dptr
3306
        movx    @dptr,a
3307
;       ../../include/ztex-flash2.h:489: spi_write_addr_lo=0;
3308
        mov     dptr,#_spi_write_addr_lo
3309
        clr     a
3310
        movx    @dptr,a
3311
;       ../../include/ztex-flash2.h:490: buf+=b;
3312
        mov     a,r4
3313
        add     a,r2
3314
        mov     r2,a
3315
        clr     a
3316
        addc    a,r3
3317
        mov     r3,a
3318
;       ../../include/ztex-flash2.h:491: if ( spi_pp() ) return flash_ec;
3319
        push    ar2
3320
        push    ar3
3321
        lcall   _spi_pp
3322
        mov     a,dpl
3323
        pop     ar3
3324
        pop     ar2
3325
        jz      00107$
3326
        mov     dptr,#_flash_ec
3327
        movx    a,@dptr
3328
        mov     dpl,a
3329
        ret
3330
00107$:
3331
;       ../../include/ztex-flash2.h:493: spi_write(buf,len);
3332
        mov     _spi_write_PARM_2,_flash_write_PARM_2
3333
        mov     dpl,r2
3334
        mov     dph,r3
3335
        lcall   _spi_write
3336
00111$:
3337
;       ../../include/ztex-flash2.h:496: spi_write_addr_lo+=len;
3338
        mov     dptr,#_spi_write_addr_lo
3339
        movx    a,@dptr
3340
        mov     r2,a
3341
        mov     a,_flash_write_PARM_2
3342
        add     a,r2
3343
        movx    @dptr,a
3344
;       ../../include/ztex-flash2.h:498: if ( spi_write_addr_lo == 0 ) {
3345
        mov     dptr,#_spi_write_addr_lo
3346
        movx    a,@dptr
3347
        mov     r2,a
3348
        jnz     00113$
3349
;       ../../include/ztex-flash2.h:499: spi_write_addr_hi++;
3350
        mov     dptr,#_spi_write_addr_hi
3351
        movx    a,@dptr
3352
        mov     r2,a
3353
        inc     dptr
3354
        movx    a,@dptr
3355
        mov     r3,a
3356
        mov     dptr,#_spi_write_addr_hi
3357
        mov     a,#0x01
3358
        add     a,r2
3359
        movx    @dptr,a
3360
        clr     a
3361
        addc    a,r3
3362
        inc     dptr
3363
        movx    @dptr,a
3364
;       ../../include/ztex-flash2.h:500: spi_deselect();                                // finish write cmd
3365
        lcall   _spi_deselect
3366
;       ../../include/ztex-flash2.h:501: spi_need_pp = 1;
3367
        mov     dptr,#_spi_need_pp
3368
        mov     a,#0x01
3369
        movx    @dptr,a
3370
00113$:
3371
;       ../../include/ztex-flash2.h:504: return 0;
3372
        mov     dpl,#0x00
3373
        ret
3374
;------------------------------------------------------------
3375
;Allocation info for local variables in function 'flash_write_init'
3376
;------------------------------------------------------------
3377
;s                         Allocated to registers r2 r3
3378
;------------------------------------------------------------
3379
;       ../../include/ztex-flash2.h:516: BYTE flash_write_init(WORD s) {
3380
;       -----------------------------------------
3381
;        function flash_write_init
3382
;       -----------------------------------------
3383
_flash_write_init:
3384
        mov     r2,dpl
3385
        mov     r3,dph
3386
;       ../../include/ztex-flash2.h:517: if ( !SPI_CS ) {
3387
        jb      _IOA3,00102$
3388
;       ../../include/ztex-flash2.h:518: flash_ec = FLASH_EC_PENDING;
3389
        mov     dptr,#_flash_ec
3390
        mov     a,#0x04
3391
        movx    @dptr,a
3392
;       ../../include/ztex-flash2.h:519: return FLASH_EC_PENDING;               // we interrupted a pending Flash operation
3393
        mov     dpl,#0x04
3394
        ret
3395
00102$:
3396
;       ../../include/ztex-flash2.h:521: OESPI_OPORT &= ~bmBITSPI_BIT_DO;
3397
        anl     _OEC,#0xFE
3398
;       ../../include/ztex-flash2.h:522: OESPI_PORT |= bmBITSPI_BIT_CS | bmBITSPI_BIT_DI | bmBITSPI_BIT_CLK;
3399
        orl     _OEA,#0x0B
3400
;       ../../include/ztex-flash2.h:523: if ( spi_wait() ) {
3401
        push    ar2
3402
        push    ar3
3403
        lcall   _spi_wait
3404
        mov     a,dpl
3405
        pop     ar3
3406
        pop     ar2
3407
        jz      00104$
3408
;       ../../include/ztex-flash2.h:524: return flash_ec;
3409
        mov     dptr,#_flash_ec
3410
        movx    a,@dptr
3411
        mov     dpl,a
3412
        ret
3413
00104$:
3414
;       ../../include/ztex-flash2.h:526: spi_write_sector = s;
3415
        mov     dptr,#_spi_write_sector
3416
        mov     a,r2
3417
        movx    @dptr,a
3418
        inc     dptr
3419
        mov     a,r3
3420
        movx    @dptr,a
3421
;       ../../include/ztex-flash2.h:527: s = s << ((BYTE)flash_sector_size - 8);
3422
        mov     dptr,#_flash_sector_size
3423
        movx    a,@dptr
3424
        mov     r4,a
3425
        inc     dptr
3426
        movx    a,@dptr
3427
        mov     r5,#0x00
3428
        mov     a,r4
3429
        add     a,#0xf8
3430
        mov     r4,a
3431
        mov     a,r5
3432
        addc    a,#0xff
3433
        mov     r5,a
3434
        mov     b,r4
3435
        inc     b
3436
        sjmp    00112$
3437
00111$:
3438
        mov     a,r2
3439
        add     a,r2
3440
        mov     r2,a
3441
        mov     a,r3
3442
        rlc     a
3443
        mov     r3,a
3444
00112$:
3445
        djnz    b,00111$
3446
;       ../../include/ztex-flash2.h:528: spi_write_addr_hi = s;
3447
        mov     dptr,#_spi_write_addr_hi
3448
        mov     a,r2
3449
        movx    @dptr,a
3450
        inc     dptr
3451
        mov     a,r3
3452
        movx    @dptr,a
3453
;       ../../include/ztex-flash2.h:529: spi_write_addr_lo = 0;
3454
        mov     dptr,#_spi_write_addr_lo
3455
        clr     a
3456
        movx    @dptr,a
3457
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3458
        mov     dptr,#_spi_last_cmd
3459
        mov     a,#0x06
3460
        movx    @dptr,a
3461
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3462
        push    ar2
3463
        push    ar3
3464
        lcall   _spi_select
3465
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3466
        mov     dpl,#0x06
3467
        lcall   _spi_write_byte
3468
;       ../../include/ztex-flash2.h:532: spi_deselect();
3469
        lcall   _spi_deselect
3470
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3471
        mov     dptr,#_spi_erase_cmd
3472
        movx    a,@dptr
3473
        mov     dptr,#_spi_last_cmd
3474
        movx    @dptr,a
3475
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3476
        lcall   _spi_select
3477
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3478
        mov     dptr,#_spi_erase_cmd
3479
        movx    a,@dptr
3480
        mov     dpl,a
3481
        lcall   _spi_write_byte
3482
        pop     ar3
3483
;       ../../include/ztex-flash2.h:363:
3484
        mov     dpl,r3
3485
        push    ar3
3486
        lcall   _spi_write_byte
3487
        pop     ar3
3488
        pop     ar2
3489
;       ../../include/ztex-flash2.h:536: spi_write_byte(s & 255);
3490
        mov     dpl,r2
3491
        lcall   _spi_write_byte
3492
;       ../../include/ztex-flash2.h:537: spi_write_byte(0);
3493
        mov     dpl,#0x00
3494
        lcall   _spi_write_byte
3495
;       ../../include/ztex-flash2.h:538: spi_deselect();
3496
        lcall   _spi_deselect
3497
;       ../../include/ztex-flash2.h:540: spi_need_pp = 1;
3498
        mov     dptr,#_spi_need_pp
3499
        mov     a,#0x01
3500
        movx    @dptr,a
3501
;       ../../include/ztex-flash2.h:541: return 0;
3502
        mov     dpl,#0x00
3503
        ret
3504
;------------------------------------------------------------
3505
;Allocation info for local variables in function 'flash_write_finish_sector'
3506
;------------------------------------------------------------
3507
;n                         Allocated to registers
3508
;------------------------------------------------------------
3509
;       ../../include/ztex-flash2.h:551: BYTE flash_write_finish_sector (WORD n) {
3510
;       -----------------------------------------
3511
;        function flash_write_finish_sector
3512
;       -----------------------------------------
3513
_flash_write_finish_sector:
3514
;       ../../include/ztex-flash2.h:553: spi_deselect();
3515
        lcall   _spi_deselect
3516
;       ../../include/ztex-flash2.h:554: return 0;
3517
        mov     dpl,#0x00
3518
        ret
3519
;------------------------------------------------------------
3520
;Allocation info for local variables in function 'flash_write_finish'
3521
;------------------------------------------------------------
3522
;------------------------------------------------------------
3523
;       ../../include/ztex-flash2.h:564: void flash_write_finish () {
3524
;       -----------------------------------------
3525
;        function flash_write_finish
3526
;       -----------------------------------------
3527
_flash_write_finish:
3528
;       ../../include/ztex-flash2.h:565: spi_deselect();
3529
        ljmp    _spi_deselect
3530
;------------------------------------------------------------
3531
;Allocation info for local variables in function 'flash_write_next'
3532
;------------------------------------------------------------
3533
;------------------------------------------------------------
3534
;       ../../include/ztex-flash2.h:575: BYTE flash_write_next () {
3535
;       -----------------------------------------
3536
;        function flash_write_next
3537
;       -----------------------------------------
3538
_flash_write_next:
3539
;       ../../include/ztex-flash2.h:576: spi_deselect();
3540
        lcall   _spi_deselect
3541
;       ../../include/ztex-flash2.h:577: return flash_write_init(spi_write_sector+1);
3542
        mov     dptr,#_spi_write_sector
3543
        movx    a,@dptr
3544
        mov     r2,a
3545
        inc     dptr
3546
        movx    a,@dptr
3547
        mov     r3,a
3548
        mov     dpl,r2
3549
        mov     dph,r3
3550
        inc     dptr
3551
        ljmp    _flash_write_init
3552
;------------------------------------------------------------
3553
;Allocation info for local variables in function 'flash_init'
3554
;------------------------------------------------------------
3555
;i                         Allocated to registers r2
3556
;------------------------------------------------------------
3557
;       ../../include/ztex-flash2.h:585: void flash_init() {
3558
;       -----------------------------------------
3559
;        function flash_init
3560
;       -----------------------------------------
3561
_flash_init:
3562
;       ../../include/ztex-flash2.h:588: PORTCCFG = 0;
3563
        mov     dptr,#_PORTCCFG
3564
        clr     a
3565
        movx    @dptr,a
3566
;       ../../include/ztex-flash2.h:590: flash_enabled = 1;
3567
        mov     dptr,#_flash_enabled
3568
        mov     a,#0x01
3569
        movx    @dptr,a
3570
;       ../../include/ztex-flash2.h:591: flash_ec = 0;
3571
        mov     dptr,#_flash_ec
3572
        clr     a
3573
        movx    @dptr,a
3574
;       ../../include/ztex-flash2.h:592: flash_sector_size = 0x8010;  // 64 KByte
3575
        mov     dptr,#_flash_sector_size
3576
        mov     a,#0x10
3577
        movx    @dptr,a
3578
        inc     dptr
3579
        mov     a,#0x80
3580
        movx    @dptr,a
3581
;       ../../include/ztex-flash2.h:593: spi_erase_cmd = 0xd8;
3582
        mov     dptr,#_spi_erase_cmd
3583
        mov     a,#0xD8
3584
        movx    @dptr,a
3585
;       ../../include/ztex-flash2.h:595: OESPI_OPORT &= ~bmBITSPI_BIT_DO;
3586
        anl     _OEC,#0xFE
3587
;       ../../include/ztex-flash2.h:596: OESPI_PORT |= bmBITSPI_BIT_CS | bmBITSPI_BIT_DI | bmBITSPI_BIT_CLK;
3588
        orl     _OEA,#0x0B
3589
;       ../../include/ztex-flash2.h:597: SPI_CS = 1;
3590
        setb    _IOA3
3591
;       ../../include/ztex-flash2.h:598: spi_clocks(0);                         // 256 clocks
3592
        mov     dpl,#0x00
3593
        lcall   _spi_clocks
3594
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3595
        mov     dptr,#_spi_last_cmd
3596
        mov     a,#0x90
3597
        movx    @dptr,a
3598
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3599
        lcall   _spi_select
3600
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3601
        mov     dpl,#0x90
3602
        lcall   _spi_write_byte
3603
;       ../../include/ztex-flash2.h:363:
3604
        mov     dpl,#0x18
3605
        lcall   _spi_clocks
3606
;       ../../include/ztex-flash2.h:602: spi_device = flash_read_byte();
3607
        lcall   _flash_read_byte
3608
        mov     a,dpl
3609
        mov     dptr,#_spi_device
3610
        movx    @dptr,a
3611
;       ../../include/ztex-flash2.h:603: spi_deselect();                                // deselect
3612
        lcall   _spi_deselect
3613
;       ../../include/ztex-flash2.h:359: spi_last_cmd = $0;
3614
        mov     dptr,#_spi_last_cmd
3615
        mov     a,#0x9F
3616
        movx    @dptr,a
3617
;       ../../include/ztex-flash2.h:360: spi_select();                          // select
3618
        lcall   _spi_select
3619
;       ../../include/ztex-flash2.h:361: spi_write_byte($0);                            // CMD 90h
3620
        mov     dpl,#0x9F
3621
        lcall   _spi_write_byte
3622
;       ../../include/ztex-flash2.h:363:
3623
        mov     _flash_read_PARM_2,#0x03
3624
        mov     dptr,#_spi_buffer
3625
        lcall   _flash_read
3626
;       ../../include/ztex-flash2.h:364: /* *********************************************************************
3627
        lcall   _spi_deselect
3628
;       ../../include/ztex-flash2.h:608: if ( spi_buffer[2]<16 || spi_buffer[2]>24 ) {
3629
        mov     dptr,#(_spi_buffer + 0x0002)
3630
        movx    a,@dptr
3631
        mov     r2,a
3632
        cjne    r2,#0x10,00109$
3633
00109$:
3634
        jc      00104$
3635
        mov     a,r2
3636
        add     a,#0xff - 0x18
3637
        jc      00104$
3638
;       ../../include/ztex-flash2.h:611: spi_vendor = spi_buffer[0];
3639
        mov     dptr,#_spi_buffer
3640
        movx    a,@dptr
3641
        mov     dptr,#_spi_vendor
3642
        movx    @dptr,a
3643
;       ../../include/ztex-flash2.h:612: spi_memtype = spi_buffer[1];
3644
        mov     dptr,#(_spi_buffer + 0x0001)
3645
        movx    a,@dptr
3646
        mov     dptr,#_spi_memtype
3647
        movx    @dptr,a
3648
;       ../../include/ztex-flash2.h:628: i=spi_buffer[2]-16;
3649
        mov     a,r2
3650
        add     a,#0xf0
3651
        mov     r2,a
3652
;       ../../include/ztex-flash2.h:630: flash_sectors = 1 << i;
3653
        mov     b,r2
3654
        inc     b
3655
        mov     r2,#0x01
3656
        mov     r3,#0x00
3657
        sjmp    00113$
3658
00112$:
3659
        mov     a,r2
3660
        add     a,r2
3661
        mov     r2,a
3662
        mov     a,r3
3663
        rlc     a
3664
        mov     r3,a
3665
00113$:
3666
        djnz    b,00112$
3667
        mov     dptr,#_flash_sectors
3668
        mov     a,r2
3669
        movx    @dptr,a
3670
        inc     dptr
3671
        mov     a,r3
3672
        movx    @dptr,a
3673
        mov     a,r3
3674
        rlc     a
3675
        subb    a,acc
3676
        inc     dptr
3677
        movx    @dptr,a
3678
        inc     dptr
3679
        movx    @dptr,a
3680
;       ../../include/ztex-flash2.h:632: return;
3681
;       ../../include/ztex-flash2.h:634: disable:
3682
        ret
3683
00104$:
3684
;       ../../include/ztex-flash2.h:635: flash_enabled = 0;
3685
        mov     dptr,#_flash_enabled
3686
        clr     a
3687
        movx    @dptr,a
3688
;       ../../include/ztex-flash2.h:636: flash_ec = FLASH_EC_NOTSUPPORTED;
3689
        mov     dptr,#_flash_ec
3690
        mov     a,#0x07
3691
        movx    @dptr,a
3692
;       ../../include/ztex-flash2.h:637: OESPI_PORT &= ~( bmBITSPI_BIT_CS | bmBITSPI_BIT_DI | bmBITSPI_BIT_CLK );
3693
        anl     _OEA,#0xF4
3694
        ret
3695
;------------------------------------------------------------
3696
;Allocation info for local variables in function 'spi_read_ep0'
3697
;------------------------------------------------------------
3698
;------------------------------------------------------------
3699
;       ../../include/ztex-flash2.h:663: void spi_read_ep0 () {
3700
;       -----------------------------------------
3701
;        function spi_read_ep0
3702
;       -----------------------------------------
3703
_spi_read_ep0:
3704
;       ../../include/ztex-flash2.h:664: flash_read(EP0BUF, ep0_payload_transfer);
3705
        mov     dptr,#_ep0_payload_transfer
3706
        movx    a,@dptr
3707
        mov     _flash_read_PARM_2,a
3708
        mov     dptr,#_EP0BUF
3709
        lcall   _flash_read
3710
;       ../../include/ztex-flash2.h:665: if ( ep0_read_mode==2 && ep0_payload_remaining==0 ) {
3711
        mov     dptr,#_ep0_read_mode
3712
        movx    a,@dptr
3713
        mov     r2,a
3714
        cjne    r2,#0x02,00104$
3715
        mov     dptr,#_ep0_payload_remaining
3716
        movx    a,@dptr
3717
        mov     r2,a
3718
        inc     dptr
3719
        movx    a,@dptr
3720
        mov     r3,a
3721
        orl     a,r2
3722
        jnz     00104$
3723
;       ../../include/ztex-flash2.h:666: spi_deselect();
3724
        ljmp    _spi_deselect
3725
00104$:
3726
        ret
3727
;------------------------------------------------------------
3728
;Allocation info for local variables in function 'spi_send_ep0'
3729
;------------------------------------------------------------
3730
;------------------------------------------------------------
3731
;       ../../include/ztex-flash2.h:690: void spi_send_ep0 () {
3732
;       -----------------------------------------
3733
;        function spi_send_ep0
3734
;       -----------------------------------------
3735
_spi_send_ep0:
3736
;       ../../include/ztex-flash2.h:691: flash_write(EP0BUF, ep0_payload_transfer);
3737
        mov     dptr,#_ep0_payload_transfer
3738
        movx    a,@dptr
3739
        mov     _flash_write_PARM_2,a
3740
        mov     dptr,#_EP0BUF
3741
        lcall   _flash_write
3742
;       ../../include/ztex-flash2.h:692: if ( ep0_write_mode==2 && ep0_payload_remaining==0 ) {
3743
        mov     dptr,#_ep0_write_mode
3744
        movx    a,@dptr
3745
        mov     r2,a
3746
        cjne    r2,#0x02,00104$
3747
        mov     dptr,#_ep0_payload_remaining
3748
        movx    a,@dptr
3749
        mov     r2,a
3750
        inc     dptr
3751
        movx    a,@dptr
3752
        mov     r3,a
3753
        orl     a,r2
3754
        jnz     00104$
3755
;       ../../include/ztex-flash2.h:693: spi_deselect();
3756
        ljmp    _spi_deselect
3757
00104$:
3758
        ret
3759
;------------------------------------------------------------
3760
;Allocation info for local variables in function 'reset_fpga'
3761
;------------------------------------------------------------
3762
;------------------------------------------------------------
3763
;       ../../include/ztex-fpga7.h:39: static void reset_fpga () {
3764
;       -----------------------------------------
3765
;        function reset_fpga
3766
;       -----------------------------------------
3767
_reset_fpga:
3768
;       ../../include/ztex-fpga7.h:40: OEE = (OEE & ~bmBIT6) | bmBIT7;
3769
        mov     r2,_OEE
3770
        mov     a,#0xBF
3771
        anl     a,r2
3772
        mov     b,a
3773
        mov     a,#0x80
3774
        orl     a,b
3775
        mov     _OEE,a
3776
;       ../../include/ztex-fpga7.h:41: IOE = IOE & ~bmBIT7;
3777
        anl     _IOE,#0x7F
3778
;       ../../include/ztex-fpga7.h:42: wait(1);
3779
        mov     dptr,#0x0001
3780
        lcall   _wait
3781
;       ../../include/ztex-fpga7.h:43: IOE = IOE | bmBIT7;
3782
        orl     _IOE,#0x80
3783
;       ../../include/ztex-fpga7.h:44: fpga_conf_initialized = 0;
3784
        mov     dptr,#_fpga_conf_initialized
3785
        clr     a
3786
        movx    @dptr,a
3787
        ret
3788
;------------------------------------------------------------
3789
;Allocation info for local variables in function 'init_fpga'
3790
;------------------------------------------------------------
3791
;------------------------------------------------------------
3792
;       ../../include/ztex-fpga7.h:50: static void init_fpga () {
3793
;       -----------------------------------------
3794
;        function init_fpga
3795
;       -----------------------------------------
3796
_init_fpga:
3797
;       ../../include/ztex-fpga7.h:51: IOE = IOE | bmBIT7;
3798
        orl     _IOE,#0x80
3799
;       ../../include/ztex-fpga7.h:52: OEE = (OEE & ~bmBIT6) | bmBIT7;
3800
        mov     r2,_OEE
3801
        mov     a,#0xBF
3802
        anl     a,r2
3803
        mov     b,a
3804
        mov     a,#0x80
3805
        orl     a,b
3806
        mov     _OEE,a
3807
;       ../../include/ztex-fpga7.h:53: if ( ! (IOE & bmBIT6) ) {
3808
        mov     a,_IOE
3809
        jb      acc.6,00102$
3810
;       ../../include/ztex-fpga7.h:55: IOE = IOE & ~bmBIT7;                      // PROG_B = 0
3811
        anl     _IOE,#0x7F
3812
;       ../../include/ztex-fpga7.h:56: OEA = (OEA & bmBIT2 ) | bmBIT4 | bmBIT5 | bmBIT6;
3813
        mov     a,#0x04
3814
        anl     a,_OEA
3815
        mov     b,a
3816
        mov     a,#0x70
3817
        orl     a,b
3818
        mov     _OEA,a
3819
;       ../../include/ztex-fpga7.h:57: IOA = (IOA & bmBIT2 ) | bmBIT5;
3820
        mov     a,#0x04
3821
        anl     a,_IOA
3822
        mov     b,a
3823
        mov     a,#0x20
3824
        orl     a,b
3825
        mov     _IOA,a
3826
;       ../../include/ztex-fpga7.h:58: wait(1);
3827
        mov     dptr,#0x0001
3828
        lcall   _wait
3829
;       ../../include/ztex-fpga7.h:59: IOE = IOE | bmBIT7;                      // PROG_B = 1
3830
        orl     _IOE,#0x80
3831
00102$:
3832
;       ../../include/ztex-fpga7.h:62: fpga_conf_initialized = 0;
3833
        mov     dptr,#_fpga_conf_initialized
3834
        clr     a
3835
        movx    @dptr,a
3836
        ret
3837
;------------------------------------------------------------
3838
;Allocation info for local variables in function 'init_fpga_configuration'
3839
;------------------------------------------------------------
3840
;k                         Allocated to registers r2 r3
3841
;------------------------------------------------------------
3842
;       ../../include/ztex-fpga7.h:68: static void init_fpga_configuration () {
3843
;       -----------------------------------------
3844
;        function init_fpga_configuration
3845
;       -----------------------------------------
3846
_init_fpga_configuration:
3847
;       ../../include/ztex-fpga7.h:75: IFCONFIG = bmBIT7;
3848
        mov     dptr,#_IFCONFIG
3849
        mov     a,#0x80
3850
        movx    @dptr,a
3851
;       ../../include/ezregs.h:46: __endasm;
3852
 
3853
         nop
3854
         nop
3855
         nop
3856
         nop
3857
 
3858
;       ../../include/ztex-fpga7.h:77: PORTACFG = 0;
3859
        mov     dptr,#_PORTACFG
3860
;       ../../include/ztex-fpga7.h:78: PORTCCFG = 0;
3861
        clr     a
3862
        movx    @dptr,a
3863
        mov     dptr,#_PORTCCFG
3864
        movx    @dptr,a
3865
;       ../../include/ztex-fpga7.h:80: OOEA = OEA;
3866
        mov     dptr,#_OOEA
3867
        mov     a,_OEA
3868
        movx    @dptr,a
3869
;       ../../include/ztex-fpga7.h:81: fpga_conf_initialized = 123;
3870
        mov     dptr,#_fpga_conf_initialized
3871
        mov     a,#0x7B
3872
        movx    @dptr,a
3873
;       ../../include/ztex-fpga7.h:83: OEA &= bmBIT2;                    // only unsed PA bit
3874
        anl     _OEA,#0x04
3875
;       ../../include/ztex-fpga7.h:85: OEE = (OEE & ~bmBIT6) | bmBIT7;
3876
        mov     r2,_OEE
3877
        mov     a,#0xBF
3878
        anl     a,r2
3879
        mov     b,a
3880
        mov     a,#0x80
3881
        orl     a,b
3882
        mov     _OEE,a
3883
;       ../../include/ztex-fpga7.h:86: IOE = IOE & ~bmBIT7;              // PROG_B = 0
3884
        anl     _IOE,#0x7F
3885
;       ../../include/ztex-fpga7.h:89: OEA |= bmBIT1 | bmBIT4 | bmBIT5 | bmBIT6;
3886
        orl     _OEA,#0x72
3887
;       ../../include/ztex-fpga7.h:90: IOA = ( IOA & bmBIT2 ) | bmBIT1 | bmBIT5;
3888
        mov     a,#0x04
3889
        anl     a,_IOA
3890
        mov     b,a
3891
        mov     a,#0x22
3892
        orl     a,b
3893
        mov     _IOA,a
3894
;       ../../include/ztex-fpga7.h:91: wait(5);
3895
        mov     dptr,#0x0005
3896
        lcall   _wait
3897
;       ../../include/ztex-fpga7.h:93: IOE = IOE | bmBIT7;                      // PROG_B = 1
3898
        orl     _IOE,#0x80
3899
;       ../../include/ztex-fpga7.h:94: IOA1 = 0;                                // CS = 0
3900
        clr     _IOA1
3901
;       ../../include/ztex-fpga7.h:97: while (!IOA7 && k<65535)
3902
        mov     r2,#0x00
3903
        mov     r3,#0x00
3904
00102$:
3905
        jb      _IOA7,00104$
3906
        mov     ar4,r2
3907
        mov     ar5,r3
3908
        mov     r6,#0x00
3909
        mov     r7,#0x00
3910
        clr     c
3911
        mov     a,r4
3912
        subb    a,#0xFF
3913
        mov     a,r5
3914
        subb    a,#0xFF
3915
        mov     a,r6
3916
        subb    a,#0x00
3917
        mov     a,r7
3918
        xrl     a,#0x80
3919
        subb    a,#0x80
3920
        jnc     00104$
3921
;       ../../include/ztex-fpga7.h:98: k++;
3922
        inc     r2
3923
        cjne    r2,#0x00,00102$
3924
        inc     r3
3925
        sjmp    00102$
3926
00104$:
3927
;       ../../include/ztex-fpga7.h:101: OEA |= bmBIT0;                  // ready for configuration
3928
        orl     _OEA,#0x01
3929
;       ../../include/ztex-fpga7.h:103: fpga_init_b = IOA7 ? 200 : 100;
3930
        jnb     _IOA7,00107$
3931
        mov     r2,#0xC8
3932
        sjmp    00108$
3933
00107$:
3934
        mov     r2,#0x64
3935
00108$:
3936
        mov     dptr,#_fpga_init_b
3937
        mov     a,r2
3938
        movx    @dptr,a
3939
;       ../../include/ztex-fpga7.h:104: fpga_bytes = 0;
3940
        mov     dptr,#_fpga_bytes
3941
        clr     a
3942
        movx    @dptr,a
3943
        inc     dptr
3944
        movx    @dptr,a
3945
        inc     dptr
3946
        movx    @dptr,a
3947
        inc     dptr
3948
        movx    @dptr,a
3949
;       ../../include/ztex-fpga7.h:105: fpga_checksum = 0;
3950
        mov     dptr,#_fpga_checksum
3951
        clr     a
3952
        movx    @dptr,a
3953
        ret
3954
;------------------------------------------------------------
3955
;Allocation info for local variables in function 'post_fpga_config'
3956
;------------------------------------------------------------
3957
;------------------------------------------------------------
3958
;       ../../include/ztex-fpga7.h:111: static void post_fpga_config () {
3959
;       -----------------------------------------
3960
;        function post_fpga_config
3961
;       -----------------------------------------
3962
_post_fpga_config:
3963
;       ../../include/ztex-fpga7.h:113: }
3964
        ret
3965
;------------------------------------------------------------
3966
;Allocation info for local variables in function 'finish_fpga_configuration'
3967
;------------------------------------------------------------
3968
;w                         Allocated to registers r2
3969
;------------------------------------------------------------
3970
;       ../../include/ztex-fpga7.h:118: static void finish_fpga_configuration () {
3971
;       -----------------------------------------
3972
;        function finish_fpga_configuration
3973
;       -----------------------------------------
3974
_finish_fpga_configuration:
3975
;       ../../include/ztex-fpga7.h:120: fpga_init_b += IOA7 ? 22 : 11;
3976
        jnb     _IOA7,00109$
3977
        mov     r2,#0x16
3978
        sjmp    00110$
3979
00109$:
3980
        mov     r2,#0x0B
3981
00110$:
3982
        mov     dptr,#_fpga_init_b
3983
        movx    a,@dptr
3984
        mov     r3,a
3985
        mov     a,r2
3986
        add     a,r3
3987
        movx    @dptr,a
3988
;       ../../include/ztex-fpga7.h:122: for ( w=0; w<64; w++ ) {
3989
        mov     r2,#0x00
3990
00103$:
3991
        cjne    r2,#0x40,00117$
3992
00117$:
3993
        jnc     00106$
3994
;       ../../include/ztex-fpga7.h:123: IOA0 = 1; IOA0 = 0;
3995
        setb    _IOA0
3996
        clr     _IOA0
3997
;       ../../include/ztex-fpga7.h:122: for ( w=0; w<64; w++ ) {
3998
        inc     r2
3999
        sjmp    00103$
4000
00106$:
4001
;       ../../include/ztex-fpga7.h:125: IOA1 = 1;
4002
        setb    _IOA1
4003
;       ../../include/ztex-fpga7.h:126: IOA0 = 1; IOA0 = 0;
4004
        setb    _IOA0
4005
        clr     _IOA0
4006
;       ../../include/ztex-fpga7.h:127: IOA0 = 1; IOA0 = 0;
4007
        setb    _IOA0
4008
        clr     _IOA0
4009
;       ../../include/ztex-fpga7.h:128: IOA0 = 1; IOA0 = 0;
4010
        setb    _IOA0
4011
        clr     _IOA0
4012
;       ../../include/ztex-fpga7.h:129: IOA0 = 1; IOA0 = 0;
4013
        setb    _IOA0
4014
        clr     _IOA0
4015
;       ../../include/ztex-fpga7.h:131: OEA = OOEA;
4016
        mov     dptr,#_OOEA
4017
        movx    a,@dptr
4018
        mov     _OEA,a
4019
;       ../../include/ztex-fpga7.h:132: if ( IOE & bmBIT6 )  {
4020
        mov     a,_IOE
4021
        jnb     acc.6,00107$
4022
;       ../../include/ztex-fpga7.h:133: post_fpga_config();
4023
        ljmp    _post_fpga_config
4024
00107$:
4025
        ret
4026
;------------------------------------------------------------
4027
;Allocation info for local variables in function 'fpga_send_ep0'
4028
;------------------------------------------------------------
4029
;oOEC                      Allocated with name '_fpga_send_ep0_oOEC_1_1'
4030
;------------------------------------------------------------
4031
;       ../../include/ztex-fpga7.h:169: void fpga_send_ep0() {
4032
;       -----------------------------------------
4033
;        function fpga_send_ep0
4034
;       -----------------------------------------
4035
_fpga_send_ep0:
4036
;       ../../include/ztex-fpga7.h:171: oOEC = OEC;
4037
        mov     _fpga_send_ep0_oOEC_1_1,_OEC
4038
;       ../../include/ztex-fpga7.h:172: OEC = 255;
4039
        mov     _OEC,#0xFF
4040
;       ../../include/ztex-fpga7.h:173: fpga_bytes += ep0_payload_transfer;
4041
        mov     dptr,#_ep0_payload_transfer
4042
        movx    a,@dptr
4043
        mov     r3,a
4044
        mov     dptr,#_fpga_bytes
4045
        movx    a,@dptr
4046
        mov     r4,a
4047
        inc     dptr
4048
        movx    a,@dptr
4049
        mov     r5,a
4050
        inc     dptr
4051
        movx    a,@dptr
4052
        mov     r6,a
4053
        inc     dptr
4054
        movx    a,@dptr
4055
        mov     r7,a
4056
        mov     r0,#0x00
4057
        mov     r1,#0x00
4058
        mov     r2,#0x00
4059
        mov     dptr,#_fpga_bytes
4060
        mov     a,r3
4061
        add     a,r4
4062
        movx    @dptr,a
4063
        mov     a,r0
4064
        addc    a,r5
4065
        inc     dptr
4066
        movx    @dptr,a
4067
        mov     a,r1
4068
        addc    a,r6
4069
        inc     dptr
4070
        movx    @dptr,a
4071
        mov     a,r2
4072
        addc    a,r7
4073
        inc     dptr
4074
        movx    @dptr,a
4075
;       ../../include/ztex-fpga7.h:201: OEC = oOEC;
4076
 
4077
         mov dptr,#_EP0BCL
4078
         movx a,@dptr
4079
         jz 010000$
4080
           mov r2,a
4081
         mov _AUTOPTRL1,#(_EP0BUF)
4082
         mov _AUTOPTRH1,#(_EP0BUF >> 8)
4083
         mov _AUTOPTRSETUP,#0x07
4084
         mov dptr,#_fpga_checksum
4085
         movx a,@dptr
4086
         mov r1,a
4087
         mov dptr,#_XAUTODAT1
4088
        010001$:
4089
         movx a,@dptr
4090
         mov _IOC,a
4091
         setb _IOA0
4092
         add a,r1
4093
         mov r1,a
4094
         clr _IOA0
4095
         djnz r2, 010001$
4096
;       # 194 "../../include/ztex-fpga7.h"
4097
 
4098
         mov dptr,#_fpga_checksum
4099
         mov a,r1
4100
         movx @dptr,a
4101
 
4102
        010000$:
4103
 
4104
;       ../../include/ztex-fpga7.h:202: if ( EP0BCL<64 ) {
4105
        mov     _OEC,_fpga_send_ep0_oOEC_1_1
4106
;       ../../include/ztex-fpga7.h:203: finish_fpga_configuration();
4107
        mov     dptr,#_EP0BCL
4108
        movx    a,@dptr
4109
        mov     r2,a
4110
        cjne    r2,#0x40,00106$
4111
00106$:
4112
        jnc     00103$
4113
;       ../../include/ztex-fpga7.h:204: }
4114
        ljmp    _finish_fpga_configuration
4115
00103$:
4116
        ret
4117
;------------------------------------------------------------
4118
;Allocation info for local variables in function 'fpga_configure_from_flash'
4119
;------------------------------------------------------------
4120
;force                     Allocated to registers r2
4121
;i                         Allocated to registers r2 r3
4122
;------------------------------------------------------------
4123
;       ../../include/ztex-fpga7.h:227: BYTE fpga_configure_from_flash( BYTE force ) {
4124
;       -----------------------------------------
4125
;        function fpga_configure_from_flash
4126
;       -----------------------------------------
4127
_fpga_configure_from_flash:
4128
;       ../../include/ztex-fpga7.h:231: if ( ( force == 0 ) && ( IOE & bmBIT6 ) ) {
4129
        mov     a,dpl
4130
        mov     r2,a
4131
        jnz     00102$
4132
        mov     a,_IOE
4133
        jnb     acc.6,00102$
4134
;       ../../include/ztex-fpga7.h:232: fpga_flash_result = 1;
4135
        mov     dptr,#_fpga_flash_result
4136
        mov     a,#0x01
4137
        movx    @dptr,a
4138
;       ../../include/ztex-fpga7.h:233: return 1;
4139
        mov     dpl,#0x01
4140
        ret
4141
00102$:
4142
;       ../../include/ztex-fpga7.h:236: fpga_flash_result = 0;
4143
        mov     dptr,#_fpga_flash_result
4144
        clr     a
4145
        movx    @dptr,a
4146
;       ../../include/ztex-fpga7.h:238: IFCONFIG = bmBIT7;
4147
        mov     dptr,#_IFCONFIG
4148
        mov     a,#0x80
4149
        movx    @dptr,a
4150
;       ../../include/ezregs.h:46: __endasm;
4151
 
4152
         nop
4153
         nop
4154
         nop
4155
         nop
4156
 
4157
;       ../../include/ztex-fpga7.h:240: PORTACFG = 0;
4158
        mov     dptr,#_PORTACFG
4159
;       ../../include/ztex-fpga7.h:241: PORTCCFG = 0;
4160
        clr     a
4161
        movx    @dptr,a
4162
        mov     dptr,#_PORTCCFG
4163
        movx    @dptr,a
4164
;       ../../include/ztex-fpga7.h:244: OEA &= bmBIT2;                   // only unsed PA bit
4165
        anl     _OEA,#0x04
4166
;       ../../include/ztex-fpga7.h:247: OEC &= ~bmBIT0;
4167
        anl     _OEC,#0xFE
4168
;       ../../include/ztex-fpga7.h:249: OEE = (OEE & ~bmBIT6) | bmBIT7;
4169
        mov     r2,_OEE
4170
        mov     a,#0xBF
4171
        anl     a,r2
4172
        mov     b,a
4173
        mov     a,#0x80
4174
        orl     a,b
4175
        mov     _OEE,a
4176
;       ../../include/ztex-fpga7.h:250: IOE = IOE & ~bmBIT7;             // PROG_B = 0
4177
        anl     _IOE,#0x7F
4178
;       ../../include/ztex-fpga7.h:253: OEA |= bmBIT4 | bmBIT5;
4179
        orl     _OEA,#0x30
4180
;       ../../include/ztex-fpga7.h:254: IOA = ( IOA & bmBIT2 ) | bmBIT4;
4181
        mov     a,#0x04
4182
        anl     a,_IOA
4183
        mov     b,a
4184
        mov     a,#0x10
4185
        orl     a,b
4186
        mov     _IOA,a
4187
;       ../../include/ztex-fpga7.h:255: wait(1);
4188
        mov     dptr,#0x0001
4189
        lcall   _wait
4190
;       ../../include/ztex-fpga7.h:257: IOE = IOE | bmBIT7;                     // PROG_B = 1
4191
        orl     _IOE,#0x80
4192
;       ../../include/ztex-fpga7.h:260: wait(20);
4193
        mov     dptr,#0x0014
4194
        lcall   _wait
4195
;       ../../include/ztex-fpga7.h:261: for (i=0; IOA7 && (!IOA1) && i<4000; i++ ) {
4196
        mov     r2,#0x00
4197
        mov     r3,#0x00
4198
00109$:
4199
        jnb     _IOA7,00112$
4200
        jb      _IOA1,00112$
4201
        clr     c
4202
        mov     a,r2
4203
        subb    a,#0xA0
4204
        mov     a,r3
4205
        subb    a,#0x0F
4206
        jnc     00112$
4207
;       ../../include/ztex-fpga7.h:262: wait(1);
4208
        mov     dptr,#0x0001
4209
        push    ar2
4210
        push    ar3
4211
        lcall   _wait
4212
        pop     ar3
4213
        pop     ar2
4214
;       ../../include/ztex-fpga7.h:261: for (i=0; IOA7 && (!IOA1) && i<4000; i++ ) {
4215
        inc     r2
4216
        cjne    r2,#0x00,00109$
4217
        inc     r3
4218
        sjmp    00109$
4219
00112$:
4220
;       ../../include/ztex-fpga7.h:265: wait(1);
4221
        mov     dptr,#0x0001
4222
        lcall   _wait
4223
;       ../../include/ztex-fpga7.h:267: if ( IOE & bmBIT6 )  {
4224
        mov     a,_IOE
4225
        jnb     acc.6,00105$
4226
;       ../../include/ztex-fpga7.h:269: post_fpga_config();
4227
        lcall   _post_fpga_config
4228
        sjmp    00106$
4229
00105$:
4230
;       ../../include/ztex-fpga7.h:274: init_fpga();
4231
        lcall   _init_fpga
4232
;       ../../include/ztex-fpga7.h:275: fpga_flash_result = 4;
4233
        mov     dptr,#_fpga_flash_result
4234
        mov     a,#0x04
4235
        movx    @dptr,a
4236
00106$:
4237
;       ../../include/ztex-fpga7.h:278: return fpga_flash_result;
4238
        mov     dptr,#_fpga_flash_result
4239
        movx    a,@dptr
4240
        mov     dpl,a
4241
        ret
4242
;------------------------------------------------------------
4243
;Allocation info for local variables in function 'fpga_first_free_sector'
4244
;------------------------------------------------------------
4245
;i                         Allocated to registers r2
4246
;j                         Allocated to registers r3
4247
;buf                       Allocated with name '_fpga_first_free_sector_buf_1_1'
4248
;------------------------------------------------------------
4249
;       ../../include/ztex-fpga-flash2.h:31: WORD fpga_first_free_sector() {
4250
;       -----------------------------------------
4251
;        function fpga_first_free_sector
4252
;       -----------------------------------------
4253
_fpga_first_free_sector:
4254
;       ../../include/ztex-fpga-flash2.h:36: if ( config_data_valid ) {
4255
        mov     dptr,#_config_data_valid
4256
        movx    a,@dptr
4257
        mov     r2,a
4258
        jz      00104$
4259
;       ../../include/ztex-fpga-flash2.h:37: mac_eeprom_read ( (__xdata BYTE*) buf, 26, 4 );            // read actual and max bitstream size
4260
        mov     _mac_eeprom_read_PARM_2,#0x1A
4261
        mov     _mac_eeprom_read_PARM_3,#0x04
4262
        mov     dptr,#_fpga_first_free_sector_buf_1_1
4263
        lcall   _mac_eeprom_read
4264
;       ../../include/ztex-fpga-flash2.h:38: if ( buf[1] != 0 ) {
4265
        mov     dptr,#(_fpga_first_free_sector_buf_1_1 + 0x0002)
4266
        movx    a,@dptr
4267
        mov     r2,a
4268
        inc     dptr
4269
        movx    a,@dptr
4270
        mov     r3,a
4271
        orl     a,r2
4272
        jz      00104$
4273
;       ../../include/ztex-fpga-flash2.h:39: return ( ( ( buf[1] > buf[0] ? buf[1] : buf[0] ) - 1 ) >> ((flash_sector_size & 255) - 12) ) + 1;
4274
        mov     dptr,#_fpga_first_free_sector_buf_1_1
4275
        movx    a,@dptr
4276
        mov     r4,a
4277
        inc     dptr
4278
        movx    a,@dptr
4279
        mov     r5,a
4280
        clr     c
4281
        mov     a,r4
4282
        subb    a,r2
4283
        mov     a,r5
4284
        subb    a,r3
4285
        jc      00115$
4286
        mov     ar2,r4
4287
        mov     ar3,r5
4288
00115$:
4289
        dec     r2
4290
        cjne    r2,#0xff,00127$
4291
        dec     r3
4292
00127$:
4293
        mov     dptr,#_flash_sector_size
4294
        movx    a,@dptr
4295
        mov     r4,a
4296
        inc     dptr
4297
        movx    a,@dptr
4298
        mov     r5,#0x00
4299
        mov     a,r4
4300
        add     a,#0xf4
4301
        mov     r4,a
4302
        mov     a,r5
4303
        addc    a,#0xff
4304
        mov     r5,a
4305
        mov     b,r4
4306
        inc     b
4307
        sjmp    00129$
4308
00128$:
4309
        clr     c
4310
        mov     a,r3
4311
        rrc     a
4312
        mov     r3,a
4313
        mov     a,r2
4314
        rrc     a
4315
        mov     r2,a
4316
00129$:
4317
        djnz    b,00128$
4318
        mov     dpl,r2
4319
        mov     dph,r3
4320
        inc     dptr
4321
        ret
4322
00104$:
4323
;       ../../include/ztex-fpga-flash2.h:42: #endif
4324
        mov     dptr,#0x0000
4325
        lcall   _flash_read_init
4326
;       ../../include/ztex-fpga-flash2.h:44: for ( i=0; i<8 && flash_read_byte()==fpga_flash_boot_id[i]; i++ );
4327
        mov     r2,#0x00
4328
00108$:
4329
        cjne    r2,#0x08,00130$
4330
00130$:
4331
        jnc     00111$
4332
        push    ar2
4333
        lcall   _flash_read_byte
4334
        mov     r3,dpl
4335
        pop     ar2
4336
        mov     a,r2
4337
        mov     dptr,#_fpga_flash_boot_id
4338
        movc    a,@a+dptr
4339
        mov     r4,a
4340
        mov     a,r3
4341
        cjne    a,ar4,00111$
4342
        inc     r2
4343
        sjmp    00108$
4344
00111$:
4345
;       ../../include/ztex-fpga-flash2.h:45: if ( i != 8 ) {
4346
        cjne    r2,#0x08,00134$
4347
        sjmp    00106$
4348
00134$:
4349
;       ../../include/ztex-fpga-flash2.h:46: flash_read_finish(flash_sector_size - i);  // dummy-read the rest of the sector + finish read opration
4350
        mov     r3,#0x00
4351
        mov     dptr,#_flash_sector_size
4352
        movx    a,@dptr
4353
        mov     r4,a
4354
        inc     dptr
4355
        movx    a,@dptr
4356
        mov     r5,a
4357
        mov     a,r4
4358
        clr     c
4359
        subb    a,r2
4360
        mov     dpl,a
4361
        mov     a,r5
4362
        subb    a,r3
4363
        mov     dph,a
4364
        lcall   _flash_read_finish
4365
;       ../../include/ztex-fpga-flash2.h:47: return 0;
4366
        mov     dptr,#0x0000
4367
        ret
4368
00106$:
4369
;       ../../include/ztex-fpga-flash2.h:49: i=flash_read_byte();
4370
        lcall   _flash_read_byte
4371
        mov     r2,dpl
4372
;       ../../include/ztex-fpga-flash2.h:50: j=flash_read_byte();
4373
        push    ar2
4374
        lcall   _flash_read_byte
4375
        mov     r3,dpl
4376
;       ../../include/ztex-fpga-flash2.h:51: flash_read_finish(flash_sector_size - 10);         // dummy-read the rest of the sector + finish read opration
4377
        mov     dptr,#_flash_sector_size
4378
        movx    a,@dptr
4379
        mov     r4,a
4380
        inc     dptr
4381
        movx    a,@dptr
4382
        mov     r5,a
4383
        mov     a,r4
4384
        add     a,#0xf6
4385
        mov     dpl,a
4386
        mov     a,r5
4387
        addc    a,#0xff
4388
        mov     dph,a
4389
        push    ar3
4390
        lcall   _flash_read_finish
4391
        pop     ar3
4392
        pop     ar2
4393
;       ../../include/ztex-fpga-flash2.h:53: return (i | (j<<8))+1;
4394
        mov     ar4,r3
4395
        clr     a
4396
        mov     r3,a
4397
        mov     r5,a
4398
        mov     a,r2
4399
        orl     ar3,a
4400
        mov     a,r5
4401
        orl     ar4,a
4402
        mov     dpl,r3
4403
        mov     dph,r4
4404
        inc     dptr
4405
        ret
4406
;------------------------------------------------------------
4407
;Allocation info for local variables in function 'fpga_configure_from_flash_init'
4408
;------------------------------------------------------------
4409
;i                         Allocated to registers r2
4410
;buf                       Allocated with name '_fpga_configure_from_flash_init_buf_1_1'
4411
;------------------------------------------------------------
4412
;       ../../include/ztex-fpga-flash2.h:60: BYTE fpga_configure_from_flash_init() {
4413
;       -----------------------------------------
4414
;        function fpga_configure_from_flash_init
4415
;       -----------------------------------------
4416
_fpga_configure_from_flash_init:
4417
;       ../../include/ztex-fpga-flash2.h:66: if ( config_data_valid ) {
4418
        mov     dptr,#_config_data_valid
4419
        movx    a,@dptr
4420
        mov     r2,a
4421
        jz      00106$
4422
;       ../../include/ztex-fpga-flash2.h:67: mac_eeprom_read ( (__xdata BYTE*) buf, 26, 4 );            // read actual and max bitstream size
4423
        mov     _mac_eeprom_read_PARM_2,#0x1A
4424
        mov     _mac_eeprom_read_PARM_3,#0x04
4425
        mov     dptr,#_fpga_configure_from_flash_init_buf_1_1
4426
        lcall   _mac_eeprom_read
4427
;       ../../include/ztex-fpga-flash2.h:68: if ( buf[1] != 0 ) {
4428
        mov     dptr,#(_fpga_configure_from_flash_init_buf_1_1 + 0x0002)
4429
        movx    a,@dptr
4430
        mov     r2,a
4431
        inc     dptr
4432
        movx    a,@dptr
4433
        mov     r3,a
4434
        orl     a,r2
4435
        jz      00106$
4436
;       ../../include/ztex-fpga-flash2.h:69: if ( buf[0] == 0 ) {
4437
        mov     dptr,#_fpga_configure_from_flash_init_buf_1_1
4438
        movx    a,@dptr
4439
        mov     r2,a
4440
        inc     dptr
4441
        movx    a,@dptr
4442
        mov     r3,a
4443
        orl     a,r2
4444
        jz      00140$
4445
        ljmp    00113$
4446
00140$:
4447
;       ../../include/ztex-fpga-flash2.h:70: return fpga_flash_result = 3;
4448
        mov     dptr,#_fpga_flash_result
4449
        mov     a,#0x03
4450
        movx    @dptr,a
4451
        mov     dpl,#0x03
4452
        ret
4453
;       ../../include/ztex-fpga-flash2.h:73: goto flash_config;
4454
00106$:
4455
;       ../../include/ztex-fpga-flash2.h:80: if ( flash_read_init( 0 ) )                // prepare reading sector 0
4456
        mov     dptr,#0x0000
4457
        lcall   _flash_read_init
4458
        mov     a,dpl
4459
        jz      00132$
4460
;       ../../include/ztex-fpga-flash2.h:81: return fpga_flash_result = 2;
4461
        mov     dptr,#_fpga_flash_result
4462
        mov     a,#0x02
4463
        movx    @dptr,a
4464
        mov     dpl,#0x02
4465
        ret
4466
;       ../../include/ztex-fpga-flash2.h:82: for ( i=0; i<8 && flash_read_byte()==fpga_flash_boot_id[i]; i++ );
4467
00132$:
4468
        mov     r2,#0x00
4469
00120$:
4470
        cjne    r2,#0x08,00142$
4471
00142$:
4472
        jnc     00123$
4473
        push    ar2
4474
        lcall   _flash_read_byte
4475
        mov     r3,dpl
4476
        pop     ar2
4477
        mov     a,r2
4478
        mov     dptr,#_fpga_flash_boot_id
4479
        movc    a,@a+dptr
4480
        mov     r4,a
4481
        mov     a,r3
4482
        cjne    a,ar4,00123$
4483
        inc     r2
4484
        sjmp    00120$
4485
00123$:
4486
;       ../../include/ztex-fpga-flash2.h:83: if ( i != 8 ) {
4487
        cjne    r2,#0x08,00146$
4488
        sjmp    00110$
4489
00146$:
4490
;       ../../include/ztex-fpga-flash2.h:84: flash_read_finish(flash_sector_size - i);  // dummy-read the rest of the sector + finish read opration
4491
        mov     r3,#0x00
4492
        mov     dptr,#_flash_sector_size
4493
        movx    a,@dptr
4494
        mov     r4,a
4495
        inc     dptr
4496
        movx    a,@dptr
4497
        mov     r5,a
4498
        mov     a,r4
4499
        clr     c
4500
        subb    a,r2
4501
        mov     dpl,a
4502
        mov     a,r5
4503
        subb    a,r3
4504
        mov     dph,a
4505
        lcall   _flash_read_finish
4506
;       ../../include/ztex-fpga-flash2.h:85: return fpga_flash_result = 3;
4507
        mov     dptr,#_fpga_flash_result
4508
        mov     a,#0x03
4509
        movx    @dptr,a
4510
        mov     dpl,#0x03
4511
        ret
4512
00110$:
4513
;       ../../include/ztex-fpga-flash2.h:87: i = flash_read_byte();
4514
        lcall   _flash_read_byte
4515
        mov     r2,dpl
4516
;       ../../include/ztex-fpga-flash2.h:88: i |= flash_read_byte();
4517
        push    ar2
4518
        lcall   _flash_read_byte
4519
        mov     r3,dpl
4520
        pop     ar2
4521
        mov     a,r3
4522
        orl     ar2,a
4523
;       ../../include/ztex-fpga-flash2.h:89: flash_read_finish(flash_sector_size - 10);         // dummy-read the rest of the sector + finish read opration
4524
        mov     dptr,#_flash_sector_size
4525
        movx    a,@dptr
4526
        mov     r3,a
4527
        inc     dptr
4528
        movx    a,@dptr
4529
        mov     r4,a
4530
        mov     a,r3
4531
        add     a,#0xf6
4532
        mov     dpl,a
4533
        mov     a,r4
4534
        addc    a,#0xff
4535
        mov     dph,a
4536
        push    ar2
4537
        lcall   _flash_read_finish
4538
        pop     ar2
4539
;       ../../include/ztex-fpga-flash2.h:90: if ( i==0 )
4540
        mov     a,r2
4541
        jnz     00113$
4542
;       ../../include/ztex-fpga-flash2.h:91: return fpga_flash_result = 3;
4543
        mov     dptr,#_fpga_flash_result
4544
        mov     a,#0x03
4545
        movx    @dptr,a
4546
        mov     dpl,#0x03
4547
;       ../../include/ztex-fpga-flash2.h:93: flash_config:
4548
        ret
4549
00113$:
4550
;       ../../include/ztex-fpga-flash2.h:94: fpga_flash_result = fpga_configure_from_flash(0);
4551
        mov     dpl,#0x00
4552
        lcall   _fpga_configure_from_flash
4553
        mov     r2,dpl
4554
        mov     dptr,#_fpga_flash_result
4555
        mov     a,r2
4556
        movx    @dptr,a
4557
;       ../../include/ztex-fpga-flash2.h:95: if ( fpga_flash_result == 1 ) {
4558
        cjne    r2,#0x01,00117$
4559
;       ../../include/ztex-fpga-flash2.h:96: post_fpga_config();
4560
        lcall   _post_fpga_config
4561
        sjmp    00118$
4562
00117$:
4563
;       ../../include/ztex-fpga-flash2.h:98: else if ( fpga_flash_result == 4 ) {
4564
        cjne    r2,#0x04,00118$
4565
;       ../../include/ztex-fpga-flash2.h:99: fpga_flash_result = fpga_configure_from_flash(0);  // up to two tries
4566
        mov     dpl,#0x00
4567
        lcall   _fpga_configure_from_flash
4568
        mov     a,dpl
4569
        mov     dptr,#_fpga_flash_result
4570
        movx    @dptr,a
4571
00118$:
4572
;       ../../include/ztex-fpga-flash2.h:101: return fpga_flash_result;
4573
        mov     dptr,#_fpga_flash_result
4574
        movx    a,@dptr
4575
        mov     dpl,a
4576
        ret
4577
;------------------------------------------------------------
4578
;Allocation info for local variables in function 'abscode_identity'
4579
;------------------------------------------------------------
4580
;------------------------------------------------------------
4581
;       ../../include/ztex-descriptors.h:131: void abscode_identity()// _naked
4582
;       -----------------------------------------
4583
;        function abscode_identity
4584
;       -----------------------------------------
4585
_abscode_identity:
4586
;       ../../include/ztex-descriptors.h:185: + 64
4587
 
4588
            .area ABSCODE (ABS,CODE)
4589
 
4590
            .org 0x06c
4591
            .db 40
4592
 
4593
            .org _ZTEX_DESCRIPTOR_VERSION
4594
            .db 1
4595
 
4596
            .org _ZTEXID
4597
            .ascii "ZTEX"
4598
 
4599
            .org _PRODUCT_ID
4600
            .db 10
4601
            .db 18
4602
            .db 0
4603
            .db 0
4604
 
4605
            .org _FW_VERSION
4606
            .db 0
4607
 
4608
            .org _INTERFACE_VERSION
4609
            .db 1
4610
 
4611
            .org _INTERFACE_CAPABILITIES
4612
;       # 185 "../../include/ztex-descriptors.h"
4613
            .db 0 + 1 + 2 + 4 + 64
4614
;       # 191 "../../include/ztex-descriptors.h"
4615
            .db 0
4616
            .db 0
4617
            .db 0
4618
            .db 0
4619
            .db 0
4620
 
4621
            .org _MODULE_RESERVED
4622
            .db 0
4623
            .db 0
4624
            .db 0
4625
            .db 0
4626
            .db 0
4627
            .db 0
4628
            .db 0
4629
            .db 0
4630
            .db 0
4631
            .db 0
4632
            .db 0
4633
            .db 0
4634
 
4635
            .org _SN_STRING
4636
            .ascii "0000000000"
4637
 
4638
            .area CSEG (CODE)
4639
 
4640
        ret
4641
;------------------------------------------------------------
4642
;Allocation info for local variables in function 'resetToggleData'
4643
;------------------------------------------------------------
4644
;------------------------------------------------------------
4645
;       ../../include/ztex-isr.h:34: static void resetToggleData () {
4646
;       -----------------------------------------
4647
;        function resetToggleData
4648
;       -----------------------------------------
4649
_resetToggleData:
4650
;       ../../include/ztex-isr.h:45: TOGCTL = 0;                                // EP0 out
4651
;       ../../include/ztex-isr.h:46: TOGCTL = 0 | bmBIT5;
4652
;       ../../include/ztex-isr.h:47: TOGCTL = 0x10;                     // EP0 in
4653
;       ../../include/ztex-isr.h:48: TOGCTL = 0x10 | bmBIT5;
4654
        mov     dptr,#_TOGCTL
4655
        clr     a
4656
        movx    @dptr,a
4657
        mov     a,#0x20
4658
        movx    @dptr,a
4659
        mov     a,#0x10
4660
        movx    @dptr,a
4661
        mov     a,#0x30
4662
        movx    @dptr,a
4663
;       ../../include/ztex-isr.h:49: #ifeq[EP1OUT_DIR][OUT]
4664
;       ../../include/ztex-isr.h:51: TOGCTL = 1 | bmBIT5;
4665
;       ../../include/ztex-isr.h:52: #endif
4666
;       ../../include/ztex-isr.h:55: TOGCTL = 0x11 | bmBIT5;
4667
        mov     dptr,#_TOGCTL
4668
        mov     a,#0x01
4669
        movx    @dptr,a
4670
        mov     a,#0x21
4671
        movx    @dptr,a
4672
        mov     a,#0x11
4673
        movx    @dptr,a
4674
        mov     a,#0x31
4675
        movx    @dptr,a
4676
        ret
4677
;------------------------------------------------------------
4678
;Allocation info for local variables in function 'sendStringDescriptor'
4679
;------------------------------------------------------------
4680
;hiAddr                    Allocated with name '_sendStringDescriptor_PARM_2'
4681
;size                      Allocated with name '_sendStringDescriptor_PARM_3'
4682
;loAddr                    Allocated to registers r2
4683
;i                         Allocated to registers r2
4684
;------------------------------------------------------------
4685
;       ../../include/ztex-isr.h:68: static void sendStringDescriptor (BYTE loAddr, BYTE hiAddr, BYTE size)
4686
;       -----------------------------------------
4687
;        function sendStringDescriptor
4688
;       -----------------------------------------
4689
_sendStringDescriptor:
4690
        mov     r2,dpl
4691
;       ../../include/ztex-isr.h:71: if ( size > 31) size = 31;
4692
        mov     a,_sendStringDescriptor_PARM_3
4693
        add     a,#0xff - 0x1F
4694
        jnc     00102$
4695
        mov     _sendStringDescriptor_PARM_3,#0x1F
4696
00102$:
4697
;       ../../include/ztex-isr.h:72: if (SETUPDAT[7] == 0 && SETUPDAT[6]
4698
        mov     dptr,#(_SETUPDAT + 0x0007)
4699
        movx    a,@dptr
4700
        jnz     00104$
4701
        mov     dptr,#(_SETUPDAT + 0x0006)
4702
        movx    a,@dptr
4703
        mov     r3,a
4704
        clr     c
4705
        subb    a,_sendStringDescriptor_PARM_3
4706
        jnc     00104$
4707
        mov     dptr,#(_SETUPDAT + 0x0006)
4708
        movx    a,@dptr
4709
        mov     _sendStringDescriptor_PARM_3,a
4710
00104$:
4711
;       ../../include/ztex-isr.h:73: AUTOPTRSETUP = 7;
4712
        mov     _AUTOPTRSETUP,#0x07
4713
;       ../../include/ztex-isr.h:74: AUTOPTRL1 = loAddr;
4714
        mov     _AUTOPTRL1,r2
4715
;       ../../include/ztex-isr.h:75: AUTOPTRH1 = hiAddr;
4716
        mov     _AUTOPTRH1,_sendStringDescriptor_PARM_2
4717
;       ../../include/ztex-isr.h:76: AUTOPTRL2 = (BYTE)(((unsigned short)(&EP0BUF))+1);
4718
        mov     _AUTOPTRL2,#0x41
4719
;       ../../include/ztex-isr.h:77: AUTOPTRH2 = (BYTE)((((unsigned short)(&EP0BUF))+1) >> 8);
4720
        mov     _AUTOPTRH2,#0xE7
4721
;       ../../include/ztex-isr.h:78: XAUTODAT2 = 3;
4722
        mov     dptr,#_XAUTODAT2
4723
        mov     a,#0x03
4724
        movx    @dptr,a
4725
;       ../../include/ztex-isr.h:79: for (i=0; i
4726
        mov     r2,#0x00
4727
00106$:
4728
        clr     c
4729
        mov     a,r2
4730
        subb    a,_sendStringDescriptor_PARM_3
4731
        jnc     00109$
4732
;       ../../include/ztex-isr.h:80: XAUTODAT2 = XAUTODAT1;
4733
        mov     dptr,#_XAUTODAT1
4734
        movx    a,@dptr
4735
        mov     r3,a
4736
        mov     dptr,#_XAUTODAT2
4737
        movx    @dptr,a
4738
;       ../../include/ztex-isr.h:81: XAUTODAT2 = 0;
4739
        mov     dptr,#_XAUTODAT2
4740
        clr     a
4741
        movx    @dptr,a
4742
;       ../../include/ztex-isr.h:79: for (i=0; i
4743
        inc     r2
4744
        sjmp    00106$
4745
00109$:
4746
;       ../../include/ztex-isr.h:83: i = (size+1) << 1;
4747
        mov     a,_sendStringDescriptor_PARM_3
4748
        inc     a
4749
;       ../../include/ztex-isr.h:84: EP0BUF[0] = i;
4750
        add     a,acc
4751
        mov     r2,a
4752
        mov     dptr,#_EP0BUF
4753
        movx    @dptr,a
4754
;       ../../include/ztex-isr.h:85: EP0BUF[1] = 3;
4755
        mov     dptr,#(_EP0BUF + 0x0001)
4756
        mov     a,#0x03
4757
        movx    @dptr,a
4758
;       ../../include/ztex-isr.h:86: EP0BCH = 0;
4759
        mov     dptr,#_EP0BCH
4760
        clr     a
4761
        movx    @dptr,a
4762
;       ../../include/ztex-isr.h:87: EP0BCL = i;
4763
        mov     dptr,#_EP0BCL
4764
        mov     a,r2
4765
        movx    @dptr,a
4766
        ret
4767
;------------------------------------------------------------
4768
;Allocation info for local variables in function 'ep0_payload_update'
4769
;------------------------------------------------------------
4770
;------------------------------------------------------------
4771
;       ../../include/ztex-isr.h:93: static void ep0_payload_update() {
4772
;       -----------------------------------------
4773
;        function ep0_payload_update
4774
;       -----------------------------------------
4775
_ep0_payload_update:
4776
;       ../../include/ztex-isr.h:94: ep0_payload_transfer = ( ep0_payload_remaining > 64 ) ? 64 : ep0_payload_remaining;
4777
        mov     dptr,#_ep0_payload_remaining
4778
        movx    a,@dptr
4779
        mov     r2,a
4780
        inc     dptr
4781
        movx    a,@dptr
4782
        mov     r3,a
4783
        clr     c
4784
        mov     a,#0x40
4785
        subb    a,r2
4786
        clr     a
4787
        subb    a,r3
4788
        jnc     00103$
4789
        mov     r4,#0x40
4790
        mov     r5,#0x00
4791
        sjmp    00104$
4792
00103$:
4793
        mov     ar4,r2
4794
        mov     ar5,r3
4795
00104$:
4796
        mov     dptr,#_ep0_payload_transfer
4797
        mov     a,r4
4798
        movx    @dptr,a
4799
;       ../../include/ztex-isr.h:95: ep0_payload_remaining -= ep0_payload_transfer;
4800
        mov     r5,#0x00
4801
        mov     dptr,#_ep0_payload_remaining
4802
        mov     a,r2
4803
        clr     c
4804
        subb    a,r4
4805
        movx    @dptr,a
4806
        mov     a,r3
4807
        subb    a,r5
4808
        inc     dptr
4809
        movx    @dptr,a
4810
        ret
4811
;------------------------------------------------------------
4812
;Allocation info for local variables in function 'ep0_vendor_cmd_su'
4813
;------------------------------------------------------------
4814
;------------------------------------------------------------
4815
;       ../../include/ztex-isr.h:102: static void ep0_vendor_cmd_su() {
4816
;       -----------------------------------------
4817
;        function ep0_vendor_cmd_su
4818
;       -----------------------------------------
4819
_ep0_vendor_cmd_su:
4820
;       ../../include/ztex-isr.h:103: switch ( ep0_prev_setup_request ) {
4821
        mov     dptr,#_ep0_prev_setup_request
4822
        movx    a,@dptr
4823
        mov     r2,a
4824
        cjne    r2,#0x31,00123$
4825
        sjmp    00107$
4826
00123$:
4827
        cjne    r2,#0x32,00124$
4828
        sjmp    00108$
4829
00124$:
4830
        cjne    r2,#0x39,00125$
4831
        sjmp    00101$
4832
00125$:
4833
        cjne    r2,#0x3C,00126$
4834
        sjmp    00102$
4835
00126$:
4836
;       ../../include/ztex-conf.h:123: case $0:
4837
        cjne    r2,#0x42,00111$
4838
        sjmp    00103$
4839
00101$:
4840
;       ../../include/ztex-eeprom.h:236: eeprom_write_checksum = 0;
4841
        mov     dptr,#_eeprom_write_checksum
4842
;       ../../include/ztex-eeprom.h:237: eeprom_write_bytes = 0;
4843
        clr     a
4844
        movx    @dptr,a
4845
        mov     dptr,#_eeprom_write_bytes
4846
        movx    @dptr,a
4847
        inc     dptr
4848
        movx    @dptr,a
4849
;       ../../include/ztex-eeprom.h:238: eeprom_addr =  ( SETUPDAT[3] << 8) | SETUPDAT[2];      // Address
4850
        mov     dptr,#(_SETUPDAT + 0x0003)
4851
        movx    a,@dptr
4852
        mov     r3,a
4853
        mov     r2,#0x00
4854
        mov     dptr,#(_SETUPDAT + 0x0002)
4855
        movx    a,@dptr
4856
        mov     r4,a
4857
        mov     r5,#0x00
4858
        mov     dptr,#_eeprom_addr
4859
        mov     a,r4
4860
        orl     a,r2
4861
        movx    @dptr,a
4862
        mov     a,r5
4863
        orl     a,r3
4864
        inc     dptr
4865
        movx    @dptr,a
4866
;       ../../include/ztex-conf.h:125: break;
4867
;       ../../include/ztex-conf.h:123: case $0:
4868
        ret
4869
00102$:
4870
;       ../../include/ztex-conf.h:125: break;
4871
        mov     dptr,#(_SETUPDAT + 0x0002)
4872
        movx    a,@dptr
4873
        mov     dptr,#_mac_eeprom_addr
4874
        movx    @dptr,a
4875
;       ../../include/ztex-conf.h:123: case $0:
4876
        ret
4877
00103$:
4878
;       ../../include/ztex-flash2.h:698: ep0_write_mode = SETUPDAT[5];
4879
        mov     dptr,#(_SETUPDAT + 0x0005)
4880
        movx    a,@dptr
4881
        mov     r2,a
4882
        mov     dptr,#_ep0_write_mode
4883
        movx    @dptr,a
4884
;       ../../include/ztex-flash2.h:699: if ( (ep0_write_mode == 0) && flash_write_init((SETUPDAT[3] << 8) | SETUPDAT[2]) ) {
4885
        mov     a,r2
4886
        jnz     00113$
4887
        mov     dptr,#(_SETUPDAT + 0x0003)
4888
        movx    a,@dptr
4889
        mov     r3,a
4890
        mov     r2,#0x00
4891
        mov     dptr,#(_SETUPDAT + 0x0002)
4892
        movx    a,@dptr
4893
        mov     r5,#0x00
4894
        orl     a,r2
4895
        mov     dpl,a
4896
        mov     a,r5
4897
        orl     a,r3
4898
        mov     dph,a
4899
        lcall   _flash_write_init
4900
        mov     a,dpl
4901
        jz      00113$
4902
;       ../../include/ztex-conf.h:137: EP0CS |= 0x01;   // set stall
4903
        mov     dptr,#_EP0CS
4904
        movx    a,@dptr
4905
        orl     a,#0x01
4906
        movx    @dptr,a
4907
;       ../../include/ztex-conf.h:138: ep0_payload_remaining = 0;
4908
        mov     dptr,#_ep0_payload_remaining
4909
        clr     a
4910
        movx    @dptr,a
4911
        inc     dptr
4912
        movx    @dptr,a
4913
;       ../../include/ztex-conf.h:139: break;
4914
;       ../../include/ztex-conf.h:123: case $0:
4915
        ret
4916
00107$:
4917
;       ../../include/ztex-conf.h:124: $1
4918
;       ../../include/ztex-conf.h:125: break;
4919
;       ../../include/ztex-conf.h:123: case $0:
4920
        ljmp    _reset_fpga
4921
00108$:
4922
;       ../../include/ztex-fpga7.h:208: if ( fpga_conf_initialized != 123 )
4923
        mov     dptr,#_fpga_conf_initialized
4924
        movx    a,@dptr
4925
        mov     r2,a
4926
        cjne    r2,#0x7B,00130$
4927
        ret
4928
00130$:
4929
;       ../../include/ztex-fpga7.h:209: init_fpga_configuration();
4930
;       ../../include/ztex-conf.h:125: break;
4931
;       ../../include/ztex-isr.h:105: default:
4932
        ljmp    _init_fpga_configuration
4933
00111$:
4934
;       ../../include/ztex-isr.h:106: EP0CS |= 0x01;                    // set stall, unknown request
4935
        mov     dptr,#_EP0CS
4936
        movx    a,@dptr
4937
        mov     r2,a
4938
        orl     a,#0x01
4939
        movx    @dptr,a
4940
;       ../../include/ztex-isr.h:107: }
4941
00113$:
4942
        ret
4943
;------------------------------------------------------------
4944
;Allocation info for local variables in function 'SUDAV_ISR'
4945
;------------------------------------------------------------
4946
;a                         Allocated to registers r2
4947
;------------------------------------------------------------
4948
;       ../../include/ztex-isr.h:113: static void SUDAV_ISR () __interrupt
4949
;       -----------------------------------------
4950
;        function SUDAV_ISR
4951
;       -----------------------------------------
4952
_SUDAV_ISR:
4953
        push    bits
4954
        push    acc
4955
        push    b
4956
        push    dpl
4957
        push    dph
4958
        push    (0+2)
4959
        push    (0+3)
4960
        push    (0+4)
4961
        push    (0+5)
4962
        push    (0+6)
4963
        push    (0+7)
4964
        push    (0+0)
4965
        push    (0+1)
4966
        push    psw
4967
        mov     psw,#0x00
4968
;       ../../include/ztex-isr.h:116: ep0_prev_setup_request = bRequest;
4969
        mov     dptr,#_bRequest
4970
        movx    a,@dptr
4971
        mov     r2,a
4972
        mov     dptr,#_ep0_prev_setup_request
4973
        movx    @dptr,a
4974
;       ../../include/ztex-isr.h:117: SUDPTRCTL = 1;
4975
        mov     dptr,#_SUDPTRCTL
4976
        mov     a,#0x01
4977
        movx    @dptr,a
4978
;       ../../include/ztex-isr.h:120: switch ( bRequest ) {
4979
        mov     dptr,#_bRequest
4980
        movx    a,@dptr
4981
        mov  r2,a
4982
        add     a,#0xff - 0x0C
4983
        jnc     00238$
4984
        ljmp    00160$
4985
00238$:
4986
        mov     a,r2
4987
        add     a,r2
4988
        add     a,r2
4989
        mov     dptr,#00239$
4990
        jmp     @a+dptr
4991
00239$:
4992
        ljmp    00101$
4993
        ljmp    00112$
4994
        ljmp    00160$
4995
        ljmp    00122$
4996
        ljmp    00160$
4997
        ljmp    00160$
4998
        ljmp    00132$
4999
        ljmp    00152$
5000
        ljmp    00153$
5001
        ljmp    00154$
5002
        ljmp    00155$
5003
        ljmp    00156$
5004
        ljmp    00157$
5005
;       ../../include/ztex-isr.h:121: case 0x00:        // get status
5006
00101$:
5007
;       ../../include/ztex-isr.h:122: switch(SETUPDAT[0]) {
5008
        mov     dptr,#_SETUPDAT
5009
        movx    a,@dptr
5010
        mov     r2,a
5011
        cjne    r2,#0x80,00240$
5012
        sjmp    00102$
5013
00240$:
5014
        cjne    r2,#0x81,00241$
5015
        sjmp    00103$
5016
00241$:
5017
        cjne    r2,#0x82,00242$
5018
        sjmp    00104$
5019
00242$:
5020
        ljmp    00160$
5021
;       ../../include/ztex-isr.h:123: case 0x80:                // self powered and remote
5022
00102$:
5023
;       ../../include/ztex-isr.h:124: EP0BUF[0] = 0;    // not self-powered, no remote wakeup
5024
        mov     dptr,#_EP0BUF
5025
;       ../../include/ztex-isr.h:125: EP0BUF[1] = 0;
5026
;       ../../include/ztex-isr.h:126: EP0BCH = 0;
5027
        clr     a
5028
        movx    @dptr,a
5029
        mov     dptr,#(_EP0BUF + 0x0001)
5030
        movx    @dptr,a
5031
        mov     dptr,#_EP0BCH
5032
        movx    @dptr,a
5033
;       ../../include/ztex-isr.h:127: EP0BCL = 2;
5034
        mov     dptr,#_EP0BCL
5035
        mov     a,#0x02
5036
        movx    @dptr,a
5037
;       ../../include/ztex-isr.h:128: break;
5038
        ljmp    00160$
5039
;       ../../include/ztex-isr.h:129: case 0x81:                // interface (reserved)
5040
00103$:
5041
;       ../../include/ztex-isr.h:130: EP0BUF[0] = 0;    // always return zeros
5042
        mov     dptr,#_EP0BUF
5043
;       ../../include/ztex-isr.h:131: EP0BUF[1] = 0;
5044
;       ../../include/ztex-isr.h:132: EP0BCH = 0;
5045
        clr     a
5046
        movx    @dptr,a
5047
        mov     dptr,#(_EP0BUF + 0x0001)
5048
        movx    @dptr,a
5049
        mov     dptr,#_EP0BCH
5050
        movx    @dptr,a
5051
;       ../../include/ztex-isr.h:133: EP0BCL = 2;
5052
        mov     dptr,#_EP0BCL
5053
        mov     a,#0x02
5054
        movx    @dptr,a
5055
;       ../../include/ztex-isr.h:134: break;
5056
        ljmp    00160$
5057
;       ../../include/ztex-isr.h:135: case 0x82:
5058
00104$:
5059
;       ../../include/ztex-isr.h:136: switch ( SETUPDAT[4] ) {
5060
        mov     dptr,#(_SETUPDAT + 0x0004)
5061
        movx    a,@dptr
5062
        mov     r2,a
5063
        jz      00106$
5064
        cjne    r2,#0x01,00244$
5065
        sjmp    00107$
5066
00244$:
5067
        cjne    r2,#0x80,00245$
5068
        sjmp    00106$
5069
00245$:
5070
;       ../../include/ztex-isr.h:138: case 0x80 :
5071
        cjne    r2,#0x81,00109$
5072
        sjmp    00108$
5073
00106$:
5074
;       ../../include/ztex-isr.h:139: EP0BUF[0] = EP0CS & bmBIT0;
5075
        mov     dptr,#_EP0CS
5076
        movx    a,@dptr
5077
        mov     r2,a
5078
        anl     ar2,#0x01
5079
        mov     dptr,#_EP0BUF
5080
        mov     a,r2
5081
        movx    @dptr,a
5082
;       ../../include/ztex-isr.h:140: break;
5083
;       ../../include/ztex-isr.h:141: case 0x01 :
5084
        sjmp    00110$
5085
00107$:
5086
;       ../../include/ztex-isr.h:142: EP0BUF[0] = EP1OUTCS & bmBIT0;
5087
        mov     dptr,#_EP1OUTCS
5088
        movx    a,@dptr
5089
        mov     r2,a
5090
        anl     ar2,#0x01
5091
        mov     dptr,#_EP0BUF
5092
        mov     a,r2
5093
        movx    @dptr,a
5094
;       ../../include/ztex-isr.h:143: break;
5095
;       ../../include/ztex-isr.h:144: case 0x81 :
5096
        sjmp    00110$
5097
00108$:
5098
;       ../../include/ztex-isr.h:145: EP0BUF[0] = EP1INCS & bmBIT0;
5099
        mov     dptr,#_EP1INCS
5100
        movx    a,@dptr
5101
        mov     r2,a
5102
        anl     ar2,#0x01
5103
        mov     dptr,#_EP0BUF
5104
        mov     a,r2
5105
        movx    @dptr,a
5106
;       ../../include/ztex-isr.h:146: break;
5107
;       ../../include/ztex-isr.h:147: default:
5108
        sjmp    00110$
5109
00109$:
5110
;       ../../include/ztex-isr.h:148: EP0BUF[0] = EPXCS[ ((SETUPDAT[4] >> 1)-1) & 3 ] & bmBIT0;
5111
        mov     dptr,#(_SETUPDAT + 0x0004)
5112
        movx    a,@dptr
5113
        clr     c
5114
        rrc     a
5115
        dec     a
5116
        anl     a,#0x03
5117
        add     a,#_EPXCS
5118
        mov     dpl,a
5119
        clr     a
5120
        addc    a,#(_EPXCS >> 8)
5121
        mov     dph,a
5122
        movx    a,@dptr
5123
        mov     r2,a
5124
        anl     ar2,#0x01
5125
        mov     dptr,#_EP0BUF
5126
        mov     a,r2
5127
        movx    @dptr,a
5128
;       ../../include/ztex-isr.h:150: }
5129
00110$:
5130
;       ../../include/ztex-isr.h:151: EP0BUF[1] = 0;
5131
        mov     dptr,#(_EP0BUF + 0x0001)
5132
;       ../../include/ztex-isr.h:152: EP0BCH = 0;
5133
        clr     a
5134
        movx    @dptr,a
5135
        mov     dptr,#_EP0BCH
5136
        movx    @dptr,a
5137
;       ../../include/ztex-isr.h:153: EP0BCL = 2;
5138
        mov     dptr,#_EP0BCL
5139
        mov     a,#0x02
5140
        movx    @dptr,a
5141
;       ../../include/ztex-isr.h:156: break;
5142
        ljmp    00160$
5143
;       ../../include/ztex-isr.h:157: case 0x01:        // disable feature, e.g. remote wake, stall bit
5144
00112$:
5145
;       ../../include/ztex-isr.h:158: if ( SETUPDAT[0] == 2 && SETUPDAT[2] == 0 ) {
5146
        mov     dptr,#_SETUPDAT
5147
        movx    a,@dptr
5148
        mov     r2,a
5149
        cjne    r2,#0x02,00247$
5150
        sjmp    00248$
5151
00247$:
5152
        ljmp    00160$
5153
00248$:
5154
        mov     dptr,#(_SETUPDAT + 0x0002)
5155
        movx    a,@dptr
5156
        jz      00249$
5157
        ljmp    00160$
5158
00249$:
5159
;       ../../include/ztex-isr.h:159: switch ( SETUPDAT[4] ) {
5160
        mov     dptr,#(_SETUPDAT + 0x0004)
5161
        movx    a,@dptr
5162
        mov     r2,a
5163
        jz      00114$
5164
        cjne    r2,#0x01,00251$
5165
        sjmp    00115$
5166
00251$:
5167
        cjne    r2,#0x80,00252$
5168
        sjmp    00114$
5169
00252$:
5170
;       ../../include/ztex-isr.h:161: case 0x80 :
5171
        cjne    r2,#0x81,00117$
5172
        sjmp    00116$
5173
00114$:
5174
;       ../../include/ztex-isr.h:162: EP0CS &= ~bmBIT0;
5175
        mov     dptr,#_EP0CS
5176
        movx    a,@dptr
5177
        mov     r2,a
5178
        anl     a,#0xFE
5179
        movx    @dptr,a
5180
;       ../../include/ztex-isr.h:163: break;
5181
        ljmp    00160$
5182
;       ../../include/ztex-isr.h:164: case 0x01 :
5183
00115$:
5184
;       ../../include/ztex-isr.h:165: EP1OUTCS &= ~bmBIT0;
5185
        mov     dptr,#_EP1OUTCS
5186
        movx    a,@dptr
5187
        mov     r2,a
5188
        anl     a,#0xFE
5189
        movx    @dptr,a
5190
;       ../../include/ztex-isr.h:166: break;
5191
        ljmp    00160$
5192
;       ../../include/ztex-isr.h:167: case 0x81 :
5193
00116$:
5194
;       ../../include/ztex-isr.h:168: EP1INCS &= ~bmBIT0;
5195
        mov     dptr,#_EP1INCS
5196
        movx    a,@dptr
5197
        mov     r2,a
5198
        anl     a,#0xFE
5199
        movx    @dptr,a
5200
;       ../../include/ztex-isr.h:169: break;
5201
        ljmp    00160$
5202
;       ../../include/ztex-isr.h:170: default:
5203
00117$:
5204
;       ../../include/ztex-isr.h:171: EPXCS[ ((SETUPDAT[4] >> 1)-1) & 3 ] &= ~bmBIT0;
5205
        mov     dptr,#(_SETUPDAT + 0x0004)
5206
        movx    a,@dptr
5207
        clr     c
5208
        rrc     a
5209
        dec     a
5210
        anl     a,#0x03
5211
        add     a,#_EPXCS
5212
        mov     r2,a
5213
        clr     a
5214
        addc    a,#(_EPXCS >> 8)
5215
        mov     r3,a
5216
        mov     dptr,#(_SETUPDAT + 0x0004)
5217
        movx    a,@dptr
5218
        clr     c
5219
        rrc     a
5220
        dec     a
5221
        anl     a,#0x03
5222
        add     a,#_EPXCS
5223
        mov     dpl,a
5224
        clr     a
5225
        addc    a,#(_EPXCS >> 8)
5226
        mov     dph,a
5227
        movx    a,@dptr
5228
        mov     r4,a
5229
        anl     ar4,#0xFE
5230
        mov     dpl,r2
5231
        mov     dph,r3
5232
        mov     a,r4
5233
        movx    @dptr,a
5234
;       ../../include/ztex-isr.h:175: break;
5235
        ljmp    00160$
5236
;       ../../include/ztex-isr.h:176: case 0x03:      // enable feature, e.g. remote wake, test mode, stall bit
5237
00122$:
5238
;       ../../include/ztex-isr.h:177: if ( SETUPDAT[0] == 2 && SETUPDAT[2] == 0 ) {
5239
        mov     dptr,#_SETUPDAT
5240
        movx    a,@dptr
5241
        mov     r2,a
5242
        cjne    r2,#0x02,00254$
5243
        sjmp    00255$
5244
00254$:
5245
        ljmp    00160$
5246
00255$:
5247
        mov     dptr,#(_SETUPDAT + 0x0002)
5248
        movx    a,@dptr
5249
        jz      00256$
5250
        ljmp    00160$
5251
00256$:
5252
;       ../../include/ztex-isr.h:178: switch ( SETUPDAT[4] ) {
5253
        mov     dptr,#(_SETUPDAT + 0x0004)
5254
        movx    a,@dptr
5255
        mov     r2,a
5256
        jz      00124$
5257
        cjne    r2,#0x01,00258$
5258
        sjmp    00125$
5259
00258$:
5260
        cjne    r2,#0x80,00259$
5261
        sjmp    00124$
5262
00259$:
5263
;       ../../include/ztex-isr.h:180: case 0x80 :
5264
        cjne    r2,#0x81,00127$
5265
        sjmp    00126$
5266
00124$:
5267
;       ../../include/ztex-isr.h:181: EP0CS |= bmBIT0;
5268
        mov     dptr,#_EP0CS
5269
        movx    a,@dptr
5270
        mov     r2,a
5271
        orl     a,#0x01
5272
        movx    @dptr,a
5273
;       ../../include/ztex-isr.h:182: break;
5274
;       ../../include/ztex-isr.h:183: case 0x01 :
5275
        sjmp    00128$
5276
00125$:
5277
;       ../../include/ztex-isr.h:184: EP1OUTCS |= bmBIT0;
5278
        mov     dptr,#_EP1OUTCS
5279
        movx    a,@dptr
5280
        mov     r2,a
5281
        orl     a,#0x01
5282
        movx    @dptr,a
5283
;       ../../include/ztex-isr.h:185: break;
5284
;       ../../include/ztex-isr.h:186: case 0x81 :
5285
        sjmp    00128$
5286
00126$:
5287
;       ../../include/ztex-isr.h:187: EP1INCS |= bmBIT0;
5288
        mov     dptr,#_EP1INCS
5289
        movx    a,@dptr
5290
        mov     r2,a
5291
        orl     a,#0x01
5292
        movx    @dptr,a
5293
;       ../../include/ztex-isr.h:188: break;
5294
;       ../../include/ztex-isr.h:189: default:
5295
        sjmp    00128$
5296
00127$:
5297
;       ../../include/ztex-isr.h:190: EPXCS[ ((SETUPDAT[4] >> 1)-1) & 3 ] |= ~bmBIT0;
5298
        mov     dptr,#(_SETUPDAT + 0x0004)
5299
        movx    a,@dptr
5300
        clr     c
5301
        rrc     a
5302
        dec     a
5303
        anl     a,#0x03
5304
        add     a,#_EPXCS
5305
        mov     r2,a
5306
        clr     a
5307
        addc    a,#(_EPXCS >> 8)
5308
        mov     r3,a
5309
        mov     dptr,#(_SETUPDAT + 0x0004)
5310
        movx    a,@dptr
5311
        clr     c
5312
        rrc     a
5313
        dec     a
5314
        anl     a,#0x03
5315
        add     a,#_EPXCS
5316
        mov     dpl,a
5317
        clr     a
5318
        addc    a,#(_EPXCS >> 8)
5319
        mov     dph,a
5320
        movx    a,@dptr
5321
        mov     r4,a
5322
        orl     ar4,#0xFE
5323
        mov     dpl,r2
5324
        mov     dph,r3
5325
        mov     a,r4
5326
        movx    @dptr,a
5327
;       ../../include/ztex-isr.h:192: }
5328
00128$:
5329
;       ../../include/ztex-isr.h:193: a = ( (SETUPDAT[4] & 0x80) >> 3 ) | (SETUPDAT[4] & 0x0f);
5330
        mov     dptr,#(_SETUPDAT + 0x0004)
5331
        movx    a,@dptr
5332
        anl     a,#0x80
5333
        swap    a
5334
        rl      a
5335
        anl     a,#0x1f
5336
        mov     r2,a
5337
        mov     dptr,#(_SETUPDAT + 0x0004)
5338
        movx    a,@dptr
5339
        mov     r3,a
5340
        mov     a,#0x0F
5341
        anl     a,r3
5342
        orl     ar2,a
5343
;       ../../include/ztex-isr.h:194: TOGCTL = a;
5344
;       ../../include/ztex-isr.h:195: TOGCTL = a | bmBIT5;
5345
        mov     dptr,#_TOGCTL
5346
        mov     a,r2
5347
        movx    @dptr,a
5348
        mov     a,#0x20
5349
        orl     a,r2
5350
        movx    @dptr,a
5351
;       ../../include/ztex-isr.h:197: break;
5352
        ljmp    00160$
5353
;       ../../include/ztex-isr.h:198: case 0x06:                        // get descriptor
5354
00132$:
5355
;       ../../include/ztex-isr.h:199: switch(SETUPDAT[3]) {
5356
        mov     dptr,#(_SETUPDAT + 0x0003)
5357
        movx    a,@dptr
5358
        mov     r2,a
5359
        cjne    r2,#0x01,00261$
5360
        sjmp    00133$
5361
00261$:
5362
        cjne    r2,#0x02,00262$
5363
        sjmp    00134$
5364
00262$:
5365
        cjne    r2,#0x03,00263$
5366
        sjmp    00138$
5367
00263$:
5368
        cjne    r2,#0x06,00264$
5369
        ljmp    00145$
5370
00264$:
5371
        cjne    r2,#0x07,00265$
5372
        ljmp    00146$
5373
00265$:
5374
        ljmp    00150$
5375
;       ../../include/ztex-isr.h:200: case 0x01:                // device
5376
00133$:
5377
;       ../../include/ztex-isr.h:201: SUDPTRH = MSB(&DeviceDescriptor);
5378
        mov     r2,#_DeviceDescriptor
5379
        mov     r3,#(_DeviceDescriptor >> 8)
5380
        mov     dptr,#_SUDPTRH
5381
        mov     a,r3
5382
        movx    @dptr,a
5383
;       ../../include/ztex-isr.h:202: SUDPTRL = LSB(&DeviceDescriptor);
5384
        mov     dptr,#_SUDPTRL
5385
        mov     a,#_DeviceDescriptor
5386
        movx    @dptr,a
5387
;       ../../include/ztex-isr.h:203: break;
5388
        ljmp    00160$
5389
;       ../../include/ztex-isr.h:204: case 0x02:                // configuration
5390
00134$:
5391
;       ../../include/ztex-isr.h:205: if (USBCS & bmBIT7) {
5392
        mov     dptr,#_USBCS
5393
        movx    a,@dptr
5394
        mov     r2,a
5395
        jnb     acc.7,00136$
5396
;       ../../include/ztex-isr.h:206: SUDPTRH = MSB(&HighSpeedConfigDescriptor);
5397
        mov     r2,#_HighSpeedConfigDescriptor
5398
        mov     r3,#(_HighSpeedConfigDescriptor >> 8)
5399
        mov     dptr,#_SUDPTRH
5400
        mov     a,r3
5401
        movx    @dptr,a
5402
;       ../../include/ztex-isr.h:207: SUDPTRL = LSB(&HighSpeedConfigDescriptor);
5403
        mov     dptr,#_SUDPTRL
5404
        mov     a,#_HighSpeedConfigDescriptor
5405
        movx    @dptr,a
5406
        ljmp    00160$
5407
00136$:
5408
;       ../../include/ztex-isr.h:210: SUDPTRH = MSB(&FullSpeedConfigDescriptor);
5409
        mov     r2,#_FullSpeedConfigDescriptor
5410
        mov     r3,#(_FullSpeedConfigDescriptor >> 8)
5411
        mov     dptr,#_SUDPTRH
5412
        mov     a,r3
5413
        movx    @dptr,a
5414
;       ../../include/ztex-isr.h:211: SUDPTRL = LSB(&FullSpeedConfigDescriptor);
5415
        mov     dptr,#_SUDPTRL
5416
        mov     a,#_FullSpeedConfigDescriptor
5417
        movx    @dptr,a
5418
;       ../../include/ztex-isr.h:213: break;
5419
        ljmp    00160$
5420
;       ../../include/ztex-isr.h:214: case 0x03:                // strings
5421
00138$:
5422
;       ../../include/ztex-isr.h:215: switch (SETUPDAT[2]) {
5423
        mov     dptr,#(_SETUPDAT + 0x0002)
5424
        movx    a,@dptr
5425
        mov     r2,a
5426
        cjne    r2,#0x01,00267$
5427
        sjmp    00139$
5428
00267$:
5429
        cjne    r2,#0x02,00268$
5430
        sjmp    00140$
5431
00268$:
5432
        cjne    r2,#0x03,00269$
5433
        sjmp    00141$
5434
00269$:
5435
;       ../../include/ztex-isr.h:216: case 1:
5436
        cjne    r2,#0x04,00143$
5437
        sjmp    00142$
5438
00139$:
5439
;       ../../include/ztex-isr.h:217: SEND_STRING_DESCRIPTOR(manufacturerString);
5440
        mov     dpl,#_manufacturerString
5441
        mov     r2,#_manufacturerString
5442
        mov     r3,#(_manufacturerString >> 8)
5443
        mov     _sendStringDescriptor_PARM_2,r3
5444
        mov     _sendStringDescriptor_PARM_3,#0x05
5445
        lcall   _sendStringDescriptor
5446
;       ../../include/ztex-isr.h:218: break;
5447
        ljmp    00160$
5448
;       ../../include/ztex-isr.h:219: case 2:
5449
00140$:
5450
;       ../../include/ztex-isr.h:220: SEND_STRING_DESCRIPTOR(productString);
5451
        mov     dpl,#_productString
5452
        mov     r2,#_productString
5453
        mov     r3,#(_productString >> 8)
5454
        mov     _sendStringDescriptor_PARM_2,r3
5455
        mov     _sendStringDescriptor_PARM_3,#0x20
5456
        lcall   _sendStringDescriptor
5457
;       ../../include/ztex-isr.h:221: break;
5458
        ljmp    00160$
5459
;       ../../include/ztex-isr.h:222: case 3:
5460
00141$:
5461
;       ../../include/ztex-isr.h:223: SEND_STRING_DESCRIPTOR(SN_STRING);
5462
        mov     dpl,#_SN_STRING
5463
        mov     r2,#_SN_STRING
5464
        mov     r3,#(_SN_STRING >> 8)
5465
        mov     _sendStringDescriptor_PARM_2,r3
5466
        mov     _sendStringDescriptor_PARM_3,#0x0A
5467
        lcall   _sendStringDescriptor
5468
;       ../../include/ztex-isr.h:224: break;
5469
        ljmp    00160$
5470
;       ../../include/ztex-isr.h:225: case 4:
5471
00142$:
5472
;       ../../include/ztex-isr.h:226: SEND_STRING_DESCRIPTOR(configurationString);
5473
        mov     dpl,#_configurationString
5474
        mov     r2,#_configurationString
5475
        mov     r3,#(_configurationString >> 8)
5476
        mov     _sendStringDescriptor_PARM_2,r3
5477
        mov     _sendStringDescriptor_PARM_3,#0x08
5478
        lcall   _sendStringDescriptor
5479
;       ../../include/ztex-isr.h:227: break;
5480
        ljmp    00160$
5481
;       ../../include/ztex-isr.h:228: default:
5482
00143$:
5483
;       ../../include/ztex-isr.h:229: SUDPTRH = MSB(&EmptyStringDescriptor);
5484
        mov     r2,#_EmptyStringDescriptor
5485
        mov     r3,#(_EmptyStringDescriptor >> 8)
5486
        mov     dptr,#_SUDPTRH
5487
        mov     a,r3
5488
        movx    @dptr,a
5489
;       ../../include/ztex-isr.h:230: SUDPTRL = LSB(&EmptyStringDescriptor);
5490
        mov     dptr,#_SUDPTRL
5491
        mov     a,#_EmptyStringDescriptor
5492
        movx    @dptr,a
5493
;       ../../include/ztex-isr.h:233: break;
5494
        ljmp    00160$
5495
;       ../../include/ztex-isr.h:234: case 0x06:                // device qualifier
5496
00145$:
5497
;       ../../include/ztex-isr.h:235: SUDPTRH = MSB(&DeviceQualifierDescriptor);
5498
        mov     r2,#_DeviceQualifierDescriptor
5499
        mov     r3,#(_DeviceQualifierDescriptor >> 8)
5500
        mov     dptr,#_SUDPTRH
5501
        mov     a,r3
5502
        movx    @dptr,a
5503
;       ../../include/ztex-isr.h:236: SUDPTRL = LSB(&DeviceQualifierDescriptor);
5504
        mov     dptr,#_SUDPTRL
5505
        mov     a,#_DeviceQualifierDescriptor
5506
        movx    @dptr,a
5507
;       ../../include/ztex-isr.h:237: break;
5508
        ljmp    00160$
5509
;       ../../include/ztex-isr.h:238: case 0x07:                // other speed configuration
5510
00146$:
5511
;       ../../include/ztex-isr.h:239: if (USBCS & bmBIT7) {
5512
        mov     dptr,#_USBCS
5513
        movx    a,@dptr
5514
        mov     r2,a
5515
        jnb     acc.7,00148$
5516
;       ../../include/ztex-isr.h:240: SUDPTRH = MSB(&FullSpeedConfigDescriptor);
5517
        mov     r2,#_FullSpeedConfigDescriptor
5518
        mov     r3,#(_FullSpeedConfigDescriptor >> 8)
5519
        mov     dptr,#_SUDPTRH
5520
        mov     a,r3
5521
        movx    @dptr,a
5522
;       ../../include/ztex-isr.h:241: SUDPTRL = LSB(&FullSpeedConfigDescriptor);
5523
        mov     dptr,#_SUDPTRL
5524
        mov     a,#_FullSpeedConfigDescriptor
5525
        movx    @dptr,a
5526
        ljmp    00160$
5527
00148$:
5528
;       ../../include/ztex-isr.h:244: SUDPTRH = MSB(&HighSpeedConfigDescriptor);
5529
        mov     r2,#_HighSpeedConfigDescriptor
5530
        mov     r3,#(_HighSpeedConfigDescriptor >> 8)
5531
        mov     dptr,#_SUDPTRH
5532
        mov     a,r3
5533
        movx    @dptr,a
5534
;       ../../include/ztex-isr.h:245: SUDPTRL = LSB(&HighSpeedConfigDescriptor);
5535
        mov     dptr,#_SUDPTRL
5536
        mov     a,#_HighSpeedConfigDescriptor
5537
        movx    @dptr,a
5538
;       ../../include/ztex-isr.h:247: break;
5539
;       ../../include/ztex-isr.h:248: default:
5540
        sjmp    00160$
5541
00150$:
5542
;       ../../include/ztex-isr.h:249: EP0CS |= 0x01;    // set stall, unknown descriptor
5543
        mov     dptr,#_EP0CS
5544
        movx    a,@dptr
5545
        mov     r2,a
5546
        orl     a,#0x01
5547
        movx    @dptr,a
5548
;       ../../include/ztex-isr.h:251: break;
5549
;       ../../include/ztex-isr.h:252: case 0x07:                        // set descriptor
5550
        sjmp    00160$
5551
00152$:
5552
;       ../../include/ztex-isr.h:253: break;
5553
;       ../../include/ztex-isr.h:254: case 0x08:                        // get configuration
5554
        sjmp    00160$
5555
00153$:
5556
;       ../../include/ztex-isr.h:255: EP0BUF[0] = 0;            // only one configuration
5557
        mov     dptr,#_EP0BUF
5558
;       ../../include/ztex-isr.h:256: EP0BCH = 0;
5559
        clr     a
5560
        movx    @dptr,a
5561
        mov     dptr,#_EP0BCH
5562
        movx    @dptr,a
5563
;       ../../include/ztex-isr.h:257: EP0BCL = 1;
5564
        mov     dptr,#_EP0BCL
5565
        mov     a,#0x01
5566
        movx    @dptr,a
5567
;       ../../include/ztex-isr.h:258: break;
5568
;       ../../include/ztex-isr.h:259: case 0x09:                        // set configuration
5569
        sjmp    00160$
5570
00154$:
5571
;       ../../include/ztex-isr.h:260: resetToggleData();
5572
        lcall   _resetToggleData
5573
;       ../../include/ztex-isr.h:261: break;                    // do nothing since we have only one configuration
5574
;       ../../include/ztex-isr.h:262: case 0x0a:                        // get alternate setting for an interface
5575
        sjmp    00160$
5576
00155$:
5577
;       ../../include/ztex-isr.h:263: EP0BUF[0] = 0;            // only one alternate setting
5578
        mov     dptr,#_EP0BUF
5579
;       ../../include/ztex-isr.h:264: EP0BCH = 0;
5580
        clr     a
5581
        movx    @dptr,a
5582
        mov     dptr,#_EP0BCH
5583
        movx    @dptr,a
5584
;       ../../include/ztex-isr.h:265: EP0BCL = 1;
5585
        mov     dptr,#_EP0BCL
5586
        mov     a,#0x01
5587
        movx    @dptr,a
5588
;       ../../include/ztex-isr.h:266: break;
5589
;       ../../include/ztex-isr.h:267: case 0x0b:                        // set alternate setting for an interface
5590
        sjmp    00160$
5591
00156$:
5592
;       ../../include/ztex-isr.h:268: resetToggleData();
5593
        lcall   _resetToggleData
5594
;       ../../include/ztex-isr.h:269: break;                    // do nothing since we have only on alternate setting
5595
;       ../../include/ztex-isr.h:270: case 0x0c:                        // sync frame
5596
        sjmp    00160$
5597
00157$:
5598
;       ../../include/ztex-isr.h:271: if ( SETUPDAT[0] == 0x82 ) {
5599
        mov     dptr,#_SETUPDAT
5600
        movx    a,@dptr
5601
        mov     r2,a
5602
        cjne    r2,#0x82,00160$
5603
;       ../../include/ztex-isr.h:272: ISOFRAME_COUNTER[ ((SETUPDAT[4] >> 1)-1) & 3 ] = 0;
5604
        mov     dptr,#(_SETUPDAT + 0x0004)
5605
        movx    a,@dptr
5606
        clr     c
5607
        rrc     a
5608
        dec     a
5609
        anl     a,#0x03
5610
        add     a,acc
5611
        add     a,#_ISOFRAME_COUNTER
5612
        mov     dpl,a
5613
        clr     a
5614
        addc    a,#(_ISOFRAME_COUNTER >> 8)
5615
        mov     dph,a
5616
        clr     a
5617
        movx    @dptr,a
5618
        inc     dptr
5619
        movx    @dptr,a
5620
;       ../../include/ztex-isr.h:273: EP0BUF[0] = USBFRAMEL;    // use current frame as sync frame, i hope that works
5621
        mov     dptr,#_USBFRAMEL
5622
        movx    a,@dptr
5623
        mov     dptr,#_EP0BUF
5624
        movx    @dptr,a
5625
;       ../../include/ztex-isr.h:274: EP0BUF[1] = USBFRAMEH;
5626
        mov     dptr,#_USBFRAMEH
5627
        movx    a,@dptr
5628
        mov     r2,a
5629
        mov     dptr,#(_EP0BUF + 0x0001)
5630
        movx    @dptr,a
5631
;       ../../include/ztex-isr.h:275: EP0BCH = 0;
5632
        mov     dptr,#_EP0BCH
5633
        clr     a
5634
        movx    @dptr,a
5635
;       ../../include/ztex-isr.h:276: EP0BCL = 2;
5636
        mov     dptr,#_EP0BCL
5637
        mov     a,#0x02
5638
        movx    @dptr,a
5639
;       ../../include/ztex-isr.h:280: }
5640
00160$:
5641
;       ../../include/ztex-isr.h:283: switch ( bmRequestType ) {
5642
        mov     dptr,#_bmRequestType
5643
        movx    a,@dptr
5644
        mov     r2,a
5645
        cjne    r2,#0x40,00274$
5646
        ljmp    00182$
5647
00274$:
5648
        cjne    r2,#0xC0,00275$
5649
        sjmp    00276$
5650
00275$:
5651
        ljmp    00186$
5652
00276$:
5653
;       ../../include/ztex-isr.h:285: ep0_payload_remaining = (SETUPDAT[7] << 8) | SETUPDAT[6];
5654
        mov     dptr,#(_SETUPDAT + 0x0007)
5655
        movx    a,@dptr
5656
        mov     r3,a
5657
        mov     r2,#0x00
5658
        mov     dptr,#(_SETUPDAT + 0x0006)
5659
        movx    a,@dptr
5660
        mov     r4,a
5661
        mov     r5,#0x00
5662
        mov     dptr,#_ep0_payload_remaining
5663
        mov     a,r4
5664
        orl     a,r2
5665
        movx    @dptr,a
5666
        mov     a,r5
5667
        orl     a,r3
5668
        inc     dptr
5669
        movx    @dptr,a
5670
;       ../../include/ztex-isr.h:286: ep0_payload_update();
5671
        lcall   _ep0_payload_update
5672
;       ../../include/ztex-isr.h:288: switch ( bRequest ) {
5673
        mov     dptr,#_bRequest
5674
        movx    a,@dptr
5675
        mov     r2,a
5676
        cjne    r2,#0x22,00277$
5677
        sjmp    00162$
5678
00277$:
5679
        cjne    r2,#0x30,00278$
5680
        ljmp    00176$
5681
00278$:
5682
        cjne    r2,#0x38,00279$
5683
        sjmp    00163$
5684
00279$:
5685
        cjne    r2,#0x3A,00280$
5686
        sjmp    00164$
5687
00280$:
5688
        cjne    r2,#0x3B,00281$
5689
        ljmp    00165$
5690
00281$:
5691
        cjne    r2,#0x3D,00282$
5692
        ljmp    00166$
5693
00282$:
5694
        cjne    r2,#0x40,00283$
5695
        ljmp    00167$
5696
00283$:
5697
        cjne    r2,#0x41,00284$
5698
        ljmp    00171$
5699
00284$:
5700
        cjne    r2,#0x43,00285$
5701
        ljmp    00175$
5702
00285$:
5703
        ljmp    00180$
5704
;       ../../include/ztex-isr.h:289: case 0x22:                                // get ZTEX descriptor
5705
00162$:
5706
;       ../../include/ztex-isr.h:290: SUDPTRCTL = 0;
5707
        mov     dptr,#_SUDPTRCTL
5708
;       ../../include/ztex-isr.h:291: EP0BCH = 0;
5709
        clr     a
5710
        movx    @dptr,a
5711
        mov     dptr,#_EP0BCH
5712
        movx    @dptr,a
5713
;       ../../include/ztex-isr.h:292: EP0BCL = ZTEX_DESCRIPTOR_LEN;
5714
        mov     dptr,#_EP0BCL
5715
        mov     a,#0x28
5716
        movx    @dptr,a
5717
;       ../../include/ztex-isr.h:293: SUDPTRH = MSB(ZTEX_DESCRIPTOR_OFFS);
5718
        mov     dptr,#_SUDPTRH
5719
        clr     a
5720
        movx    @dptr,a
5721
;       ../../include/ztex-isr.h:294: SUDPTRL = LSB(ZTEX_DESCRIPTOR_OFFS);
5722
        mov     dptr,#_SUDPTRL
5723
        mov     a,#0x6C
5724
        movx    @dptr,a
5725
;       ../../include/ztex-isr.h:295: break;
5726
        ljmp    00186$
5727
;       ../../include/ztex-conf.h:100: case $0:
5728
00163$:
5729
;       ../../include/ztex-conf.h:102: break;
5730
        mov     dptr,#(_SETUPDAT + 0x0003)
5731
        movx    a,@dptr
5732
        mov     r3,a
5733
        mov     r2,#0x00
5734
        mov     dptr,#(_SETUPDAT + 0x0002)
5735
        movx    a,@dptr
5736
        mov     r4,a
5737
        mov     r5,#0x00
5738
        mov     dptr,#_eeprom_addr
5739
        mov     a,r4
5740
        orl     a,r2
5741
        movx    @dptr,a
5742
        mov     a,r5
5743
        orl     a,r3
5744
        inc     dptr
5745
        movx    @dptr,a
5746
;       ../../include/ztex-eeprom.h:219: EP0BCH = 0;
5747
        mov     dptr,#_EP0BCH
5748
        clr     a
5749
        movx    @dptr,a
5750
;       ../../include/ztex-eeprom.h:220: EP0BCL = eeprom_read_ep0();
5751
        lcall   _eeprom_read_ep0
5752
        mov     a,dpl
5753
        mov     dptr,#_EP0BCL
5754
        movx    @dptr,a
5755
;       ../../include/ztex-conf.h:102: break;
5756
        ljmp    00186$
5757
;       ../../include/ztex-conf.h:100: case $0:
5758
00164$:
5759
;       ../../include/ztex-eeprom.h:247: EP0BUF[0] = LSB(eeprom_write_bytes);
5760
        mov     dptr,#_eeprom_write_bytes
5761
        movx    a,@dptr
5762
        mov     r2,a
5763
        inc     dptr
5764
        movx    a,@dptr
5765
        mov     r3,a
5766
        mov     ar4,r2
5767
        mov     dptr,#_EP0BUF
5768
        mov     a,r4
5769
        movx    @dptr,a
5770
;       ../../include/ztex-eeprom.h:248: EP0BUF[1] = MSB(eeprom_write_bytes);
5771
        mov     ar2,r3
5772
        mov     dptr,#(_EP0BUF + 0x0001)
5773
        mov     a,r2
5774
        movx    @dptr,a
5775
;       ../../include/ztex-eeprom.h:249: EP0BUF[2] = eeprom_write_checksum;
5776
        mov     dptr,#_eeprom_write_checksum
5777
        movx    a,@dptr
5778
        mov     dptr,#(_EP0BUF + 0x0002)
5779
        movx    @dptr,a
5780
;       ../../include/ztex-eeprom.h:250: EP0BUF[3] = eeprom_select(EEPROM_ADDR,0,1);            // 1 means busy or error
5781
        mov     _eeprom_select_PARM_2,#0x00
5782
        mov     _eeprom_select_PARM_3,#0x01
5783
        mov     dpl,#0xA2
5784
        lcall   _eeprom_select
5785
        mov     r2,dpl
5786
        mov     dptr,#(_EP0BUF + 0x0003)
5787
        mov     a,r2
5788
        movx    @dptr,a
5789
;       ../../include/ztex-eeprom.h:251: EP0BCH = 0;
5790
        mov     dptr,#_EP0BCH
5791
        clr     a
5792
        movx    @dptr,a
5793
;       ../../include/ztex-eeprom.h:252: EP0BCL = 4;
5794
        mov     dptr,#_EP0BCL
5795
        mov     a,#0x04
5796
        movx    @dptr,a
5797
;       ../../include/ztex-conf.h:102: break;
5798
        ljmp    00186$
5799
;       ../../include/ztex-conf.h:100: case $0:
5800
00165$:
5801
;       ../../include/ztex-conf.h:102: break;
5802
        mov     dptr,#(_SETUPDAT + 0x0002)
5803
        movx    a,@dptr
5804
        mov     dptr,#_mac_eeprom_addr
5805
        movx    @dptr,a
5806
;       ../../include/ztex-eeprom.h:368: EP0BCH = 0;
5807
        mov     dptr,#_EP0BCH
5808
        clr     a
5809
        movx    @dptr,a
5810
;       ../../include/ztex-eeprom.h:369: EP0BCL = mac_eeprom_read_ep0();
5811
        lcall   _mac_eeprom_read_ep0
5812
        mov     a,dpl
5813
        mov     dptr,#_EP0BCL
5814
        movx    @dptr,a
5815
;       ../../include/ztex-conf.h:102: break;
5816
        ljmp    00186$
5817
;       ../../include/ztex-conf.h:100: case $0:
5818
00166$:
5819
;       ../../include/ztex-conf.h:102: break;
5820
        mov     _eeprom_select_PARM_2,#0x00
5821
        mov     _eeprom_select_PARM_3,#0x01
5822
        mov     dpl,#0xA6
5823
        lcall   _eeprom_select
5824
        mov     r2,dpl
5825
        mov     dptr,#_EP0BUF
5826
        mov     a,r2
5827
        movx    @dptr,a
5828
;       ../../include/ztex-eeprom.h:390: EP0BCH = 0;
5829
        mov     dptr,#_EP0BCH
5830
        clr     a
5831
        movx    @dptr,a
5832
;       ../../include/ztex-eeprom.h:391: EP0BCL = 1;
5833
        mov     dptr,#_EP0BCL
5834
        mov     a,#0x01
5835
        movx    @dptr,a
5836
;       ../../include/ztex-conf.h:102: break;
5837
        ljmp    00186$
5838
;       ../../include/ztex-conf.h:100: case $0:
5839
00167$:
5840
;       ../../include/ztex-flash2.h:646: if ( flash_ec == 0 && SPI_CS == 0 ) {
5841
        mov     dptr,#_flash_ec
5842
        movx    a,@dptr
5843
        mov     r2,a
5844
        jnz     00169$
5845
        jb      _IOA3,00169$
5846
;       ../../include/ztex-flash2.h:647: flash_ec = FLASH_EC_PENDING;
5847
        mov     dptr,#_flash_ec
5848
        mov     a,#0x04
5849
        movx    @dptr,a
5850
00169$:
5851
;       ../../include/ztex-utils.h:121: AUTOPTRL1=LO(&($0));
5852
        mov     _AUTOPTRL1,#_flash_enabled
5853
;       ../../include/ztex-utils.h:122: AUTOPTRH1=HI(&($0));
5854
        mov     r2,#_flash_enabled
5855
        mov     r3,#(_flash_enabled >> 8)
5856
        mov     _AUTOPTRH1,r3
5857
;       ../../include/ztex-utils.h:123: AUTOPTRL2=LO(&($1));
5858
        mov     _AUTOPTRL2,#0x40
5859
;       ../../include/ztex-utils.h:124: AUTOPTRH2=HI(&($1));
5860
        mov     _AUTOPTRH2,#0xE7
5861
;       ../../include/ztex-utils.h:130: __endasm;
5862
 
5863
          push ar2
5864
            mov r2,#(8);
5865
          lcall _MEM_COPY1_int
5866
          pop ar2
5867
 
5868
;       ../../include/ztex-flash2.h:650: EP0BCH = 0;
5869
        mov     dptr,#_EP0BCH
5870
        clr     a
5871
        movx    @dptr,a
5872
;       ../../include/ztex-flash2.h:651: EP0BCL = 8;
5873
        mov     dptr,#_EP0BCL
5874
        mov     a,#0x08
5875
        movx    @dptr,a
5876
;       ../../include/ztex-conf.h:102: break;
5877
        ljmp    00186$
5878
;       ../../include/ztex-conf.h:100: case $0:
5879
00171$:
5880
;       ../../include/ztex-flash2.h:671: ep0_read_mode = SETUPDAT[5];
5881
        mov     dptr,#(_SETUPDAT + 0x0005)
5882
        movx    a,@dptr
5883
        mov     r2,a
5884
        mov     dptr,#_ep0_read_mode
5885
        movx    @dptr,a
5886
;       ../../include/ztex-flash2.h:672: if ( (ep0_read_mode==0) && flash_read_init((SETUPDAT[3] << 8) | SETUPDAT[2]) ) {
5887
        mov     a,r2
5888
        jnz     00173$
5889
        mov     dptr,#(_SETUPDAT + 0x0003)
5890
        movx    a,@dptr
5891
        mov     r3,a
5892
        mov     r2,#0x00
5893
        mov     dptr,#(_SETUPDAT + 0x0002)
5894
        movx    a,@dptr
5895
        mov     r5,#0x00
5896
        orl     a,r2
5897
        mov     dpl,a
5898
        mov     a,r5
5899
        orl     a,r3
5900
        mov     dph,a
5901
        lcall   _flash_read_init
5902
        mov     a,dpl
5903
        jz      00173$
5904
;       ../../include/ztex-conf.h:137: EP0CS |= 0x01;   // set stall
5905
        mov     dptr,#_EP0CS
5906
        movx    a,@dptr
5907
        mov     r2,a
5908
        orl     a,#0x01
5909
        movx    @dptr,a
5910
;       ../../include/ztex-conf.h:138: ep0_payload_remaining = 0;
5911
        mov     dptr,#_ep0_payload_remaining
5912
        clr     a
5913
        movx    @dptr,a
5914
        inc     dptr
5915
        movx    @dptr,a
5916
;       ../../include/ztex-conf.h:139: break;
5917
        ljmp    00186$
5918
00173$:
5919
;       ../../include/ztex-flash2.h:675: spi_read_ep0();
5920
        lcall   _spi_read_ep0
5921
;       ../../include/ztex-flash2.h:676: EP0BCH = 0;
5922
        mov     dptr,#_EP0BCH
5923
        clr     a
5924
        movx    @dptr,a
5925
;       ../../include/ztex-flash2.h:677: EP0BCL = ep0_payload_transfer;
5926
        mov     dptr,#_ep0_payload_transfer
5927
        movx    a,@dptr
5928
        mov     r2,a
5929
        mov     dptr,#_EP0BCL
5930
        movx    @dptr,a
5931
;       ../../include/ztex-conf.h:102: break;
5932
        ljmp    00186$
5933
;       ../../include/ztex-conf.h:100: case $0:
5934
00175$:
5935
;       ../../include/ztex-utils.h:121: AUTOPTRL1=LO(&($0));
5936
        mov     _AUTOPTRL1,#_flash_ec
5937
;       ../../include/ztex-utils.h:122: AUTOPTRH1=HI(&($0));
5938
        mov     r2,#_flash_ec
5939
        mov     r3,#(_flash_ec >> 8)
5940
        mov     _AUTOPTRH1,r3
5941
;       ../../include/ztex-utils.h:123: AUTOPTRL2=LO(&($1));
5942
        mov     _AUTOPTRL2,#0x40
5943
;       ../../include/ztex-utils.h:124: AUTOPTRH2=HI(&($1));
5944
        mov     _AUTOPTRH2,#0xE7
5945
;       ../../include/ztex-utils.h:130: __endasm;
5946
 
5947
          push ar2
5948
            mov r2,#(10);
5949
          lcall _MEM_COPY1_int
5950
          pop ar2
5951
 
5952
;       ../../include/ztex-flash2.h:719: EP0BCH = 0;
5953
        mov     dptr,#_EP0BCH
5954
        clr     a
5955
        movx    @dptr,a
5956
;       ../../include/ztex-flash2.h:720: EP0BCL = 10;
5957
        mov     dptr,#_EP0BCL
5958
        mov     a,#0x0A
5959
        movx    @dptr,a
5960
;       ../../include/ztex-conf.h:102: break;
5961
        ljmp    00186$
5962
;       ../../include/ztex-conf.h:100: case $0:
5963
00176$:
5964
;       ../../include/ztex-utils.h:121: AUTOPTRL1=LO(&($0));
5965
        mov     _AUTOPTRL1,#_fpga_checksum
5966
;       ../../include/ztex-utils.h:122: AUTOPTRH1=HI(&($0));
5967
        mov     r2,#_fpga_checksum
5968
        mov     r3,#(_fpga_checksum >> 8)
5969
        mov     _AUTOPTRH1,r3
5970
;       ../../include/ztex-utils.h:123: AUTOPTRL2=LO(&($1));
5971
        mov     _AUTOPTRL2,#(_EP0BUF + 0x0001)
5972
;       ../../include/ztex-utils.h:124: AUTOPTRH2=HI(&($1));
5973
        mov     r2,#(_EP0BUF + 0x0001)
5974
        mov     r3,#((_EP0BUF + 0x0001) >> 8)
5975
        mov     _AUTOPTRH2,r3
5976
;       ../../include/ztex-utils.h:130: __endasm;
5977
 
5978
          push ar2
5979
            mov r2,#(7);
5980
          lcall _MEM_COPY1_int
5981
          pop ar2
5982
 
5983
;       ../../include/ztex-fpga7.h:144: OEE = (OEE & ~bmBIT6) | bmBIT7;
5984
        mov     r2,_OEE
5985
        mov     a,#0xBF
5986
        anl     a,r2
5987
        mov     b,a
5988
        mov     a,#0x80
5989
        orl     a,b
5990
        mov     _OEE,a
5991
;       ../../include/ztex-fpga7.h:145: if ( IOE & bmBIT6 )  {
5992
        mov     a,_IOE
5993
        jnb     acc.6,00178$
5994
;       ../../include/ztex-fpga7.h:146: EP0BUF[0] = 0;                  // FPGA configured
5995
        mov     dptr,#_EP0BUF
5996
        clr     a
5997
        movx    @dptr,a
5998
        sjmp    00179$
5999
00178$:
6000
;       ../../include/ztex-fpga7.h:149: EP0BUF[0] = 1;                  // FPGA unconfigured
6001
        mov     dptr,#_EP0BUF
6002
        mov     a,#0x01
6003
        movx    @dptr,a
6004
;       ../../include/ztex-fpga7.h:150: reset_fpga();                   // prepare FPGA for configuration
6005
        lcall   _reset_fpga
6006
00179$:
6007
;       ../../include/ztex-fpga7.h:153: EP0BUF[8] = 1;                  // bit order for bitstream in Flash memory: swapped
6008
        mov     dptr,#(_EP0BUF + 0x0008)
6009
        mov     a,#0x01
6010
        movx    @dptr,a
6011
;       ../../include/ztex-fpga7.h:155: EP0BCH = 0;
6012
        mov     dptr,#_EP0BCH
6013
        clr     a
6014
        movx    @dptr,a
6015
;       ../../include/ztex-fpga7.h:156: EP0BCL = 9;
6016
        mov     dptr,#_EP0BCL
6017
        mov     a,#0x09
6018
        movx    @dptr,a
6019
;       ../../include/ztex-conf.h:102: break;
6020
;       ../../include/ztex-isr.h:297: default:
6021
        sjmp    00186$
6022
00180$:
6023
;       ../../include/ztex-isr.h:298: EP0CS |= 0x01;                    // set stall, unknown request
6024
        mov     dptr,#_EP0CS
6025
        movx    a,@dptr
6026
        mov     r2,a
6027
        orl     a,#0x01
6028
        movx    @dptr,a
6029
;       ../../include/ztex-isr.h:300: break;
6030
;       ../../include/ztex-isr.h:301: case 0x40:                                        // vendor command
6031
        sjmp    00186$
6032
00182$:
6033
;       ../../include/ztex-isr.h:305: if ( SETUPDAT[7]!=0 || SETUPDAT[6]!=0 ) {
6034
        mov     dptr,#(_SETUPDAT + 0x0007)
6035
        movx    a,@dptr
6036
        jnz     00183$
6037
        mov     dptr,#(_SETUPDAT + 0x0006)
6038
        movx    a,@dptr
6039
        jz      00184$
6040
00183$:
6041
;       ../../include/ztex-isr.h:306: ep0_vendor_cmd_setup = 1;
6042
        mov     dptr,#_ep0_vendor_cmd_setup
6043
        mov     a,#0x01
6044
        movx    @dptr,a
6045
;       ../../include/ztex-isr.h:307: EP0BCL = 0;
6046
        mov     dptr,#_EP0BCL
6047
        clr     a
6048
        movx    @dptr,a
6049
;       ../../include/ztex-isr.h:308: EXIF &= ~bmBIT4;                    // clear main USB interrupt flag
6050
        anl     _EXIF,#0xEF
6051
;       ../../include/ztex-isr.h:309: USBIRQ = bmBIT0;                  // clear SUADV IRQ
6052
        mov     dptr,#_USBIRQ
6053
        mov     a,#0x01
6054
        movx    @dptr,a
6055
;       ../../include/ztex-isr.h:310: return;                                   // don't clear HSNAK bit. This is done after the command has completed
6056
        sjmp    00187$
6057
00184$:
6058
;       ../../include/ztex-isr.h:312: ep0_vendor_cmd_su();                      // setup sequences of vendor command with no payload ara executed immediately
6059
        lcall   _ep0_vendor_cmd_su
6060
;       ../../include/ztex-isr.h:313: EP0BCL = 0;
6061
        mov     dptr,#_EP0BCL
6062
        clr     a
6063
        movx    @dptr,a
6064
;       ../../include/ztex-isr.h:315: }
6065
00186$:
6066
;       ../../include/ztex-isr.h:317: EXIF &= ~bmBIT4;                                    // clear main USB interrupt flag
6067
        anl     _EXIF,#0xEF
6068
;       ../../include/ztex-isr.h:318: USBIRQ = bmBIT0;                                  // clear SUADV IRQ
6069
        mov     dptr,#_USBIRQ
6070
        mov     a,#0x01
6071
        movx    @dptr,a
6072
;       ../../include/ztex-isr.h:319: EP0CS |= 0x80;                                    // clear the HSNAK bit
6073
        mov     dptr,#_EP0CS
6074
        movx    a,@dptr
6075
        mov     r2,a
6076
        orl     a,#0x80
6077
        movx    @dptr,a
6078
00187$:
6079
        pop     psw
6080
        pop     (0+1)
6081
        pop     (0+0)
6082
        pop     (0+7)
6083
        pop     (0+6)
6084
        pop     (0+5)
6085
        pop     (0+4)
6086
        pop     (0+3)
6087
        pop     (0+2)
6088
        pop     dph
6089
        pop     dpl
6090
        pop     b
6091
        pop     acc
6092
        pop     bits
6093
        reti
6094
;------------------------------------------------------------
6095
;Allocation info for local variables in function 'SOF_ISR'
6096
;------------------------------------------------------------
6097
;------------------------------------------------------------
6098
;       ../../include/ztex-isr.h:325: void SOF_ISR() __interrupt
6099
;       -----------------------------------------
6100
;        function SOF_ISR
6101
;       -----------------------------------------
6102
_SOF_ISR:
6103
        push    acc
6104
        push    dpl
6105
        push    dph
6106
;       ../../include/ztex-isr.h:327: EXIF &= ~bmBIT4;
6107
        anl     _EXIF,#0xEF
6108
;       ../../include/ztex-isr.h:328: USBIRQ = bmBIT1;
6109
        mov     dptr,#_USBIRQ
6110
        mov     a,#0x02
6111
        movx    @dptr,a
6112
        pop     dph
6113
        pop     dpl
6114
        pop     acc
6115
        reti
6116
;       eliminated unneeded push/pop psw
6117
;       eliminated unneeded push/pop b
6118
;------------------------------------------------------------
6119
;Allocation info for local variables in function 'SUTOK_ISR'
6120
;------------------------------------------------------------
6121
;------------------------------------------------------------
6122
;       ../../include/ztex-isr.h:334: void SUTOK_ISR() __interrupt
6123
;       -----------------------------------------
6124
;        function SUTOK_ISR
6125
;       -----------------------------------------
6126
_SUTOK_ISR:
6127
        push    acc
6128
        push    dpl
6129
        push    dph
6130
;       ../../include/ztex-isr.h:336: EXIF &= ~bmBIT4;
6131
        anl     _EXIF,#0xEF
6132
;       ../../include/ztex-isr.h:337: USBIRQ = bmBIT2;
6133
        mov     dptr,#_USBIRQ
6134
        mov     a,#0x04
6135
        movx    @dptr,a
6136
        pop     dph
6137
        pop     dpl
6138
        pop     acc
6139
        reti
6140
;       eliminated unneeded push/pop psw
6141
;       eliminated unneeded push/pop b
6142
;------------------------------------------------------------
6143
;Allocation info for local variables in function 'SUSP_ISR'
6144
;------------------------------------------------------------
6145
;------------------------------------------------------------
6146
;       ../../include/ztex-isr.h:343: void SUSP_ISR() __interrupt
6147
;       -----------------------------------------
6148
;        function SUSP_ISR
6149
;       -----------------------------------------
6150
_SUSP_ISR:
6151
        push    acc
6152
        push    dpl
6153
        push    dph
6154
;       ../../include/ztex-isr.h:345: EXIF &= ~bmBIT4;
6155
        anl     _EXIF,#0xEF
6156
;       ../../include/ztex-isr.h:346: USBIRQ = bmBIT3;
6157
        mov     dptr,#_USBIRQ
6158
        mov     a,#0x08
6159
        movx    @dptr,a
6160
        pop     dph
6161
        pop     dpl
6162
        pop     acc
6163
        reti
6164
;       eliminated unneeded push/pop psw
6165
;       eliminated unneeded push/pop b
6166
;------------------------------------------------------------
6167
;Allocation info for local variables in function 'URES_ISR'
6168
;------------------------------------------------------------
6169
;------------------------------------------------------------
6170
;       ../../include/ztex-isr.h:352: void URES_ISR() __interrupt
6171
;       -----------------------------------------
6172
;        function URES_ISR
6173
;       -----------------------------------------
6174
_URES_ISR:
6175
        push    acc
6176
        push    dpl
6177
        push    dph
6178
;       ../../include/ztex-isr.h:354: EXIF &= ~bmBIT4;
6179
        anl     _EXIF,#0xEF
6180
;       ../../include/ztex-isr.h:355: USBIRQ = bmBIT4;
6181
        mov     dptr,#_USBIRQ
6182
        mov     a,#0x10
6183
        movx    @dptr,a
6184
        pop     dph
6185
        pop     dpl
6186
        pop     acc
6187
        reti
6188
;       eliminated unneeded push/pop psw
6189
;       eliminated unneeded push/pop b
6190
;------------------------------------------------------------
6191
;Allocation info for local variables in function 'HSGRANT_ISR'
6192
;------------------------------------------------------------
6193
;------------------------------------------------------------
6194
;       ../../include/ztex-isr.h:361: void HSGRANT_ISR() __interrupt
6195
;       -----------------------------------------
6196
;        function HSGRANT_ISR
6197
;       -----------------------------------------
6198
_HSGRANT_ISR:
6199
        push    acc
6200
        push    dpl
6201
        push    dph
6202
;       ../../include/ztex-isr.h:363: EXIF &= ~bmBIT4;
6203
        anl     _EXIF,#0xEF
6204
;       ../../include/ztex-isr.h:365: USBIRQ = bmBIT5;
6205
        mov     dptr,#_USBIRQ
6206
        mov     a,#0x20
6207
        movx    @dptr,a
6208
        pop     dph
6209
        pop     dpl
6210
        pop     acc
6211
        reti
6212
;       eliminated unneeded push/pop psw
6213
;       eliminated unneeded push/pop b
6214
;------------------------------------------------------------
6215
;Allocation info for local variables in function 'EP0ACK_ISR'
6216
;------------------------------------------------------------
6217
;------------------------------------------------------------
6218
;       ../../include/ztex-isr.h:371: void EP0ACK_ISR() __interrupt
6219
;       -----------------------------------------
6220
;        function EP0ACK_ISR
6221
;       -----------------------------------------
6222
_EP0ACK_ISR:
6223
        push    acc
6224
        push    dpl
6225
        push    dph
6226
;       ../../include/ztex-isr.h:373: EXIF &= ~bmBIT4;    // clear USB interrupt flag
6227
        anl     _EXIF,#0xEF
6228
;       ../../include/ztex-isr.h:374: USBIRQ = bmBIT6;  // clear EP0ACK IRQ
6229
        mov     dptr,#_USBIRQ
6230
        mov     a,#0x40
6231
        movx    @dptr,a
6232
        pop     dph
6233
        pop     dpl
6234
        pop     acc
6235
        reti
6236
;       eliminated unneeded push/pop psw
6237
;       eliminated unneeded push/pop b
6238
;------------------------------------------------------------
6239
;Allocation info for local variables in function 'EP0IN_ISR'
6240
;------------------------------------------------------------
6241
;------------------------------------------------------------
6242
;       ../../include/ztex-isr.h:380: static void EP0IN_ISR () __interrupt
6243
;       -----------------------------------------
6244
;        function EP0IN_ISR
6245
;       -----------------------------------------
6246
_EP0IN_ISR:
6247
        push    bits
6248
        push    acc
6249
        push    b
6250
        push    dpl
6251
        push    dph
6252
        push    (0+2)
6253
        push    (0+3)
6254
        push    (0+4)
6255
        push    (0+5)
6256
        push    (0+6)
6257
        push    (0+7)
6258
        push    (0+0)
6259
        push    (0+1)
6260
        push    psw
6261
        mov     psw,#0x00
6262
;       ../../include/ztex-isr.h:382: EUSB = 0;                 // block all USB interrupts
6263
        clr     _EUSB
6264
;       ../../include/ztex-isr.h:383: ep0_payload_update();
6265
        lcall   _ep0_payload_update
6266
;       ../../include/ztex-isr.h:384: switch ( ep0_prev_setup_request ) {
6267
        mov     dptr,#_ep0_prev_setup_request
6268
        movx    a,@dptr
6269
        mov     r2,a
6270
        cjne    r2,#0x30,00124$
6271
        ljmp    00112$
6272
00124$:
6273
        cjne    r2,#0x38,00125$
6274
        sjmp    00101$
6275
00125$:
6276
        cjne    r2,#0x3A,00126$
6277
        sjmp    00112$
6278
00126$:
6279
        cjne    r2,#0x3B,00127$
6280
        sjmp    00103$
6281
00127$:
6282
        cjne    r2,#0x3D,00128$
6283
        sjmp    00112$
6284
00128$:
6285
        cjne    r2,#0x40,00129$
6286
        sjmp    00112$
6287
00129$:
6288
        cjne    r2,#0x41,00130$
6289
        sjmp    00106$
6290
00130$:
6291
;       ../../include/ztex-conf.h:105: case $0:
6292
        cjne    r2,#0x43,00111$
6293
        sjmp    00112$
6294
00101$:
6295
;       ../../include/ztex-eeprom.h:222: EP0BCH = 0;
6296
        mov     dptr,#_EP0BCH
6297
        clr     a
6298
        movx    @dptr,a
6299
;       ../../include/ztex-eeprom.h:223: EP0BCL = eeprom_read_ep0();
6300
        lcall   _eeprom_read_ep0
6301
        mov     a,dpl
6302
        mov     dptr,#_EP0BCL
6303
        movx    @dptr,a
6304
;       ../../include/ztex-conf.h:107: break;
6305
;       ../../include/ztex-conf.h:105: case $0:
6306
        sjmp    00112$
6307
00103$:
6308
;       ../../include/ztex-eeprom.h:371: EP0BCH = 0;
6309
        mov     dptr,#_EP0BCH
6310
        clr     a
6311
        movx    @dptr,a
6312
;       ../../include/ztex-eeprom.h:372: EP0BCL = mac_eeprom_read_ep0();
6313
        lcall   _mac_eeprom_read_ep0
6314
        mov     a,dpl
6315
        mov     dptr,#_EP0BCL
6316
        movx    @dptr,a
6317
;       ../../include/ztex-conf.h:107: break;
6318
;       ../../include/ztex-conf.h:105: case $0:
6319
        sjmp    00112$
6320
00106$:
6321
;       ../../include/ztex-flash2.h:679: if ( ep0_payload_transfer != 0 ) {
6322
        mov     dptr,#_ep0_payload_transfer
6323
        movx    a,@dptr
6324
        mov     r2,a
6325
        jz      00108$
6326
;       ../../include/ztex-flash2.h:680: flash_ec = 0;
6327
        mov     dptr,#_flash_ec
6328
        clr     a
6329
        movx    @dptr,a
6330
;       ../../include/ztex-flash2.h:681: spi_read_ep0();
6331
        lcall   _spi_read_ep0
6332
00108$:
6333
;       ../../include/ztex-flash2.h:683: EP0BCH = 0;
6334
        mov     dptr,#_EP0BCH
6335
        clr     a
6336
        movx    @dptr,a
6337
;       ../../include/ztex-flash2.h:684: EP0BCL = ep0_payload_transfer;
6338
        mov     dptr,#_ep0_payload_transfer
6339
        movx    a,@dptr
6340
        mov     r2,a
6341
        mov     dptr,#_EP0BCL
6342
        movx    @dptr,a
6343
;       ../../include/ztex-conf.h:107: break;
6344
;       ../../include/ztex-isr.h:386: default:
6345
        sjmp    00112$
6346
00111$:
6347
;       ../../include/ztex-isr.h:387: EP0BCH = 0;
6348
        mov     dptr,#_EP0BCH
6349
;       ../../include/ztex-isr.h:388: EP0BCL = 0;
6350
        clr     a
6351
        movx    @dptr,a
6352
        mov     dptr,#_EP0BCL
6353
        movx    @dptr,a
6354
;       ../../include/ztex-isr.h:389: }
6355
00112$:
6356
;       ../../include/ztex-isr.h:390: EXIF &= ~bmBIT4;            // clear USB interrupt flag
6357
        anl     _EXIF,#0xEF
6358
;       ../../include/ztex-isr.h:391: EPIRQ = bmBIT0;           // clear EP0IN IRQ
6359
        mov     dptr,#_EPIRQ
6360
        mov     a,#0x01
6361
        movx    @dptr,a
6362
;       ../../include/ztex-isr.h:392: EUSB = 1;
6363
        setb    _EUSB
6364
        pop     psw
6365
        pop     (0+1)
6366
        pop     (0+0)
6367
        pop     (0+7)
6368
        pop     (0+6)
6369
        pop     (0+5)
6370
        pop     (0+4)
6371
        pop     (0+3)
6372
        pop     (0+2)
6373
        pop     dph
6374
        pop     dpl
6375
        pop     b
6376
        pop     acc
6377
        pop     bits
6378
        reti
6379
;------------------------------------------------------------
6380
;Allocation info for local variables in function 'EP0OUT_ISR'
6381
;------------------------------------------------------------
6382
;------------------------------------------------------------
6383
;       ../../include/ztex-isr.h:398: static void EP0OUT_ISR () __interrupt
6384
;       -----------------------------------------
6385
;        function EP0OUT_ISR
6386
;       -----------------------------------------
6387
_EP0OUT_ISR:
6388
        push    bits
6389
        push    acc
6390
        push    b
6391
        push    dpl
6392
        push    dph
6393
        push    (0+2)
6394
        push    (0+3)
6395
        push    (0+4)
6396
        push    (0+5)
6397
        push    (0+6)
6398
        push    (0+7)
6399
        push    (0+0)
6400
        push    (0+1)
6401
        push    psw
6402
        mov     psw,#0x00
6403
;       ../../include/ztex-isr.h:400: EUSB = 0;                 // block all USB interrupts
6404
        clr     _EUSB
6405
;       ../../include/ztex-isr.h:401: if ( ep0_vendor_cmd_setup ) {
6406
        mov     dptr,#_ep0_vendor_cmd_setup
6407
        movx    a,@dptr
6408
        mov     r2,a
6409
        jz      00102$
6410
;       ../../include/ztex-isr.h:402: ep0_vendor_cmd_setup = 0;
6411
        mov     dptr,#_ep0_vendor_cmd_setup
6412
        clr     a
6413
        movx    @dptr,a
6414
;       ../../include/ztex-isr.h:403: ep0_payload_remaining = (SETUPDAT[7] << 8) | SETUPDAT[6];
6415
        mov     dptr,#(_SETUPDAT + 0x0007)
6416
        movx    a,@dptr
6417
        mov     r3,a
6418
        mov     r2,#0x00
6419
        mov     dptr,#(_SETUPDAT + 0x0006)
6420
        movx    a,@dptr
6421
        mov     r4,a
6422
        mov     r5,#0x00
6423
        mov     dptr,#_ep0_payload_remaining
6424
        mov     a,r4
6425
        orl     a,r2
6426
        movx    @dptr,a
6427
        mov     a,r5
6428
        orl     a,r3
6429
        inc     dptr
6430
        movx    @dptr,a
6431
;       ../../include/ztex-isr.h:404: ep0_vendor_cmd_su();
6432
        lcall   _ep0_vendor_cmd_su
6433
00102$:
6434
;       ../../include/ztex-isr.h:407: ep0_payload_update();
6435
        lcall   _ep0_payload_update
6436
;       ../../include/ztex-isr.h:409: switch ( ep0_prev_setup_request ) {
6437
        mov     dptr,#_ep0_prev_setup_request
6438
        movx    a,@dptr
6439
        mov     r2,a
6440
        cjne    r2,#0x31,00127$
6441
        sjmp    00112$
6442
00127$:
6443
        cjne    r2,#0x32,00128$
6444
        sjmp    00111$
6445
00128$:
6446
        cjne    r2,#0x39,00129$
6447
        sjmp    00103$
6448
00129$:
6449
        cjne    r2,#0x3C,00130$
6450
        sjmp    00104$
6451
00130$:
6452
;       ../../include/ztex-conf.h:128: case $0:
6453
        cjne    r2,#0x42,00112$
6454
        sjmp    00105$
6455
00103$:
6456
;       ../../include/ztex-eeprom.h:240: eeprom_write_ep0(EP0BCL);
6457
        mov     dptr,#_EP0BCL
6458
        movx    a,@dptr
6459
        mov     dpl,a
6460
        lcall   _eeprom_write_ep0
6461
;       ../../include/ztex-conf.h:130: break;
6462
;       ../../include/ztex-conf.h:128: case $0:
6463
        sjmp    00112$
6464
00104$:
6465
;       ../../include/ztex-eeprom.h:382: mac_eeprom_write(EP0BUF, mac_eeprom_addr, EP0BCL);
6466
        mov     dptr,#_mac_eeprom_addr
6467
        movx    a,@dptr
6468
        mov     _mac_eeprom_write_PARM_2,a
6469
        mov     dptr,#_EP0BCL
6470
        movx    a,@dptr
6471
        mov     _mac_eeprom_write_PARM_3,a
6472
        mov     dptr,#_EP0BUF
6473
        lcall   _mac_eeprom_write
6474
;       ../../include/ztex-conf.h:130: break;
6475
;       ../../include/ztex-conf.h:128: case $0:
6476
        sjmp    00112$
6477
00105$:
6478
;       ../../include/ztex-flash2.h:703: if ( ep0_payload_transfer != 0 ) {
6479
        mov     dptr,#_ep0_payload_transfer
6480
        movx    a,@dptr
6481
        mov     r2,a
6482
        jz      00112$
6483
;       ../../include/ztex-flash2.h:704: flash_ec = 0;
6484
        mov     dptr,#_flash_ec
6485
        clr     a
6486
        movx    @dptr,a
6487
;       ../../include/ztex-flash2.h:705: spi_send_ep0();
6488
        lcall   _spi_send_ep0
6489
;       ../../include/ztex-flash2.h:706: if ( flash_ec != 0 ) {
6490
        mov     dptr,#_flash_ec
6491
        movx    a,@dptr
6492
        mov     r2,a
6493
        jz      00112$
6494
;       ../../include/ztex-flash2.h:707: spi_deselect();
6495
        lcall   _spi_deselect
6496
;       ../../include/ztex-conf.h:137: EP0CS |= 0x01;   // set stall
6497
        mov     dptr,#_EP0CS
6498
        movx    a,@dptr
6499
        mov     r2,a
6500
        orl     a,#0x01
6501
        movx    @dptr,a
6502
;       ../../include/ztex-conf.h:138: ep0_payload_remaining = 0;
6503
        mov     dptr,#_ep0_payload_remaining
6504
        clr     a
6505
        movx    @dptr,a
6506
        inc     dptr
6507
        movx    @dptr,a
6508
;       ../../include/ztex-conf.h:139: break;
6509
;       ../../include/ztex-conf.h:128: case $0:
6510
        sjmp    00112$
6511
00111$:
6512
;       ../../include/ztex-fpga7.h:211: fpga_send_ep0();
6513
        lcall   _fpga_send_ep0
6514
;       ../../include/ztex-isr.h:411: }
6515
00112$:
6516
;       ../../include/ztex-isr.h:413: EP0BCL = 0;
6517
        mov     dptr,#_EP0BCL
6518
        clr     a
6519
        movx    @dptr,a
6520
;       ../../include/ztex-isr.h:415: EXIF &= ~bmBIT4;            // clear main USB interrupt flag
6521
        anl     _EXIF,#0xEF
6522
;       ../../include/ztex-isr.h:416: EPIRQ = bmBIT1;           // clear EP0OUT IRQ
6523
        mov     dptr,#_EPIRQ
6524
        mov     a,#0x02
6525
        movx    @dptr,a
6526
;       ../../include/ztex-isr.h:417: if ( ep0_payload_remaining == 0 ) {
6527
        mov     dptr,#_ep0_payload_remaining
6528
        movx    a,@dptr
6529
        mov     r2,a
6530
        inc     dptr
6531
        movx    a,@dptr
6532
        mov     r3,a
6533
        orl     a,r2
6534
        jnz     00114$
6535
;       ../../include/ztex-isr.h:418: EP0CS |= 0x80;            // clear the HSNAK bit
6536
        mov     dptr,#_EP0CS
6537
        movx    a,@dptr
6538
        mov     r2,a
6539
        orl     a,#0x80
6540
        movx    @dptr,a
6541
00114$:
6542
;       ../../include/ztex-isr.h:420: EUSB = 1;
6543
        setb    _EUSB
6544
        pop     psw
6545
        pop     (0+1)
6546
        pop     (0+0)
6547
        pop     (0+7)
6548
        pop     (0+6)
6549
        pop     (0+5)
6550
        pop     (0+4)
6551
        pop     (0+3)
6552
        pop     (0+2)
6553
        pop     dph
6554
        pop     dpl
6555
        pop     b
6556
        pop     acc
6557
        pop     bits
6558
        reti
6559
;------------------------------------------------------------
6560
;Allocation info for local variables in function 'EP1IN_ISR'
6561
;------------------------------------------------------------
6562
;------------------------------------------------------------
6563
;       ../../include/ztex-isr.h:427: void EP1IN_ISR() __interrupt
6564
;       -----------------------------------------
6565
;        function EP1IN_ISR
6566
;       -----------------------------------------
6567
_EP1IN_ISR:
6568
        push    acc
6569
        push    dpl
6570
        push    dph
6571
;       ../../include/ztex-isr.h:429: EXIF &= ~bmBIT4;
6572
        anl     _EXIF,#0xEF
6573
;       ../../include/ztex-isr.h:430: EPIRQ = bmBIT2;
6574
        mov     dptr,#_EPIRQ
6575
        mov     a,#0x04
6576
        movx    @dptr,a
6577
        pop     dph
6578
        pop     dpl
6579
        pop     acc
6580
        reti
6581
;       eliminated unneeded push/pop psw
6582
;       eliminated unneeded push/pop b
6583
;------------------------------------------------------------
6584
;Allocation info for local variables in function 'EP1OUT_ISR'
6585
;------------------------------------------------------------
6586
;------------------------------------------------------------
6587
;       ../../include/ztex-isr.h:437: void EP1OUT_ISR() __interrupt
6588
;       -----------------------------------------
6589
;        function EP1OUT_ISR
6590
;       -----------------------------------------
6591
_EP1OUT_ISR:
6592
        push    acc
6593
        push    dpl
6594
        push    dph
6595
;       ../../include/ztex-isr.h:439: EXIF &= ~bmBIT4;
6596
        anl     _EXIF,#0xEF
6597
;       ../../include/ztex-isr.h:440: EPIRQ = bmBIT3;
6598
        mov     dptr,#_EPIRQ
6599
        mov     a,#0x08
6600
        movx    @dptr,a
6601
        pop     dph
6602
        pop     dpl
6603
        pop     acc
6604
        reti
6605
;       eliminated unneeded push/pop psw
6606
;       eliminated unneeded push/pop b
6607
;------------------------------------------------------------
6608
;Allocation info for local variables in function 'EP2_ISR'
6609
;------------------------------------------------------------
6610
;------------------------------------------------------------
6611
;       ../../include/ztex-isr.h:446: void EP2_ISR() __interrupt
6612
;       -----------------------------------------
6613
;        function EP2_ISR
6614
;       -----------------------------------------
6615
_EP2_ISR:
6616
        push    acc
6617
        push    dpl
6618
        push    dph
6619
;       ../../include/ztex-isr.h:448: EXIF &= ~bmBIT4;
6620
        anl     _EXIF,#0xEF
6621
;       ../../include/ztex-isr.h:449: EPIRQ = bmBIT4;
6622
        mov     dptr,#_EPIRQ
6623
        mov     a,#0x10
6624
        movx    @dptr,a
6625
        pop     dph
6626
        pop     dpl
6627
        pop     acc
6628
        reti
6629
;       eliminated unneeded push/pop psw
6630
;       eliminated unneeded push/pop b
6631
;------------------------------------------------------------
6632
;Allocation info for local variables in function 'EP4_ISR'
6633
;------------------------------------------------------------
6634
;------------------------------------------------------------
6635
;       ../../include/ztex-isr.h:455: void EP4_ISR() __interrupt
6636
;       -----------------------------------------
6637
;        function EP4_ISR
6638
;       -----------------------------------------
6639
_EP4_ISR:
6640
        push    acc
6641
        push    dpl
6642
        push    dph
6643
;       ../../include/ztex-isr.h:457: EXIF &= ~bmBIT4;
6644
        anl     _EXIF,#0xEF
6645
;       ../../include/ztex-isr.h:458: EPIRQ = bmBIT5;
6646
        mov     dptr,#_EPIRQ
6647
        mov     a,#0x20
6648
        movx    @dptr,a
6649
        pop     dph
6650
        pop     dpl
6651
        pop     acc
6652
        reti
6653
;       eliminated unneeded push/pop psw
6654
;       eliminated unneeded push/pop b
6655
;------------------------------------------------------------
6656
;Allocation info for local variables in function 'EP6_ISR'
6657
;------------------------------------------------------------
6658
;------------------------------------------------------------
6659
;       ../../include/ztex-isr.h:464: void EP6_ISR() __interrupt
6660
;       -----------------------------------------
6661
;        function EP6_ISR
6662
;       -----------------------------------------
6663
_EP6_ISR:
6664
        push    acc
6665
        push    dpl
6666
        push    dph
6667
;       ../../include/ztex-isr.h:466: EXIF &= ~bmBIT4;
6668
        anl     _EXIF,#0xEF
6669
;       ../../include/ztex-isr.h:467: EPIRQ = bmBIT6;
6670
        mov     dptr,#_EPIRQ
6671
        mov     a,#0x40
6672
        movx    @dptr,a
6673
        pop     dph
6674
        pop     dpl
6675
        pop     acc
6676
        reti
6677
;       eliminated unneeded push/pop psw
6678
;       eliminated unneeded push/pop b
6679
;------------------------------------------------------------
6680
;Allocation info for local variables in function 'EP8_ISR'
6681
;------------------------------------------------------------
6682
;------------------------------------------------------------
6683
;       ../../include/ztex-isr.h:473: void EP8_ISR() __interrupt
6684
;       -----------------------------------------
6685
;        function EP8_ISR
6686
;       -----------------------------------------
6687
_EP8_ISR:
6688
        push    acc
6689
        push    dpl
6690
        push    dph
6691
;       ../../include/ztex-isr.h:475: EXIF &= ~bmBIT4;
6692
        anl     _EXIF,#0xEF
6693
;       ../../include/ztex-isr.h:476: EPIRQ = bmBIT7;
6694
        mov     dptr,#_EPIRQ
6695
        mov     a,#0x80
6696
        movx    @dptr,a
6697
        pop     dph
6698
        pop     dpl
6699
        pop     acc
6700
        reti
6701
;       eliminated unneeded push/pop psw
6702
;       eliminated unneeded push/pop b
6703
;------------------------------------------------------------
6704
;Allocation info for local variables in function 'mac_eeprom_init'
6705
;------------------------------------------------------------
6706
;b                         Allocated to registers r2
6707
;c                         Allocated to registers r2
6708
;d                         Allocated to registers r4
6709
;buf                       Allocated with name '_mac_eeprom_init_buf_1_1'
6710
;------------------------------------------------------------
6711
;       ../../include/ztex.h:269: void mac_eeprom_init ( ) {
6712
;       -----------------------------------------
6713
;        function mac_eeprom_init
6714
;       -----------------------------------------
6715
_mac_eeprom_init:
6716
;       ../../include/ztex.h:274: mac_eeprom_read ( buf, 0, 3 );        // read signature
6717
        mov     _mac_eeprom_read_PARM_2,#0x00
6718
        mov     _mac_eeprom_read_PARM_3,#0x03
6719
        mov     dptr,#_mac_eeprom_init_buf_1_1
6720
        lcall   _mac_eeprom_read
6721
;       ../../include/ztex.h:275: if ( buf[0]==67 && buf[1]==68 && buf[2]==48 ) {
6722
        mov     dptr,#_mac_eeprom_init_buf_1_1
6723
        movx    a,@dptr
6724
        mov     r2,a
6725
        cjne    r2,#0x43,00102$
6726
        mov     dptr,#(_mac_eeprom_init_buf_1_1 + 0x0001)
6727
        movx    a,@dptr
6728
        mov     r2,a
6729
        cjne    r2,#0x44,00102$
6730
        mov     dptr,#(_mac_eeprom_init_buf_1_1 + 0x0002)
6731
        movx    a,@dptr
6732
        mov     r2,a
6733
        cjne    r2,#0x30,00102$
6734
;       ../../include/ztex.h:276: config_data_valid = 1;
6735
        mov     dptr,#_config_data_valid
6736
        mov     a,#0x01
6737
        movx    @dptr,a
6738
;       ../../include/ztex.h:277: mac_eeprom_read ( SN_STRING, 16, 10 );        // copy serial number
6739
        mov     _mac_eeprom_read_PARM_2,#0x10
6740
        mov     _mac_eeprom_read_PARM_3,#0x0A
6741
        mov     dptr,#_SN_STRING
6742
        lcall   _mac_eeprom_read
6743
        sjmp    00123$
6744
00102$:
6745
;       ../../include/ztex.h:280: config_data_valid = 0;
6746
        mov     dptr,#_config_data_valid
6747
        clr     a
6748
        movx    @dptr,a
6749
;       ../../include/ztex.h:283: for (b=0; b<10; b++) {        // abort if SN != "0000000000"
6750
00123$:
6751
        mov     r2,#0x00
6752
00108$:
6753
        cjne    r2,#0x0A,00133$
6754
00133$:
6755
        jnc     00111$
6756
;       ../../include/ztex.h:284: if ( SN_STRING[b] != 48 )
6757
        mov     a,r2
6758
        add     a,#_SN_STRING
6759
        mov     dpl,a
6760
        clr     a
6761
        addc    a,#(_SN_STRING >> 8)
6762
        mov     dph,a
6763
        movx    a,@dptr
6764
        mov     r3,a
6765
;       ../../include/ztex.h:285: return;
6766
        cjne    r3,#0x30,00116$
6767
;       ../../include/ztex.h:283: for (b=0; b<10; b++) {        // abort if SN != "0000000000"
6768
        inc     r2
6769
        sjmp    00108$
6770
00111$:
6771
;       ../../include/ztex.h:288: mac_eeprom_read ( buf, 0xfb, 5 );     // read the last 5 MAC digits
6772
        mov     _mac_eeprom_read_PARM_2,#0xFB
6773
        mov     _mac_eeprom_read_PARM_3,#0x05
6774
        mov     dptr,#_mac_eeprom_init_buf_1_1
6775
        lcall   _mac_eeprom_read
6776
;       ../../include/ztex.h:290: c=0;
6777
        mov     r2,#0x00
6778
;       ../../include/ztex.h:291: for (b=0; b<5; b++) { // convert to MAC to SN string
6779
        mov     r3,#0x00
6780
00112$:
6781
        cjne    r3,#0x05,00136$
6782
00136$:
6783
        jnc     00116$
6784
;       ../../include/ztex.h:292: d = buf[b];
6785
        mov     a,r3
6786
        add     a,#_mac_eeprom_init_buf_1_1
6787
        mov     dpl,a
6788
        clr     a
6789
        addc    a,#(_mac_eeprom_init_buf_1_1 >> 8)
6790
        mov     dph,a
6791
        movx    a,@dptr
6792
        mov     r4,a
6793
;       ../../include/ztex.h:293: SN_STRING[c] = hexdigits[d>>4];
6794
        mov     a,r2
6795
        add     a,#_SN_STRING
6796
        mov     r5,a
6797
        clr     a
6798
        addc    a,#(_SN_STRING >> 8)
6799
        mov     r6,a
6800
        mov     a,r4
6801
        swap    a
6802
        anl     a,#0x0f
6803
        mov     dptr,#_mac_eeprom_init_hexdigits_1_1
6804
        movc    a,@a+dptr
6805
        mov     r7,a
6806
        mov     dpl,r5
6807
        mov     dph,r6
6808
        movx    @dptr,a
6809
;       ../../include/ztex.h:294: c++;
6810
        inc     r2
6811
;       ../../include/ztex.h:295: SN_STRING[c] = hexdigits[d & 15];
6812
        mov     a,r2
6813
        add     a,#_SN_STRING
6814
        mov     r5,a
6815
        clr     a
6816
        addc    a,#(_SN_STRING >> 8)
6817
        mov     r6,a
6818
        mov     a,#0x0F
6819
        anl     a,r4
6820
        mov     dptr,#_mac_eeprom_init_hexdigits_1_1
6821
        movc    a,@a+dptr
6822
        mov     r4,a
6823
        mov     dpl,r5
6824
        mov     dph,r6
6825
        movx    @dptr,a
6826
;       ../../include/ztex.h:296: c++;
6827
        inc     r2
6828
;       ../../include/ztex.h:291: for (b=0; b<5; b++) { // convert to MAC to SN string
6829
        inc     r3
6830
        sjmp    00112$
6831
00116$:
6832
        ret
6833
;------------------------------------------------------------
6834
;Allocation info for local variables in function 'init_USB'
6835
;------------------------------------------------------------
6836
;------------------------------------------------------------
6837
;       ../../include/ztex.h:345: void init_USB ()
6838
;       -----------------------------------------
6839
;        function init_USB
6840
;       -----------------------------------------
6841
_init_USB:
6842
;       ../../include/ztex.h:347: USBCS |= bmBIT3;
6843
        mov     dptr,#_USBCS
6844
        movx    a,@dptr
6845
        orl     a,#0x08
6846
        movx    @dptr,a
6847
;       ../../include/ztex.h:349: CPUCS = bmBIT4 | bmBIT1;
6848
        mov     dptr,#_CPUCS
6849
        mov     a,#0x12
6850
        movx    @dptr,a
6851
;       ../../include/ztex.h:350: wait(2);
6852
        mov     dptr,#0x0002
6853
        lcall   _wait
6854
;       ../../include/ztex.h:351: CKCON &= ~7;
6855
        anl     _CKCON,#0xF8
6856
;       ../../include/ztex.h:378: init_fpga();
6857
        lcall   _init_fpga
6858
;       ../../include/ztex-fpga-flash2.h:105: fpga_flash_result= 255;
6859
        mov     dptr,#_fpga_flash_result
6860
        mov     a,#0xFF
6861
        movx    @dptr,a
6862
;       ../../include/ztex.h:385: EA = 0;
6863
        clr     _EA
6864
;       ../../include/ztex.h:386: EUSB = 0;
6865
        clr     _EUSB
6866
;       ../../include/ezintavecs.h:123: INT8VEC_USB.op=0x02;
6867
        mov     dptr,#_INT8VEC_USB
6868
        mov     a,#0x02
6869
        movx    @dptr,a
6870
;       ../../include/ezintavecs.h:124: INT8VEC_USB.addrH = 0x01;
6871
        mov     dptr,#(_INT8VEC_USB + 0x0001)
6872
        mov     a,#0x01
6873
        movx    @dptr,a
6874
;       ../../include/ezintavecs.h:125: INT8VEC_USB.addrL = 0xb8;
6875
        mov     dptr,#(_INT8VEC_USB + 0x0002)
6876
        mov     a,#0xB8
6877
        movx    @dptr,a
6878
;       ../../include/ezintavecs.h:126: INTSETUP |= 8;
6879
        mov     dptr,#_INTSETUP
6880
        movx    a,@dptr
6881
        orl     a,#0x08
6882
        movx    @dptr,a
6883
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6884
        mov     dptr,#_INTVEC_SUDAV
6885
        mov     a,#0x02
6886
        movx    @dptr,a
6887
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6888
        mov     r2,#_SUDAV_ISR
6889
        mov     r3,#(_SUDAV_ISR >> 8)
6890
        mov     ar4,r3
6891
        mov     dptr,#(_INTVEC_SUDAV + 0x0001)
6892
        mov     a,r4
6893
        movx    @dptr,a
6894
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6895
        mov     dptr,#(_INTVEC_SUDAV + 0x0002)
6896
        mov     a,r2
6897
        movx    @dptr,a
6898
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6899
        mov     dptr,#_INTVEC_SOF
6900
        mov     a,#0x02
6901
        movx    @dptr,a
6902
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6903
        mov     r2,#_SOF_ISR
6904
        mov     r3,#(_SOF_ISR >> 8)
6905
        mov     ar4,r3
6906
        mov     dptr,#(_INTVEC_SOF + 0x0001)
6907
        mov     a,r4
6908
        movx    @dptr,a
6909
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6910
        mov     dptr,#(_INTVEC_SOF + 0x0002)
6911
        mov     a,r2
6912
        movx    @dptr,a
6913
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6914
        mov     dptr,#_INTVEC_SUTOK
6915
        mov     a,#0x02
6916
        movx    @dptr,a
6917
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6918
        mov     r2,#_SUTOK_ISR
6919
        mov     r3,#(_SUTOK_ISR >> 8)
6920
        mov     ar4,r3
6921
        mov     dptr,#(_INTVEC_SUTOK + 0x0001)
6922
        mov     a,r4
6923
        movx    @dptr,a
6924
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6925
        mov     dptr,#(_INTVEC_SUTOK + 0x0002)
6926
        mov     a,r2
6927
        movx    @dptr,a
6928
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6929
        mov     dptr,#_INTVEC_SUSPEND
6930
        mov     a,#0x02
6931
        movx    @dptr,a
6932
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6933
        mov     r2,#_SUSP_ISR
6934
        mov     r3,#(_SUSP_ISR >> 8)
6935
        mov     ar4,r3
6936
        mov     dptr,#(_INTVEC_SUSPEND + 0x0001)
6937
        mov     a,r4
6938
        movx    @dptr,a
6939
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6940
        mov     dptr,#(_INTVEC_SUSPEND + 0x0002)
6941
        mov     a,r2
6942
        movx    @dptr,a
6943
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6944
        mov     dptr,#_INTVEC_USBRESET
6945
        mov     a,#0x02
6946
        movx    @dptr,a
6947
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6948
        mov     r2,#_URES_ISR
6949
        mov     r3,#(_URES_ISR >> 8)
6950
        mov     ar4,r3
6951
        mov     dptr,#(_INTVEC_USBRESET + 0x0001)
6952
        mov     a,r4
6953
        movx    @dptr,a
6954
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6955
        mov     dptr,#(_INTVEC_USBRESET + 0x0002)
6956
        mov     a,r2
6957
        movx    @dptr,a
6958
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6959
        mov     dptr,#_INTVEC_HISPEED
6960
        mov     a,#0x02
6961
        movx    @dptr,a
6962
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6963
        mov     r2,#_HSGRANT_ISR
6964
        mov     r3,#(_HSGRANT_ISR >> 8)
6965
        mov     ar4,r3
6966
        mov     dptr,#(_INTVEC_HISPEED + 0x0001)
6967
        mov     a,r4
6968
        movx    @dptr,a
6969
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6970
        mov     dptr,#(_INTVEC_HISPEED + 0x0002)
6971
        mov     a,r2
6972
        movx    @dptr,a
6973
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6974
        mov     dptr,#_INTVEC_EP0ACK
6975
        mov     a,#0x02
6976
        movx    @dptr,a
6977
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6978
        mov     r2,#_EP0ACK_ISR
6979
        mov     r3,#(_EP0ACK_ISR >> 8)
6980
        mov     ar4,r3
6981
        mov     dptr,#(_INTVEC_EP0ACK + 0x0001)
6982
        mov     a,r4
6983
        movx    @dptr,a
6984
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
6985
        mov     dptr,#(_INTVEC_EP0ACK + 0x0002)
6986
        mov     a,r2
6987
        movx    @dptr,a
6988
;       ../../include/ezintavecs.h:115: $0.op=0x02;
6989
        mov     dptr,#_INTVEC_EP0IN
6990
        mov     a,#0x02
6991
        movx    @dptr,a
6992
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
6993
        mov     r2,#_EP0IN_ISR
6994
        mov     r3,#(_EP0IN_ISR >> 8)
6995
        mov     ar4,r3
6996
        mov     dptr,#(_INTVEC_EP0IN + 0x0001)
6997
        mov     a,r4
6998
        movx    @dptr,a
6999
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7000
        mov     dptr,#(_INTVEC_EP0IN + 0x0002)
7001
        mov     a,r2
7002
        movx    @dptr,a
7003
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7004
        mov     dptr,#_INTVEC_EP0OUT
7005
        mov     a,#0x02
7006
        movx    @dptr,a
7007
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7008
        mov     r2,#_EP0OUT_ISR
7009
        mov     r3,#(_EP0OUT_ISR >> 8)
7010
        mov     ar4,r3
7011
        mov     dptr,#(_INTVEC_EP0OUT + 0x0001)
7012
        mov     a,r4
7013
        movx    @dptr,a
7014
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7015
        mov     dptr,#(_INTVEC_EP0OUT + 0x0002)
7016
        mov     a,r2
7017
        movx    @dptr,a
7018
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7019
        mov     dptr,#_INTVEC_EP1IN
7020
        mov     a,#0x02
7021
        movx    @dptr,a
7022
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7023
        mov     r2,#_EP1IN_ISR
7024
        mov     r3,#(_EP1IN_ISR >> 8)
7025
        mov     ar4,r3
7026
        mov     dptr,#(_INTVEC_EP1IN + 0x0001)
7027
        mov     a,r4
7028
        movx    @dptr,a
7029
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7030
        mov     dptr,#(_INTVEC_EP1IN + 0x0002)
7031
        mov     a,r2
7032
        movx    @dptr,a
7033
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7034
        mov     dptr,#_INTVEC_EP1OUT
7035
        mov     a,#0x02
7036
        movx    @dptr,a
7037
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7038
        mov     r2,#_EP1OUT_ISR
7039
        mov     r3,#(_EP1OUT_ISR >> 8)
7040
        mov     ar4,r3
7041
        mov     dptr,#(_INTVEC_EP1OUT + 0x0001)
7042
        mov     a,r4
7043
        movx    @dptr,a
7044
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7045
        mov     dptr,#(_INTVEC_EP1OUT + 0x0002)
7046
        mov     a,r2
7047
        movx    @dptr,a
7048
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7049
        mov     dptr,#_INTVEC_EP2
7050
        mov     a,#0x02
7051
        movx    @dptr,a
7052
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7053
        mov     r2,#_EP2_ISR
7054
        mov     r3,#(_EP2_ISR >> 8)
7055
        mov     ar4,r3
7056
        mov     dptr,#(_INTVEC_EP2 + 0x0001)
7057
        mov     a,r4
7058
        movx    @dptr,a
7059
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7060
        mov     dptr,#(_INTVEC_EP2 + 0x0002)
7061
        mov     a,r2
7062
        movx    @dptr,a
7063
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7064
        mov     dptr,#_INTVEC_EP4
7065
        mov     a,#0x02
7066
        movx    @dptr,a
7067
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7068
        mov     r2,#_EP4_ISR
7069
        mov     r3,#(_EP4_ISR >> 8)
7070
        mov     ar4,r3
7071
        mov     dptr,#(_INTVEC_EP4 + 0x0001)
7072
        mov     a,r4
7073
        movx    @dptr,a
7074
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7075
        mov     dptr,#(_INTVEC_EP4 + 0x0002)
7076
        mov     a,r2
7077
        movx    @dptr,a
7078
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7079
        mov     dptr,#_INTVEC_EP6
7080
        mov     a,#0x02
7081
        movx    @dptr,a
7082
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7083
        mov     r2,#_EP6_ISR
7084
        mov     r3,#(_EP6_ISR >> 8)
7085
        mov     ar4,r3
7086
        mov     dptr,#(_INTVEC_EP6 + 0x0001)
7087
        mov     a,r4
7088
        movx    @dptr,a
7089
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7090
        mov     dptr,#(_INTVEC_EP6 + 0x0002)
7091
        mov     a,r2
7092
        movx    @dptr,a
7093
;       ../../include/ezintavecs.h:115: $0.op=0x02;
7094
        mov     dptr,#_INTVEC_EP8
7095
        mov     a,#0x02
7096
        movx    @dptr,a
7097
;       ../../include/ezintavecs.h:116: $0.addrH=((unsigned short)(&$1)) >> 8;
7098
        mov     r2,#_EP8_ISR
7099
        mov     r3,#(_EP8_ISR >> 8)
7100
        mov     ar4,r3
7101
        mov     dptr,#(_INTVEC_EP8 + 0x0001)
7102
        mov     a,r4
7103
        movx    @dptr,a
7104
;       ../../include/ezintavecs.h:117: $0.addrL=(unsigned short)(&$1);
7105
        mov     dptr,#(_INTVEC_EP8 + 0x0002)
7106
        mov     a,r2
7107
        movx    @dptr,a
7108
;       ../../include/ztex.h:407: EXIF &= ~bmBIT4;
7109
        anl     _EXIF,#0xEF
7110
;       ../../include/ztex.h:408: USBIRQ = 0x7f;
7111
        mov     dptr,#_USBIRQ
7112
        mov     a,#0x7F
7113
        movx    @dptr,a
7114
;       ../../include/ztex.h:409: USBIE |= 0x7f;
7115
        mov     dptr,#_USBIE
7116
        movx    a,@dptr
7117
        mov     r2,a
7118
        orl     a,#0x7F
7119
        movx    @dptr,a
7120
;       ../../include/ztex.h:410: EPIRQ = 0xff;
7121
        mov     dptr,#_EPIRQ
7122
        mov     a,#0xFF
7123
        movx    @dptr,a
7124
;       ../../include/ztex.h:411: EPIE = 0xff;
7125
        mov     dptr,#_EPIE
7126
        mov     a,#0xFF
7127
        movx    @dptr,a
7128
;       ../../include/ztex.h:413: EUSB = 1;
7129
        setb    _EUSB
7130
;       ../../include/ztex.h:414: EA = 1;
7131
        setb    _EA
7132
;       ../../include/ztex.h:333: EP$0CFG = bmBIT7 | bmBIT5;
7133
        mov     dptr,#_EP1INCFG
7134
        mov     a,#0xA0
7135
        movx    @dptr,a
7136
;       ../../include/ezregs.h:46: __endasm;
7137
 
7138
         nop
7139
         nop
7140
         nop
7141
         nop
7142
 
7143
;       ../../include/ztex.h:333: EP$0CFG = bmBIT7 | bmBIT5;
7144
        mov     dptr,#_EP1OUTCFG
7145
        mov     a,#0xA0
7146
        movx    @dptr,a
7147
;       ../../include/ezregs.h:46: __endasm;
7148
 
7149
         nop
7150
         nop
7151
         nop
7152
         nop
7153
 
7154
;       ../../include/ztex.h:328: ;
7155
        mov     dptr,#_EP2CFG
7156
        clr     a
7157
        movx    @dptr,a
7158
;       ../../include/ezregs.h:46: __endasm;
7159
 
7160
         nop
7161
         nop
7162
         nop
7163
         nop
7164
 
7165
;       ../../include/ztex.h:328: ;
7166
        mov     dptr,#_EP4CFG
7167
        clr     a
7168
        movx    @dptr,a
7169
;       ../../include/ezregs.h:46: __endasm;
7170
 
7171
         nop
7172
         nop
7173
         nop
7174
         nop
7175
 
7176
;       ../../include/ztex.h:328: ;
7177
        mov     dptr,#_EP6CFG
7178
        clr     a
7179
        movx    @dptr,a
7180
;       ../../include/ezregs.h:46: __endasm;
7181
 
7182
         nop
7183
         nop
7184
         nop
7185
         nop
7186
 
7187
;       ../../include/ztex.h:328: ;
7188
        mov     dptr,#_EP8CFG
7189
        clr     a
7190
        movx    @dptr,a
7191
;       ../../include/ezregs.h:46: __endasm;
7192
 
7193
         nop
7194
         nop
7195
         nop
7196
         nop
7197
 
7198
;       ../../include/ztex.h:434: flash_init();
7199
        lcall   _flash_init
7200
;       ../../include/ztex.h:435: if ( !flash_enabled ) {
7201
        mov     dptr,#_flash_enabled
7202
        movx    a,@dptr
7203
        mov     r2,a
7204
        jnz     00102$
7205
;       ../../include/ztex.h:436: wait(250);
7206
        mov     dptr,#0x00FA
7207
        lcall   _wait
7208
;       ../../include/ztex.h:437: flash_init();
7209
        lcall   _flash_init
7210
00102$:
7211
;       ../../include/ztex.h:447: mac_eeprom_init();
7212
        lcall   _mac_eeprom_init
7213
;       ../../include/ztex.h:453: fpga_configure_from_flash_init();
7214
        lcall   _fpga_configure_from_flash_init
7215
;       ../../include/ztex.h:456: USBCS |= bmBIT7 | bmBIT1;
7216
        mov     dptr,#_USBCS
7217
        movx    a,@dptr
7218
        orl     a,#0x82
7219
        movx    @dptr,a
7220
;       ../../include/ztex.h:457: wait(10);
7221
        mov     dptr,#0x000A
7222
        lcall   _wait
7223
;       ../../include/ztex.h:459: USBCS &= ~bmBIT3;
7224
        mov     dptr,#_USBCS
7225
        movx    a,@dptr
7226
        anl     a,#0xF7
7227
        movx    @dptr,a
7228
        ret
7229
;------------------------------------------------------------
7230
;Allocation info for local variables in function 'main'
7231
;------------------------------------------------------------
7232
;------------------------------------------------------------
7233
;       default.c:35: void main(void)
7234
;       -----------------------------------------
7235
;        function main
7236
;       -----------------------------------------
7237
_main:
7238
;       default.c:37: init_USB();
7239
        lcall   _init_USB
7240
;       default.c:39: if ( config_data_valid ) {
7241
        mov     dptr,#_config_data_valid
7242
        movx    a,@dptr
7243
        mov     r2,a
7244
        jz      00104$
7245
;       default.c:40: mac_eeprom_read ( (__xdata BYTE*) (productString+20), 6, 1 );
7246
        mov     dptr,#(_productString + 0x0014)
7247
        mov     _mac_eeprom_read_PARM_2,#0x06
7248
        mov     _mac_eeprom_read_PARM_3,#0x01
7249
        lcall   _mac_eeprom_read
7250
;       default.c:43: while (1) {       }                                       //  twiddle thumbs
7251
00104$:
7252
        sjmp    00104$
7253
        .area CSEG    (CODE)
7254
        .area CONST   (CODE)
7255
_fpga_flash_boot_id:
7256
        .db #0x5A
7257
        .db #0x54
7258
        .db #0x45
7259
        .db #0x58
7260
        .db #0x42
7261
        .db #0x53
7262
        .db #0x01
7263
        .db #0x01
7264
_manufacturerString:
7265
        .ascii "ZTEX"
7266
        .db 0x00
7267
_productString:
7268
        .ascii "USB-FPGA Module 2.01  (default)"
7269
        .db 0x00
7270
_configurationString:
7271
        .ascii "default"
7272
        .db 0x00
7273
_DeviceDescriptor:
7274
        .db #0x12
7275
        .db #0x01
7276
        .db #0x00
7277
        .db #0x02
7278
        .db #0xFF
7279
        .db #0xFF
7280
        .db #0xFF
7281
        .db #0x40
7282
        .db #0x1A
7283
        .db #0x22
7284
        .db #0x00
7285
        .db #0x01
7286
        .db #0x00
7287
        .db #0x00
7288
        .db #0x01
7289
        .db #0x02
7290
        .db #0x03
7291
        .db #0x01
7292
_DeviceQualifierDescriptor:
7293
        .db #0x0A
7294
        .db #0x06
7295
        .db #0x00
7296
        .db #0x02
7297
        .db #0xFF
7298
        .db #0xFF
7299
        .db #0xFF
7300
        .db #0x40
7301
        .db #0x01
7302
        .db #0x00
7303
_HighSpeedConfigDescriptor:
7304
        .db #0x09
7305
        .db #0x02
7306
        .db #0x20
7307
        .db #0x00
7308
        .db #0x01
7309
        .db #0x01
7310
        .db #0x04
7311
        .db #0xC0
7312
        .db #0x32
7313
        .db #0x09
7314
        .db #0x04
7315
        .db #0x00
7316
        .db #0x00
7317
        .db #0x02
7318
        .db #0xFF
7319
        .db #0xFF
7320
        .db #0xFF
7321
        .db #0x00
7322
        .db #0x07
7323
        .db #0x05
7324
        .db #0x81
7325
        .db #0x02
7326
        .db #0x00
7327
        .db #0x02
7328
        .db #0x00
7329
        .db #0x07
7330
        .db #0x05
7331
        .db #0x01
7332
        .db #0x02
7333
        .db #0x00
7334
        .db #0x02
7335
        .db #0x00
7336
_HighSpeedConfigDescriptor_PadByte:
7337
        .db #0x00
7338
        .db 0x00
7339
_FullSpeedConfigDescriptor:
7340
        .db #0x09
7341
        .db #0x02
7342
        .db #0x20
7343
        .db #0x00
7344
        .db #0x01
7345
        .db #0x01
7346
        .db #0x04
7347
        .db #0xC0
7348
        .db #0x32
7349
        .db #0x09
7350
        .db #0x04
7351
        .db #0x00
7352
        .db #0x00
7353
        .db #0x02
7354
        .db #0xFF
7355
        .db #0xFF
7356
        .db #0xFF
7357
        .db #0x00
7358
        .db #0x07
7359
        .db #0x05
7360
        .db #0x81
7361
        .db #0x02
7362
        .db #0x40
7363
        .db #0x00
7364
        .db #0x00
7365
        .db #0x07
7366
        .db #0x05
7367
        .db #0x01
7368
        .db #0x02
7369
        .db #0x40
7370
        .db #0x00
7371
        .db #0x00
7372
_FullSpeedConfigDescriptor_PadByte:
7373
        .db #0x00
7374
        .db 0x00
7375
_EmptyStringDescriptor:
7376
        .db #0x04
7377
        .db #0x03
7378
        .db #0x00
7379
        .db #0x00
7380
_mac_eeprom_init_hexdigits_1_1:
7381
        .ascii "0123456789ABCDEF"
7382
        .db 0x00
7383
        .area XINIT   (CODE)
7384
__xinit__ep0_payload_remaining:
7385
        .byte #0x00,#0x00
7386
__xinit__ep0_payload_transfer:
7387
        .db #0x00
7388
__xinit__ep0_prev_setup_request:
7389
        .db #0xFF
7390
__xinit__ep0_vendor_cmd_setup:
7391
        .db #0x00
7392
__xinit__ISOFRAME_COUNTER:
7393
        .byte #0x00,#0x00
7394
        .byte #0x00,#0x00
7395
        .byte #0x00,#0x00
7396
        .byte #0x00,#0x00
7397
        .area CABS    (ABS,CODE)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.