1 ;-------------------------------------------------------- 2 ; File Created by SDCC : free open source ANSI-C Compiler 3 ; Version 4.2.0 #13081 (Linux) 4 ;-------------------------------------------------------- 5 .module fx2utils 6 .optsdcc -mmcs51 --model-small 7 8 ;-------------------------------------------------------- 9 ; Public variables in this module 10 ;-------------------------------------------------------- 11 .globl _mdelay 12 .globl _EIPX6 13 .globl _EIPX5 14 .globl _EIPX4 15 .globl _PI2C 16 .globl _PUSB 17 .globl _EIEX6 18 .globl _EIEX5 19 .globl _EIEX4 20 .globl _EI2C 21 .globl _EIUSB 22 .globl _SMOD1 23 .globl _ERESI 24 .globl _RESI 25 .globl _INT6 26 .globl _CY 27 .globl _AC 28 .globl _F0 29 .globl _RS1 30 .globl _RS0 31 .globl _OV 32 .globl _FL 33 .globl _P 34 .globl _TF2 35 .globl _EXF2 36 .globl _RCLK 37 .globl _TCLK 38 .globl _EXEN2 39 .globl _TR2 40 .globl _C_T2 41 .globl _CP_RL2 42 .globl _SM01 43 .globl _SM11 44 .globl _SM21 45 .globl _REN1 46 .globl _TB81 47 .globl _RB81 48 .globl _TI1 49 .globl _RI1 50 .globl _PS1 51 .globl _PT2 52 .globl _PS0 53 .globl _PT1 54 .globl _PX1 55 .globl _PT0 56 .globl _PX0 57 .globl _EA 58 .globl _ES1 59 .globl _ET2 60 .globl _ES0 61 .globl _ET1 62 .globl _EX1 63 .globl _ET0 64 .globl _EX0 65 .globl _SM0 66 .globl _SM1 67 .globl _SM2 68 .globl _REN 69 .globl _TB8 70 .globl _RB8 71 .globl _TI 72 .globl _RI 73 .globl _TF1 74 .globl _TR1 75 .globl _TF0 76 .globl _TR0 77 .globl _IE1 78 .globl _IT1 79 .globl _IE0 80 .globl _IT0 81 .globl _SEL 82 .globl _EIP 83 .globl _B 84 .globl _EIE 85 .globl _ACC 86 .globl _EICON 87 .globl _PSW 88 .globl _TH2 89 .globl _TL2 90 .globl _RCAP2H 91 .globl _RCAP2L 92 .globl _T2CON 93 .globl _SBUF1 94 .globl _SCON1 95 .globl _GPIFSGLDATLNOX 96 .globl _GPIFSGLDATLX 97 .globl _GPIFSGLDATH 98 .globl _GPIFTRIG 99 .globl _EP01STAT 100 .globl _IP 101 .globl _OEE 102 .globl _OED 103 .globl _OEC 104 .globl _OEB 105 .globl _OEA 106 .globl _IOE 107 .globl _IOD 108 .globl _AUTOPTRSETUP 109 .globl _EP68FIFOFLGS 110 .globl _EP24FIFOFLGS 111 .globl _EP2468STAT 112 .globl _IE 113 .globl _INT4CLR 114 .globl _INT2CLR 115 .globl _IOC 116 .globl _AUTODAT2 117 .globl _AUTOPTRL2 118 .globl _AUTOPTRH2 119 .globl _AUTODAT1 120 .globl _APTR1L 121 .globl _APTR1H 122 .globl _SBUF0 123 .globl _SCON0 124 .globl _MPAGE 125 .globl _EXIF 126 .globl _IOB 127 .globl _CKCON 128 .globl _TH1 129 .globl _TH0 130 .globl _TL1 131 .globl _TL0 132 .globl _TMOD 133 .globl _TCON 134 .globl _PCON 135 .globl _DPS 136 .globl _DPH1 137 .globl _DPL1 138 .globl _DPH 139 .globl _DPL 140 .globl _SP 141 .globl _IOA 142 .globl _EP8FIFOBUF 143 .globl _EP6FIFOBUF 144 .globl _EP4FIFOBUF 145 .globl _EP2FIFOBUF 146 .globl _EP1INBUF 147 .globl _EP1OUTBUF 148 .globl _EP0BUF 149 .globl _CT4 150 .globl _CT3 151 .globl _CT2 152 .globl _CT1 153 .globl _USBTEST 154 .globl _TESTCFG 155 .globl _DBUG 156 .globl _UDMACRCQUAL 157 .globl _UDMACRCL 158 .globl _UDMACRCH 159 .globl _GPIFHOLDAMOUNT 160 .globl _FLOWSTBHPERIOD 161 .globl _FLOWSTBEDGE 162 .globl _FLOWSTB 163 .globl _FLOWHOLDOFF 164 .globl _FLOWEQ1CTL 165 .globl _FLOWEQ0CTL 166 .globl _FLOWLOGIC 167 .globl _FLOWSTATE 168 .globl _GPIFABORT 169 .globl _GPIFREADYSTAT 170 .globl _GPIFREADYCFG 171 .globl _XGPIFSGLDATLNOX 172 .globl _XGPIFSGLDATLX 173 .globl _XGPIFSGLDATH 174 .globl _EP8GPIFTRIG 175 .globl _EP8GPIFPFSTOP 176 .globl _EP8GPIFFLGSEL 177 .globl _EP6GPIFTRIG 178 .globl _EP6GPIFPFSTOP 179 .globl _EP6GPIFFLGSEL 180 .globl _EP4GPIFTRIG 181 .globl _EP4GPIFPFSTOP 182 .globl _EP4GPIFFLGSEL 183 .globl _EP2GPIFTRIG 184 .globl _EP2GPIFPFSTOP 185 .globl _EP2GPIFFLGSEL 186 .globl _GPIFTCB0 187 .globl _GPIFTCB1 188 .globl _GPIFTCB2 189 .globl _GPIFTCB3 190 .globl _GPIFADRL 191 .globl _GPIFADRH 192 .globl _GPIFCTLCFG 193 .globl _GPIFIDLECTL 194 .globl _GPIFIDLECS 195 .globl _GPIFWFSELECT 196 .globl _SETUPDAT 197 .globl _SUDPTRCTL 198 .globl _SUDPTRL 199 .globl _SUDPTRH 200 .globl _EP8FIFOBCL 201 .globl _EP8FIFOBCH 202 .globl _EP6FIFOBCL 203 .globl _EP6FIFOBCH 204 .globl _EP4FIFOBCL 205 .globl _EP4FIFOBCH 206 .globl _EP2FIFOBCL 207 .globl _EP2FIFOBCH 208 .globl _EP8FIFOFLGS 209 .globl _EP6FIFOFLGS 210 .globl _EP4FIFOFLGS 211 .globl _EP2FIFOFLGS 212 .globl _EP8CS 213 .globl _EP6CS 214 .globl _EP4CS 215 .globl _EP2CS 216 .globl _EP1INCS 217 .globl _EP1OUTCS 218 .globl _EP0CS 219 .globl _EP8BCL 220 .globl _EP8BCH 221 .globl _EP6BCL 222 .globl _EP6BCH 223 .globl _EP4BCL 224 .globl _EP4BCH 225 .globl _EP2BCL 226 .globl _EP2BCH 227 .globl _EP1INBC 228 .globl _EP1OUTBC 229 .globl _EP0BCL 230 .globl _EP0BCH 231 .globl _FNADDR 232 .globl _MICROFRAME 233 .globl _USBFRAMEL 234 .globl _USBFRAMEH 235 .globl _TOGCTL 236 .globl _WAKEUPCS 237 .globl _SUSPEND 238 .globl _USBCS 239 .globl _XAUTODAT2 240 .globl _XAUTODAT1 241 .globl _I2CTL 242 .globl _I2DAT 243 .globl _I2CS 244 .globl _PORTECFG 245 .globl _PORTCCFG 246 .globl _PORTACFG 247 .globl _INTSETUP 248 .globl _INT4IVEC 249 .globl _INT2IVEC 250 .globl _CLRERRCNT 251 .globl _ERRCNTLIM 252 .globl _USBERRIRQ 253 .globl _USBERRIE 254 .globl _GPIFIRQ 255 .globl _GPIFIE 256 .globl _EPIRQ 257 .globl _EPIE 258 .globl _USBIRQ 259 .globl _USBIE 260 .globl _NAKIRQ 261 .globl _NAKIE 262 .globl _IBNIRQ 263 .globl _IBNIE 264 .globl _EP8FIFOIRQ 265 .globl _EP8FIFOIE 266 .globl _EP6FIFOIRQ 267 .globl _EP6FIFOIE 268 .globl _EP4FIFOIRQ 269 .globl _EP4FIFOIE 270 .globl _EP2FIFOIRQ 271 .globl _EP2FIFOIE 272 .globl _OUTPKTEND 273 .globl _INPKTEND 274 .globl _EP8ISOINPKTS 275 .globl _EP6ISOINPKTS 276 .globl _EP4ISOINPKTS 277 .globl _EP2ISOINPKTS 278 .globl _EP8FIFOPFL 279 .globl _EP8FIFOPFH 280 .globl _EP6FIFOPFL 281 .globl _EP6FIFOPFH 282 .globl _EP4FIFOPFL 283 .globl _EP4FIFOPFH 284 .globl _EP2FIFOPFL 285 .globl _EP2FIFOPFH 286 .globl _EP8AUTOINLENL 287 .globl _EP8AUTOINLENH 288 .globl _EP6AUTOINLENL 289 .globl _EP6AUTOINLENH 290 .globl _EP4AUTOINLENL 291 .globl _EP4AUTOINLENH 292 .globl _EP2AUTOINLENL 293 .globl _EP2AUTOINLENH 294 .globl _EP8FIFOCFG 295 .globl _EP6FIFOCFG 296 .globl _EP4FIFOCFG 297 .globl _EP2FIFOCFG 298 .globl _EP8CFG 299 .globl _EP6CFG 300 .globl _EP4CFG 301 .globl _EP2CFG 302 .globl _EP1INCFG 303 .globl _EP1OUTCFG 304 .globl _REVCTL 305 .globl _REVID 306 .globl _FIFOPINPOLAR 307 .globl _UART230 308 .globl _BPADDRL 309 .globl _BPADDRH 310 .globl _BREAKPT 311 .globl _FIFORESET 312 .globl _PINFLAGSCD 313 .globl _PINFLAGSAB 314 .globl _IFCONFIG 315 .globl _CPUCS 316 .globl _RES_WAVEDATA_END 317 .globl _GPIF_WAVE_DATA 318 .globl _fx2_stall_ep0 319 .globl _fx2_reset_data_toggle 320 .globl _fx2_renumerate 321 ;-------------------------------------------------------- 322 ; special function registers 323 ;-------------------------------------------------------- 324 .area RSEG (ABS,DATA) 000000 325 .org 0x0000 000080 326 _IOA = 0x0080 000081 327 _SP = 0x0081 000082 328 _DPL = 0x0082 000083 329 _DPH = 0x0083 000084 330 _DPL1 = 0x0084 000085 331 _DPH1 = 0x0085 000086 332 _DPS = 0x0086 000087 333 _PCON = 0x0087 000088 334 _TCON = 0x0088 000089 335 _TMOD = 0x0089 00008A 336 _TL0 = 0x008a 00008B 337 _TL1 = 0x008b 00008C 338 _TH0 = 0x008c 00008D 339 _TH1 = 0x008d 00008E 340 _CKCON = 0x008e 000090 341 _IOB = 0x0090 000091 342 _EXIF = 0x0091 000092 343 _MPAGE = 0x0092 000098 344 _SCON0 = 0x0098 000099 345 _SBUF0 = 0x0099 00009A 346 _APTR1H = 0x009a 00009B 347 _APTR1L = 0x009b 00009C 348 _AUTODAT1 = 0x009c 00009D 349 _AUTOPTRH2 = 0x009d 00009E 350 _AUTOPTRL2 = 0x009e 00009F 351 _AUTODAT2 = 0x009f 0000A0 352 _IOC = 0x00a0 0000A1 353 _INT2CLR = 0x00a1 0000A2 354 _INT4CLR = 0x00a2 0000A8 355 _IE = 0x00a8 0000AA 356 _EP2468STAT = 0x00aa 0000AB 357 _EP24FIFOFLGS = 0x00ab 0000AC 358 _EP68FIFOFLGS = 0x00ac 0000AF 359 _AUTOPTRSETUP = 0x00af 0000B0 360 _IOD = 0x00b0 0000B1 361 _IOE = 0x00b1 0000B2 362 _OEA = 0x00b2 0000B3 363 _OEB = 0x00b3 0000B4 364 _OEC = 0x00b4 0000B5 365 _OED = 0x00b5 0000B6 366 _OEE = 0x00b6 0000B8 367 _IP = 0x00b8 0000BA 368 _EP01STAT = 0x00ba 0000BB 369 _GPIFTRIG = 0x00bb 0000BD 370 _GPIFSGLDATH = 0x00bd 0000BE 371 _GPIFSGLDATLX = 0x00be 0000BF 372 _GPIFSGLDATLNOX = 0x00bf 0000C0 373 _SCON1 = 0x00c0 0000C1 374 _SBUF1 = 0x00c1 0000C8 375 _T2CON = 0x00c8 0000CA 376 _RCAP2L = 0x00ca 0000CB 377 _RCAP2H = 0x00cb 0000CC 378 _TL2 = 0x00cc 0000CD 379 _TH2 = 0x00cd 0000D0 380 _PSW = 0x00d0 0000D8 381 _EICON = 0x00d8 0000E0 382 _ACC = 0x00e0 0000E8 383 _EIE = 0x00e8 0000F0 384 _B = 0x00f0 0000F8 385 _EIP = 0x00f8 386 ;-------------------------------------------------------- 387 ; special function bits 388 ;-------------------------------------------------------- 389 .area RSEG (ABS,DATA) 000000 390 .org 0x0000 000086 391 _SEL = 0x0086 000088 392 _IT0 = 0x0088 000089 393 _IE0 = 0x0089 00008A 394 _IT1 = 0x008a 00008B 395 _IE1 = 0x008b 00008C 396 _TR0 = 0x008c 00008D 397 _TF0 = 0x008d 00008E 398 _TR1 = 0x008e 00008F 399 _TF1 = 0x008f 000098 400 _RI = 0x0098 000099 401 _TI = 0x0099 00009A 402 _RB8 = 0x009a 00009B 403 _TB8 = 0x009b 00009C 404 _REN = 0x009c 00009D 405 _SM2 = 0x009d 00009E 406 _SM1 = 0x009e 00009F 407 _SM0 = 0x009f 0000A8 408 _EX0 = 0x00a8 0000A9 409 _ET0 = 0x00a9 0000AA 410 _EX1 = 0x00aa 0000AB 411 _ET1 = 0x00ab 0000AC 412 _ES0 = 0x00ac 0000AD 413 _ET2 = 0x00ad 0000AE 414 _ES1 = 0x00ae 0000AF 415 _EA = 0x00af 0000B8 416 _PX0 = 0x00b8 0000B9 417 _PT0 = 0x00b9 0000BA 418 _PX1 = 0x00ba 0000BB 419 _PT1 = 0x00bb 0000BC 420 _PS0 = 0x00bc 0000BD 421 _PT2 = 0x00bd 0000BE 422 _PS1 = 0x00be 0000C0 423 _RI1 = 0x00c0 0000C1 424 _TI1 = 0x00c1 0000C2 425 _RB81 = 0x00c2 0000C3 426 _TB81 = 0x00c3 0000C4 427 _REN1 = 0x00c4 0000C5 428 _SM21 = 0x00c5 0000C6 429 _SM11 = 0x00c6 0000C7 430 _SM01 = 0x00c7 0000C8 431 _CP_RL2 = 0x00c8 0000C9 432 _C_T2 = 0x00c9 0000CA 433 _TR2 = 0x00ca 0000CB 434 _EXEN2 = 0x00cb 0000CC 435 _TCLK = 0x00cc 0000CD 436 _RCLK = 0x00cd 0000CE 437 _EXF2 = 0x00ce 0000CF 438 _TF2 = 0x00cf 0000D0 439 _P = 0x00d0 0000D1 440 _FL = 0x00d1 0000D2 441 _OV = 0x00d2 0000D3 442 _RS0 = 0x00d3 0000D4 443 _RS1 = 0x00d4 0000D5 444 _F0 = 0x00d5 0000D6 445 _AC = 0x00d6 0000D7 446 _CY = 0x00d7 0000DB 447 _INT6 = 0x00db 0000DC 448 _RESI = 0x00dc 0000DD 449 _ERESI = 0x00dd 0000DF 450 _SMOD1 = 0x00df 0000E8 451 _EIUSB = 0x00e8 0000E9 452 _EI2C = 0x00e9 0000EA 453 _EIEX4 = 0x00ea 0000EB 454 _EIEX5 = 0x00eb 0000EC 455 _EIEX6 = 0x00ec 0000F8 456 _PUSB = 0x00f8 0000F9 457 _PI2C = 0x00f9 0000FA 458 _EIPX4 = 0x00fa 0000FB 459 _EIPX5 = 0x00fb 0000FC 460 _EIPX6 = 0x00fc 461 ;-------------------------------------------------------- 462 ; overlayable register banks 463 ;-------------------------------------------------------- 464 .area REG_BANK_0 (REL,OVR,DATA) 000000 465 .ds 8 466 ;-------------------------------------------------------- 467 ; internal ram data 468 ;-------------------------------------------------------- 469 .area DSEG (DATA) 470 ;-------------------------------------------------------- 471 ; overlayable items in internal ram 472 ;-------------------------------------------------------- 473 .area OSEG (OVR,DATA) 474 ;-------------------------------------------------------- 475 ; indirectly addressable internal ram data 476 ;-------------------------------------------------------- 477 .area ISEG (DATA) 478 ;-------------------------------------------------------- 479 ; absolute internal ram data 480 ;-------------------------------------------------------- 481 .area IABS (ABS,DATA) 482 .area IABS (ABS,DATA) 483 ;-------------------------------------------------------- 484 ; bit data 485 ;-------------------------------------------------------- 486 .area BSEG (BIT) 487 ;-------------------------------------------------------- 488 ; paged external ram data 489 ;-------------------------------------------------------- 490 .area PSEG (PAG,XDATA) 491 ;-------------------------------------------------------- 492 ; external ram data 493 ;-------------------------------------------------------- 494 .area XSEG (XDATA) 00E400 495 _GPIF_WAVE_DATA = 0xe400 00E480 496 _RES_WAVEDATA_END = 0xe480 00E600 497 _CPUCS = 0xe600 00E601 498 _IFCONFIG = 0xe601 00E602 499 _PINFLAGSAB = 0xe602 00E603 500 _PINFLAGSCD = 0xe603 00E604 501 _FIFORESET = 0xe604 00E605 502 _BREAKPT = 0xe605 00E606 503 _BPADDRH = 0xe606 00E607 504 _BPADDRL = 0xe607 00E608 505 _UART230 = 0xe608 00E609 506 _FIFOPINPOLAR = 0xe609 00E60A 507 _REVID = 0xe60a 00E60B 508 _REVCTL = 0xe60b 00E610 509 _EP1OUTCFG = 0xe610 00E611 510 _EP1INCFG = 0xe611 00E612 511 _EP2CFG = 0xe612 00E613 512 _EP4CFG = 0xe613 00E614 513 _EP6CFG = 0xe614 00E615 514 _EP8CFG = 0xe615 00E618 515 _EP2FIFOCFG = 0xe618 00E619 516 _EP4FIFOCFG = 0xe619 00E61A 517 _EP6FIFOCFG = 0xe61a 00E61B 518 _EP8FIFOCFG = 0xe61b 00E620 519 _EP2AUTOINLENH = 0xe620 00E621 520 _EP2AUTOINLENL = 0xe621 00E622 521 _EP4AUTOINLENH = 0xe622 00E623 522 _EP4AUTOINLENL = 0xe623 00E624 523 _EP6AUTOINLENH = 0xe624 00E625 524 _EP6AUTOINLENL = 0xe625 00E626 525 _EP8AUTOINLENH = 0xe626 00E627 526 _EP8AUTOINLENL = 0xe627 00E630 527 _EP2FIFOPFH = 0xe630 00E631 528 _EP2FIFOPFL = 0xe631 00E632 529 _EP4FIFOPFH = 0xe632 00E633 530 _EP4FIFOPFL = 0xe633 00E634 531 _EP6FIFOPFH = 0xe634 00E635 532 _EP6FIFOPFL = 0xe635 00E636 533 _EP8FIFOPFH = 0xe636 00E637 534 _EP8FIFOPFL = 0xe637 00E640 535 _EP2ISOINPKTS = 0xe640 00E641 536 _EP4ISOINPKTS = 0xe641 00E642 537 _EP6ISOINPKTS = 0xe642 00E643 538 _EP8ISOINPKTS = 0xe643 00E648 539 _INPKTEND = 0xe648 00E649 540 _OUTPKTEND = 0xe649 00E650 541 _EP2FIFOIE = 0xe650 00E651 542 _EP2FIFOIRQ = 0xe651 00E652 543 _EP4FIFOIE = 0xe652 00E653 544 _EP4FIFOIRQ = 0xe653 00E654 545 _EP6FIFOIE = 0xe654 00E655 546 _EP6FIFOIRQ = 0xe655 00E656 547 _EP8FIFOIE = 0xe656 00E657 548 _EP8FIFOIRQ = 0xe657 00E658 549 _IBNIE = 0xe658 00E659 550 _IBNIRQ = 0xe659 00E65A 551 _NAKIE = 0xe65a 00E65B 552 _NAKIRQ = 0xe65b 00E65C 553 _USBIE = 0xe65c 00E65D 554 _USBIRQ = 0xe65d 00E65E 555 _EPIE = 0xe65e 00E65F 556 _EPIRQ = 0xe65f 00E660 557 _GPIFIE = 0xe660 00E661 558 _GPIFIRQ = 0xe661 00E662 559 _USBERRIE = 0xe662 00E663 560 _USBERRIRQ = 0xe663 00E664 561 _ERRCNTLIM = 0xe664 00E665 562 _CLRERRCNT = 0xe665 00E666 563 _INT2IVEC = 0xe666 00E667 564 _INT4IVEC = 0xe667 00E668 565 _INTSETUP = 0xe668 00E670 566 _PORTACFG = 0xe670 00E671 567 _PORTCCFG = 0xe671 00E672 568 _PORTECFG = 0xe672 00E678 569 _I2CS = 0xe678 00E679 570 _I2DAT = 0xe679 00E67A 571 _I2CTL = 0xe67a 00E67B 572 _XAUTODAT1 = 0xe67b 00E67C 573 _XAUTODAT2 = 0xe67c 00E680 574 _USBCS = 0xe680 00E681 575 _SUSPEND = 0xe681 00E682 576 _WAKEUPCS = 0xe682 00E683 577 _TOGCTL = 0xe683 00E684 578 _USBFRAMEH = 0xe684 00E685 579 _USBFRAMEL = 0xe685 00E686 580 _MICROFRAME = 0xe686 00E687 581 _FNADDR = 0xe687 00E68A 582 _EP0BCH = 0xe68a 00E68B 583 _EP0BCL = 0xe68b 00E68D 584 _EP1OUTBC = 0xe68d 00E68F 585 _EP1INBC = 0xe68f 00E690 586 _EP2BCH = 0xe690 00E691 587 _EP2BCL = 0xe691 00E694 588 _EP4BCH = 0xe694 00E695 589 _EP4BCL = 0xe695 00E698 590 _EP6BCH = 0xe698 00E699 591 _EP6BCL = 0xe699 00E69C 592 _EP8BCH = 0xe69c 00E69D 593 _EP8BCL = 0xe69d 00E6A0 594 _EP0CS = 0xe6a0 00E6A1 595 _EP1OUTCS = 0xe6a1 00E6A2 596 _EP1INCS = 0xe6a2 00E6A3 597 _EP2CS = 0xe6a3 00E6A4 598 _EP4CS = 0xe6a4 00E6A5 599 _EP6CS = 0xe6a5 00E6A6 600 _EP8CS = 0xe6a6 00E6A7 601 _EP2FIFOFLGS = 0xe6a7 00E6A8 602 _EP4FIFOFLGS = 0xe6a8 00E6A9 603 _EP6FIFOFLGS = 0xe6a9 00E6AA 604 _EP8FIFOFLGS = 0xe6aa 00E6AB 605 _EP2FIFOBCH = 0xe6ab 00E6AC 606 _EP2FIFOBCL = 0xe6ac 00E6AD 607 _EP4FIFOBCH = 0xe6ad 00E6AE 608 _EP4FIFOBCL = 0xe6ae 00E6AF 609 _EP6FIFOBCH = 0xe6af 00E6B0 610 _EP6FIFOBCL = 0xe6b0 00E6B1 611 _EP8FIFOBCH = 0xe6b1 00E6B2 612 _EP8FIFOBCL = 0xe6b2 00E6B3 613 _SUDPTRH = 0xe6b3 00E6B4 614 _SUDPTRL = 0xe6b4 00E6B5 615 _SUDPTRCTL = 0xe6b5 00E6B8 616 _SETUPDAT = 0xe6b8 00E6C0 617 _GPIFWFSELECT = 0xe6c0 00E6C1 618 _GPIFIDLECS = 0xe6c1 00E6C2 619 _GPIFIDLECTL = 0xe6c2 00E6C3 620 _GPIFCTLCFG = 0xe6c3 00E6C4 621 _GPIFADRH = 0xe6c4 00E6C5 622 _GPIFADRL = 0xe6c5 00E6CE 623 _GPIFTCB3 = 0xe6ce 00E6CF 624 _GPIFTCB2 = 0xe6cf 00E6D0 625 _GPIFTCB1 = 0xe6d0 00E6D1 626 _GPIFTCB0 = 0xe6d1 00E6D2 627 _EP2GPIFFLGSEL = 0xe6d2 00E6D3 628 _EP2GPIFPFSTOP = 0xe6d3 00E6D4 629 _EP2GPIFTRIG = 0xe6d4 00E6DA 630 _EP4GPIFFLGSEL = 0xe6da 00E6DB 631 _EP4GPIFPFSTOP = 0xe6db 00E6DC 632 _EP4GPIFTRIG = 0xe6dc 00E6E2 633 _EP6GPIFFLGSEL = 0xe6e2 00E6E3 634 _EP6GPIFPFSTOP = 0xe6e3 00E6E4 635 _EP6GPIFTRIG = 0xe6e4 00E6EA 636 _EP8GPIFFLGSEL = 0xe6ea 00E6EB 637 _EP8GPIFPFSTOP = 0xe6eb 00E6EC 638 _EP8GPIFTRIG = 0xe6ec 00E6F0 639 _XGPIFSGLDATH = 0xe6f0 00E6F1 640 _XGPIFSGLDATLX = 0xe6f1 00E6F2 641 _XGPIFSGLDATLNOX = 0xe6f2 00E6F3 642 _GPIFREADYCFG = 0xe6f3 00E6F4 643 _GPIFREADYSTAT = 0xe6f4 00E6F5 644 _GPIFABORT = 0xe6f5 00E6C6 645 _FLOWSTATE = 0xe6c6 00E6C7 646 _FLOWLOGIC = 0xe6c7 00E6C8 647 _FLOWEQ0CTL = 0xe6c8 00E6C9 648 _FLOWEQ1CTL = 0xe6c9 00E6CA 649 _FLOWHOLDOFF = 0xe6ca 00E6CB 650 _FLOWSTB = 0xe6cb 00E6CC 651 _FLOWSTBEDGE = 0xe6cc 00E6CD 652 _FLOWSTBHPERIOD = 0xe6cd 00E60C 653 _GPIFHOLDAMOUNT = 0xe60c 00E67D 654 _UDMACRCH = 0xe67d 00E67E 655 _UDMACRCL = 0xe67e 00E67F 656 _UDMACRCQUAL = 0xe67f 00E6F8 657 _DBUG = 0xe6f8 00E6F9 658 _TESTCFG = 0xe6f9 00E6FA 659 _USBTEST = 0xe6fa 00E6FB 660 _CT1 = 0xe6fb 00E6FC 661 _CT2 = 0xe6fc 00E6FD 662 _CT3 = 0xe6fd 00E6FE 663 _CT4 = 0xe6fe 00E740 664 _EP0BUF = 0xe740 00E780 665 _EP1OUTBUF = 0xe780 00E7C0 666 _EP1INBUF = 0xe7c0 00F000 667 _EP2FIFOBUF = 0xf000 00F400 668 _EP4FIFOBUF = 0xf400 00F800 669 _EP6FIFOBUF = 0xf800 00FC00 670 _EP8FIFOBUF = 0xfc00 671 ;-------------------------------------------------------- 672 ; absolute external ram data 673 ;-------------------------------------------------------- 674 .area XABS (ABS,XDATA) 675 ;-------------------------------------------------------- 676 ; external initialized ram data 677 ;-------------------------------------------------------- 678 .area HOME (CODE) 679 .area GSINIT0 (CODE) 680 .area GSINIT1 (CODE) 681 .area GSINIT2 (CODE) 682 .area GSINIT3 (CODE) 683 .area GSINIT4 (CODE) 684 .area GSINIT5 (CODE) 685 .area GSINIT (CODE) 686 .area GSFINAL (CODE) 687 .area CSEG (CODE) 688 ;-------------------------------------------------------- 689 ; global & static initialisations 690 ;-------------------------------------------------------- 691 .area HOME (CODE) 692 .area GSINIT (CODE) 693 .area GSFINAL (CODE) 694 .area GSINIT (CODE) 695 ;-------------------------------------------------------- 696 ; Home 697 ;-------------------------------------------------------- 698 .area HOME (CODE) 699 .area HOME (CODE) 700 ;-------------------------------------------------------- 701 ; code 702 ;-------------------------------------------------------- 703 .area CSEG (CODE) 704 ;------------------------------------------------------------ 705 ;Allocation info for local variables in function 'fx2_stall_ep0' 706 ;------------------------------------------------------------ 707 ; fx2utils.c:28: fx2_stall_ep0 (void) 708 ; ----------------------------------------- 709 ; function fx2_stall_ep0 710 ; ----------------------------------------- 000000 711 _fx2_stall_ep0: 000007 712 ar7 = 0x07 000006 713 ar6 = 0x06 000005 714 ar5 = 0x05 000004 715 ar4 = 0x04 000003 716 ar3 = 0x03 000002 717 ar2 = 0x02 000001 718 ar1 = 0x01 000000 719 ar0 = 0x00 720 ; fx2utils.c:30: EP0CS |= bmEPSTALL; 000000 90 E6 A0 [24] 721 mov dptr,#_EP0CS 000003 E0 [24] 722 movx a,@dptr 000004 43 E0 01 [24] 723 orl acc,#0x01 000007 F0 [24] 724 movx @dptr,a 725 ; fx2utils.c:31: } 000008 22 [24] 726 ret 727 ;------------------------------------------------------------ 728 ;Allocation info for local variables in function 'fx2_reset_data_toggle' 729 ;------------------------------------------------------------ 730 ;ep Allocated to registers r7 731 ;------------------------------------------------------------ 732 ; fx2utils.c:34: fx2_reset_data_toggle (unsigned char ep) 733 ; ----------------------------------------- 734 ; function fx2_reset_data_toggle 735 ; ----------------------------------------- 000009 736 _fx2_reset_data_toggle: 000009 AF 82 [24] 737 mov r7,dpl 738 ; fx2utils.c:36: TOGCTL = ((ep & 0x80) >> 3 | (ep & 0x0f)); 00000B 8F 05 [24] 739 mov ar5,r7 00000D 53 05 80 [24] 740 anl ar5,#0x80 000010 E4 [12] 741 clr a 000011 C4 [12] 742 swap a 000012 23 [12] 743 rl a 000013 CD [12] 744 xch a,r5 000014 C4 [12] 745 swap a 000015 23 [12] 746 rl a 000016 54 1F [12] 747 anl a,#0x1f 000018 6D [12] 748 xrl a,r5 000019 CD [12] 749 xch a,r5 00001A 54 1F [12] 750 anl a,#0x1f 00001C CD [12] 751 xch a,r5 00001D 6D [12] 752 xrl a,r5 00001E CD [12] 753 xch a,r5 00001F 30 E4 02 [24] 754 jnb acc.4,00103$ 000022 44 E0 [12] 755 orl a,#0xe0 000024 756 00103$: 000024 53 07 0F [24] 757 anl ar7,#0x0f 000027 90 E6 83 [24] 758 mov dptr,#_TOGCTL 00002A EF [12] 759 mov a,r7 00002B 4D [12] 760 orl a,r5 00002C F0 [24] 761 movx @dptr,a 762 ; fx2utils.c:37: TOGCTL |= bmRESETTOGGLE; 00002D E0 [24] 763 movx a,@dptr 00002E 43 E0 20 [24] 764 orl acc,#0x20 000031 F0 [24] 765 movx @dptr,a 766 ; fx2utils.c:38: } 000032 22 [24] 767 ret 768 ;------------------------------------------------------------ 769 ;Allocation info for local variables in function 'fx2_renumerate' 770 ;------------------------------------------------------------ 771 ; fx2utils.c:41: fx2_renumerate (void) 772 ; ----------------------------------------- 773 ; function fx2_renumerate 774 ; ----------------------------------------- 000033 775 _fx2_renumerate: 776 ; fx2utils.c:43: USBCS |= bmDISCON | bmRENUM; 000033 90 E6 80 [24] 777 mov dptr,#_USBCS 000036 E0 [24] 778 movx a,@dptr 000037 43 E0 0A [24] 779 orl acc,#0x0a 00003A F0 [24] 780 movx @dptr,a 781 ; fx2utils.c:46: mdelay (250); // FIXME why 1.5 seconds? 00003B 90 00 FA [24] 782 mov dptr,#0x00fa 00003E 12r00r00 [24] 783 lcall _mdelay 784 ; fx2utils.c:48: USBIRQ = 0xff; // clear any pending USB irqs... 000041 90 E6 5D [24] 785 mov dptr,#_USBIRQ 000044 74 FF [12] 786 mov a,#0xff 000046 F0 [24] 787 movx @dptr,a 788 ; fx2utils.c:49: EPIRQ = 0xff; // they're from before the renumeration 000047 90 E6 5F [24] 789 mov dptr,#_EPIRQ 00004A F0 [24] 790 movx @dptr,a 791 ; fx2utils.c:51: EXIF &= ~bmEXIF_USBINT; 00004B 53 91 EF [24] 792 anl _EXIF,#0xef 793 ; fx2utils.c:53: USBCS &= ~bmDISCON; // reconnect USB 00004E 90 E6 80 [24] 794 mov dptr,#_USBCS 000051 E0 [24] 795 movx a,@dptr 000052 53 E0 F7 [24] 796 anl acc,#0xf7 000055 F0 [24] 797 movx @dptr,a 798 ; fx2utils.c:54: } 000056 22 [24] 799 ret 800 .area CSEG (CODE) 801 .area CONST (CODE) 802 .area CABS (ABS,CODE)