                              1 	.module main
                              2 
                              3 	;; ENDPOINTS
                              4 	;; EP0 in/out   Control
                              5 	;; EP1 in       Interrupt:  Status
                              6 	;;              Byte 0: Modem Status
                              7 	;;                Bit 0-1: Transmitter status
                              8 	;;                         0: idle (off)
                              9 	;;                         1: keyup
                             10 	;;                         2: transmitting packets
                             11 	;;                         3: tail
                             12 	;;                Bit 2:   PTT status (1=on)
                             13 	;;                Bit 3:   DCD
                             14 	;;                Bit 5:   UART transmitter empty
                             15 	;;                Bit 6-7: unused
                             16 	;;              Byte 1: Number of empty 64 byte chunks in TX fifo (sofcount)
                             17 	;;              Byte 2: Number of full 64 byte chunks in RX fifo (INISOVAL)
                             18 	;;              Byte 3: RSSI value
                             19 	;;              Byte 4:	IRQ count
                             20 	;;              Byte 5-20: (as needed) UART receiver chars
                             21 	;; EP8 out      audio output
                             22 	;; EP8 in       audio input
                             23 
                             24 	;; COMMAND LIST
                             25 	;; C0 C0  read status (max. 23 bytes, first 6 same as EP1 in)
                             26 	;; C0 C8  read mode
                             27 	;;          Return:
                             28 	;;            Byte 0: 4 (MODE_AUDIO)
                             29 	;; C0 C9  return serial number string
                             30 	;; C0 D0  get/set PTT/DCD/RSSI
                             31 	;;          wIndex = 1:	set forced ptt to wValue
                             32 	;;          Return:
                             33 	;;            Byte 0: PTT status
                             34 	;;            Byte 1: DCD status
                             35 	;;            Byte 2: RSSI status
                             36 	;; 40 D2  set CON/STA led
                             37 	;;          Bits 0-1 of wValue
                             38 	;; 40 D3  send byte to UART
                             39 	;;          Byte in wValue
                             40 	;; C0 D4  get/set modem disconnect port (only if internal modem used, stalls otherwise)
                             41 	;;          wIndex = 1:	write wValue to output register
                             42 	;;          wIndex = 2:	write wValue to tristate mask register (1 = input, 0 = output)
                             43 	;;          Return:
                             44 	;;            Byte 0: Modem Disconnect Input
                             45 	;;            Byte 1: Modem Disconnect Output register
                             46 	;;            Byte 2: Modem Disconnect Tristate register
                             47 	;; C0 D5  get/set T7F port
                             48 	;;          wIndex = 1:	write wValue to T7F output register
                             49 	;;          Return:
                             50 	;;            Byte 0: T7F Input
                             51 	;;            Byte 1: T7F Output register
                             52 	;; C0 E0  get/set control register/counter values
                             53 	;;          wIndex = 1:	write wValue to control register
                             54 	;;          Return:
                             55 	;;            Byte 0: control register value
                             56 	;;            Byte 1-3: counter0 register
                             57 	;;            Byte 4-6: counter1 register
                             58 	;; C0 E1  get debug status
                             59 	;;          Return:
                             60 	;;            Byte 0: SOF count
                             61 	;;            Byte 1: framesize
                             62 	;;            Byte 2-3: divider
                             63 	;;            Byte 4: divrel
                             64 	;;            Byte 5: pllcorrvar
                             65 	;;            Byte 6: txfifocount
                             66 	;; C0 E2  xxdebug stuff
                             67 	
                             68 	;; define code segments link order
                             69 	.area CODE (CODE)
                             70 	.area CSEG (CODE)
                             71 	.area GSINIT (CODE)
                             72 	.area GSINIT2 (CODE)
                             73 
                             74 	;; -----------------------------------------------------
                             75 
                             76 	;; special function registers (which are not predefined)
                    0082     77 	dpl0    = 0x82
                    0083     78 	dph0    = 0x83
                    0084     79 	dpl1    = 0x84
                    0085     80 	dph1    = 0x85
                    0086     81 	dps     = 0x86
                    008E     82 	ckcon   = 0x8E
                    008F     83 	spc_fnc = 0x8F
                    0091     84 	exif    = 0x91
                    0092     85 	mpage   = 0x92
                    0098     86 	scon0   = 0x98
                    0099     87 	sbuf0   = 0x99
                    00C0     88 	scon1   = 0xC0
                    00C1     89 	sbuf1   = 0xC1
                    00D8     90 	eicon   = 0xD8
                    00E8     91 	eie     = 0xE8
                    00F8     92 	eip     = 0xF8
                             93 
                             94 	;; anchor xdata registers
                    7F00     95 	IN0BUF		= 0x7F00
                    7EC0     96 	OUT0BUF		= 0x7EC0
                    7E80     97 	IN1BUF		= 0x7E80
                    7E40     98 	OUT1BUF		= 0x7E40
                    7E00     99 	IN2BUF		= 0x7E00
                    7DC0    100 	OUT2BUF		= 0x7DC0
                    7D80    101 	IN3BUF		= 0x7D80
                    7D40    102 	OUT3BUF		= 0x7D40
                    7D00    103 	IN4BUF		= 0x7D00
                    7CC0    104 	OUT4BUF		= 0x7CC0
                    7C80    105 	IN5BUF		= 0x7C80
                    7C40    106 	OUT5BUF		= 0x7C40
                    7C00    107 	IN6BUF		= 0x7C00
                    7BC0    108 	OUT6BUF		= 0x7BC0
                    7B80    109 	IN7BUF		= 0x7B80
                    7B40    110 	OUT7BUF		= 0x7B40
                    7FE8    111 	SETUPBUF	= 0x7FE8
                    7FE8    112 	SETUPDAT	= 0x7FE8
                            113 
                    7FB4    114 	EP0CS		= 0x7FB4
                    7FB5    115 	IN0BC		= 0x7FB5
                    7FB6    116 	IN1CS		= 0x7FB6
                    7FB7    117 	IN1BC		= 0x7FB7
                    7FB8    118 	IN2CS		= 0x7FB8
                    7FB9    119 	IN2BC		= 0x7FB9
                    7FBA    120 	IN3CS		= 0x7FBA
                    7FBB    121 	IN3BC		= 0x7FBB
                    7FBC    122 	IN4CS		= 0x7FBC
                    7FBD    123 	IN4BC		= 0x7FBD
                    7FBE    124 	IN5CS		= 0x7FBE
                    7FBF    125 	IN5BC		= 0x7FBF
                    7FC0    126 	IN6CS		= 0x7FC0
                    7FC1    127 	IN6BC		= 0x7FC1
                    7FC2    128 	IN7CS		= 0x7FC2
                    7FC3    129 	IN7BC		= 0x7FC3
                    7FC5    130 	OUT0BC		= 0x7FC5
                    7FC6    131 	OUT1CS		= 0x7FC6
                    7FC7    132 	OUT1BC		= 0x7FC7
                    7FC8    133 	OUT2CS		= 0x7FC8
                    7FC9    134 	OUT2BC		= 0x7FC9
                    7FCA    135 	OUT3CS		= 0x7FCA
                    7FCB    136 	OUT3BC		= 0x7FCB
                    7FCC    137 	OUT4CS		= 0x7FCC
                    7FCD    138 	OUT4BC		= 0x7FCD
                    7FCE    139 	OUT5CS		= 0x7FCE
                    7FCF    140 	OUT5BC		= 0x7FCF
                    7FD0    141 	OUT6CS		= 0x7FD0
                    7FD1    142 	OUT6BC		= 0x7FD1
                    7FD2    143 	OUT7CS		= 0x7FD2
                    7FD3    144 	OUT7BC		= 0x7FD3
                            145 
                    7FA8    146 	IVEC		= 0x7FA8
                    7FA9    147 	IN07IRQ		= 0x7FA9
                    7FAA    148 	OUT07IRQ	= 0x7FAA
                    7FAB    149 	USBIRQ		= 0x7FAB
                    7FAC    150 	IN07IEN		= 0x7FAC
                    7FAD    151 	OUT07IEN	= 0x7FAD
                    7FAE    152 	USBIEN		= 0x7FAE
                    7FAF    153 	USBBAV		= 0x7FAF
                    7FB2    154 	BPADDRH		= 0x7FB2
                    7FB3    155 	BPADDRL		= 0x7FB3
                            156 
                    7FD4    157 	SUDPTRH		= 0x7FD4
                    7FD5    158 	SUDPTRL		= 0x7FD5
                    7FD6    159 	USBCS		= 0x7FD6
                    7FD7    160 	TOGCTL		= 0x7FD7
                    7FD8    161 	USBFRAMEL	= 0x7FD8
                    7FD9    162 	USBFRAMEH	= 0x7FD9
                    7FDB    163 	FNADDR		= 0x7FDB
                    7FDD    164 	USBPAIR		= 0x7FDD
                    7FDE    165 	IN07VAL		= 0x7FDE
                    7FDF    166 	OUT07VAL	= 0x7FDF
                    7FE3    167 	AUTOPTRH	= 0x7FE3
                    7FE4    168 	AUTOPTRL	= 0x7FE4
                    7FE5    169 	AUTODATA	= 0x7FE5
                            170 
                            171 	;; isochronous endpoints. only available if ISODISAB=0
                            172 
                    7F60    173 	OUT8DATA	= 0x7F60
                    7F61    174 	OUT9DATA	= 0x7F61
                    7F62    175 	OUT10DATA	= 0x7F62
                    7F63    176 	OUT11DATA	= 0x7F63
                    7F64    177 	OUT12DATA	= 0x7F64
                    7F65    178 	OUT13DATA	= 0x7F65
                    7F66    179 	OUT14DATA	= 0x7F66
                    7F67    180 	OUT15DATA	= 0x7F67
                            181 
                    7F68    182 	IN8DATA		= 0x7F68
                    7F69    183 	IN9DATA		= 0x7F69
                    7F6A    184 	IN10DATA	= 0x7F6A
                    7F6B    185 	IN11DATA	= 0x7F6B
                    7F6C    186 	IN12DATA	= 0x7F6C
                    7F6D    187 	IN13DATA	= 0x7F6D
                    7F6E    188 	IN14DATA	= 0x7F6E
                    7F6F    189 	IN15DATA	= 0x7F6F
                            190 
                    7F70    191 	OUT8BCH		= 0x7F70
                    7F71    192 	OUT8BCL		= 0x7F71
                    7F72    193 	OUT9BCH		= 0x7F72
                    7F73    194 	OUT9BCL		= 0x7F73
                    7F74    195 	OUT10BCH	= 0x7F74
                    7F75    196 	OUT10BCL	= 0x7F75
                    7F76    197 	OUT11BCH	= 0x7F76
                    7F77    198 	OUT11BCL	= 0x7F77
                    7F78    199 	OUT12BCH	= 0x7F78
                    7F79    200 	OUT12BCL	= 0x7F79
                    7F7A    201 	OUT13BCH	= 0x7F7A
                    7F7B    202 	OUT13BCL	= 0x7F7B
                    7F7C    203 	OUT14BCH	= 0x7F7C
                    7F7D    204 	OUT14BCL	= 0x7F7D
                    7F7E    205 	OUT15BCH	= 0x7F7E
                    7F7F    206 	OUT15BCL	= 0x7F7F
                            207 
                    7FF0    208 	OUT8ADDR	= 0x7FF0
                    7FF1    209 	OUT9ADDR	= 0x7FF1
                    7FF2    210 	OUT10ADDR	= 0x7FF2
                    7FF3    211 	OUT11ADDR	= 0x7FF3
                    7FF4    212 	OUT12ADDR	= 0x7FF4
                    7FF5    213 	OUT13ADDR	= 0x7FF5
                    7FF6    214 	OUT14ADDR	= 0x7FF6
                    7FF7    215 	OUT15ADDR	= 0x7FF7
                    7FF8    216 	IN8ADDR		= 0x7FF8
                    7FF9    217 	IN9ADDR		= 0x7FF9
                    7FFA    218 	IN10ADDR	= 0x7FFA
                    7FFB    219 	IN11ADDR	= 0x7FFB
                    7FFC    220 	IN12ADDR	= 0x7FFC
                    7FFD    221 	IN13ADDR	= 0x7FFD
                    7FFE    222 	IN14ADDR	= 0x7FFE
                    7FFF    223 	IN15ADDR	= 0x7FFF
                            224 
                    7FA0    225 	ISOERR		= 0x7FA0
                    7FA1    226 	ISOCTL		= 0x7FA1
                    7FA2    227 	ZBCOUNT		= 0x7FA2
                    7FE0    228 	INISOVAL	= 0x7FE0
                    7FE1    229 	OUTISOVAL	= 0x7FE1
                    7FE2    230 	FASTXFR		= 0x7FE2
                            231 
                            232 	;; CPU control registers
                            233 
                    7F92    234 	CPUCS		= 0x7F92
                            235 
                            236 	;; IO port control registers
                            237 
                    7F93    238 	PORTACFG	= 0x7F93
                    7F94    239 	PORTBCFG	= 0x7F94
                    7F95    240 	PORTCCFG	= 0x7F95
                    7F96    241 	OUTA		= 0x7F96
                    7F97    242 	OUTB		= 0x7F97
                    7F98    243 	OUTC		= 0x7F98
                    7F99    244 	PINSA		= 0x7F99
                    7F9A    245 	PINSB		= 0x7F9A
                    7F9B    246 	PINSC		= 0x7F9B
                    7F9C    247 	OEA		= 0x7F9C
                    7F9D    248 	OEB		= 0x7F9D
                    7F9E    249 	OEC		= 0x7F9E
                            250 
                            251 	;; I2C controller registers
                            252 
                    7FA5    253 	I2CS		= 0x7FA5
                    7FA6    254 	I2DAT		= 0x7FA6
                            255 
                            256 	;; Xilinx FPGA registers
                    C000    257 	AUDIORXFIFO	= 0xc000
                    C000    258 	AUDIOTXFIFO	= 0xc000
                    C001    259 	AUDIORXFIFOCNT	= 0xc001
                    C002    260 	AUDIOTXFIFOCNT	= 0xc002
                    C001    261 	AUDIODIVIDERLO	= 0xc001
                    C002    262 	AUDIODIVIDERHI	= 0xc002
                    C004    263 	AUDIORSSI	= 0xc004
                    C005    264 	AUDIOCNTLOW	= 0xc005
                    C006    265 	AUDIOCNTMID	= 0xc006
                    C007    266 	AUDIOCNTHIGH	= 0xc007
                    C008    267 	AUDIOCTRL	= 0xc008
                    C009    268 	AUDIOSTAT	= 0xc009
                    C00A    269 	AUDIOT7FOUT	= 0xc00a
                    C00B    270 	AUDIOT7FIN	= 0xc00b
                    C00C    271 	AUDIOMDISCTRIS	= 0xc00c
                    C00D    272 	AUDIOMDISCOUT	= 0xc00d
                    C00E    273 	AUDIOMDISCIN	= 0xc00e
                            274 
                    0001    275 	AUDIOCTRLPTT	= 0x01
                    0002    276 	AUDIOCTRLMUTE	= 0x02
                    0004    277 	AUDIOCTRLLEDPTT	= 0x04
                    0008    278 	AUDIOCTRLLEDDCD	= 0x08
                    0000    279 	AUDIOCTRLCNTRES	= 0x00
                    0010    280 	AUDIOCTRLCNTDIS	= 0x10
                    0040    281 	AUDIOCTRLCNTCK0	= 0x40
                    0050    282 	AUDIOCTRLCNTCK1	= 0x50
                    0060    283 	AUDIOCTRLCNTCK2	= 0x60
                    0070    284 	AUDIOCTRLCNTCK3	= 0x70
                    0080    285 	AUDIOCTRLCNTRD1	= 0x80
                            286 
                            287 	;; -----------------------------------------------------
                            288 
                            289 	.area CODE (CODE)
   0000 02s00r00            290 	ljmp	startup
   0003 02s00r16            291 	ljmp	int0_isr
   0006                     292 	.ds	5
   000B 02s00r37            293 	ljmp	timer0_isr
   000E                     294 	.ds	5
   0013 02s00r58            295 	ljmp	int1_isr
   0016                     296 	.ds	5
   001B 02s00r79            297 	ljmp	timer1_isr
   001E                     298 	.ds	5
   0023 02s00r9A            299 	ljmp	ser0_isr
   0026                     300 	.ds	5
   002B 02s00rD8            301 	ljmp	timer2_isr
   002E                     302 	.ds	5
   0033 02s00rF9            303 	ljmp	resume_isr
   0036                     304 	.ds	5
   003B 02s01r1A            305 	ljmp	ser1_isr
   003E                     306 	.ds	5
   0043 02s01r00            307 	ljmp	usb_isr
   0046                     308 	.ds	5
   004B 02s01r3D            309 	ljmp	i2c_isr
   004E                     310 	.ds	5
   0053 02s01r62            311 	ljmp	int4_isr
   0056                     312 	.ds	5
   005B 02s01r87            313 	ljmp	int5_isr
   005E                     314 	.ds	5
   0063 02s01rAC            315 	ljmp	int6_isr
                            316 	
                            317 	;; Parameter block at 0xe0
   0066                     318 	.ds	0x7a
   00E0 08                  319 parframesize:	.db	8
   00E1 01                  320 parpttmute:	.db	1
                            321 
                            322 	;; Serial# string at 0xf0
   00E2                     323 	.ds	14
   00F0                     324 parserial:
   00F0 30 30 30 30 30 30   325 	.db	'0,'0,'0,'0,'0,'0,'0,'0,0
        30 30 00
   00F9                     326 	.ds	7
                            327 
   0100                     328 usb_isr:
   0100 02s01rCD            329 	ljmp	usb_sudav_isr
   0103                     330 	.ds	1
   0104 02s06r7B            331 	ljmp	usb_sof_isr
   0107                     332 	.ds	1
   0108 02s07rC5            333 	ljmp	usb_sutok_isr
   010B                     334 	.ds	1
   010C 02s07rF0            335 	ljmp	usb_suspend_isr
   010F                     336 	.ds	1
   0110 02s08r1B            337 	ljmp	usb_usbreset_isr
   0113                     338 	.ds	1
   0114 32                  339 	reti
   0115                     340 	.ds	3
   0118 02s08r46            341 	ljmp	usb_ep0in_isr
   011B                     342 	.ds	1
   011C 02s08r81            343 	ljmp	usb_ep0out_isr
   011F                     344 	.ds	1
   0120 02s09r17            345 	ljmp	usb_ep1in_isr
   0123                     346 	.ds	1
   0124 02s09r45            347 	ljmp	usb_ep1out_isr
   0127                     348 	.ds	1
   0128 02s09r70            349 	ljmp	usb_ep2in_isr
   012B                     350 	.ds	1
   012C 02s09r9B            351 	ljmp	usb_ep2out_isr
   012F                     352 	.ds	1
   0130 02s09rC6            353 	ljmp	usb_ep3in_isr
   0133                     354 	.ds	1
   0134 02s09rF1            355 	ljmp	usb_ep3out_isr
   0137                     356 	.ds	1
   0138 02s0Ar1C            357 	ljmp	usb_ep4in_isr
   013B                     358 	.ds	1
   013C 02s0Ar47            359 	ljmp	usb_ep4out_isr
   013F                     360 	.ds	1
   0140 02s0Ar72            361 	ljmp	usb_ep5in_isr
   0143                     362 	.ds	1
   0144 02s0Ar9D            363 	ljmp	usb_ep5out_isr
   0147                     364 	.ds	1
   0148 02s0ArC8            365 	ljmp	usb_ep6in_isr
   014B                     366 	.ds	1
   014C 02s0ArF3            367 	ljmp	usb_ep6out_isr
   014F                     368 	.ds	1
   0150 02s0Br1E            369 	ljmp	usb_ep7in_isr
   0153                     370 	.ds	1
   0154 02s0Br49            371 	ljmp	usb_ep7out_isr
                            372 
                            373 	;; -----------------------------------------------------
                            374 
                    0004    375 	NUMINTERFACES = 4
                            376 	
                            377 	.area	OSEG (OVR,DATA)
                            378 	.area	BSEG (BIT)
   0000                     379 ctrl_ptt:	.ds	1
   0001                     380 ctrl_pttmute:	.ds	1
   0002                     381 ctrl_ledptt:	.ds	1
   0003                     382 ctrl_leddcd:	.ds	1	
   0004                     383 ctrl_cntmode0:	.ds	1
   0005                     384 ctrl_cntmode1:	.ds	1
   0006                     385 ctrl_cntmode2:	.ds	1
   0007                     386 ctrl_cntsel:	.ds	1
                    0020    387 ctrlreg		=	0x20	; ((ctrl_ptt/8)+0x20)
                            388 
   0008                     389 pttmute:	.ds	1
   0009                     390 uartempty:	.ds	1
                            391 
                            392 
                            393 	.area	ISEG (DATA)
   0000                     394 txsamples:	.ds	0x40
   0040                     395 stack:		.ds	0x80-0x40
                            396 
                            397 	.area	DSEG (DATA)
   0000                     398 ctrlcode:	.ds	1
   0001                     399 ctrlcount:	.ds	2
   0003                     400 leddiv:		.ds	1
   0004                     401 irqcount:	.ds	1
   0005                     402 sofcount:	.ds	1
   0006                     403 divider:	.ds	2
   0008                     404 divrel:		.ds	1
   0009                     405 framesize:	.ds	1
   000A                     406 pllcorrvar:	.ds	1
   000B                     407 txfifocount:	.ds	1
   000C                     408 pttforce:	.ds	1
                            409 
                            410 	;; UART receiver
   000D                     411 uartbuf:	.ds	16
   001D                     412 uartwr:		.ds	1
   001E                     413 uartrd:		.ds	1
                            414 
                            415 	;; Port state
   001F                     416 t7fout:		.ds	1
   0020                     417 mdisctris:	.ds	1
   0021                     418 mdiscout:	.ds	1
                            419 	
                            420 	;; USB state
   0022                     421 numconfig:	.ds	1
   0023                     422 altsetting:	.ds	NUMINTERFACES
                            423 
                            424 	.area	XSEG (DATA)
   0000                     425 blah:	.ds	1
                            426 
                            427 
                            428 	.area	GSINIT (CODE)
                    0002    429 	ar2 = 0x02
                    0003    430 	ar3 = 0x03
                    0004    431 	ar4 = 0x04
                    0005    432 	ar5 = 0x05
                    0006    433 	ar6 = 0x06
                    0007    434 	ar7 = 0x07
                    0000    435 	ar0 = 0x00
                    0001    436 	ar1 = 0x01
                            437 
   0000                     438 startup:
   0000 75 81r40            439 	mov	sp,#stack	; -1
   0003 E4                  440 	clr	a
   0004 F5 D0               441 	mov	psw,a
   0006 F5 86               442 	mov	dps,a
                            443 	;lcall	__sdcc_external_startup
                            444 	;mov	a,dpl0
                            445 	;jz	__sdcc_init_data
                            446 	;ljmp	__sdcc_program_startup
   0008                     447 __sdcc_init_data:
                            448 
                            449 	.area	GSINIT2 (CODE)
   0000                     450 __sdcc_program_startup:
                            451 	;; assembler code startup
   0000 E4                  452 	clr	a
   0001 F5*04               453  	mov	irqcount,a
   0003 F5*05               454 	mov	sofcount,a
   0005 F5*0C               455 	mov	pttforce,a
   0007 F5*1E               456 	mov	uartrd,a
   0009 F5*1D               457 	mov	uartwr,a
   000B F5 86               458 	mov	dps,a
   000D D2*09               459 	setb	uartempty
                            460 	;; some indirect register setup
   000F 75 8E 30            461 	mov	ckcon,#0x30	; zero external wait states, to avoid chip bugs
                            462 	;; Timer setup:
                            463 	;; timer 0: LED blink    : T0M=0, CT0=0, MODE0=1
                            464 	;; timer 1: Baudrate gen : T1M=1, CT1=0, MODE1=2
   0012 75 89 21            465 	mov	tmod,#0x21
   0015 75 88 55            466 	mov	tcon,#0x55	; INT0/INT1 edge
   0018 75 8D 64            467 	mov	th1,#256-156	; 1200 bauds
   001B 75 87 00            468 	mov	pcon,#0		; SMOD0=0
                            469 	;; init USB subsystem
   001E 74 00               470 	mov	a,#0x00		; IN8 FIFO at address 0x0000
   0020 90 7F F8            471 	mov	dptr,#IN8ADDR
   0023 F0                  472 	movx	@dptr,a
   0024 74 04               473 	mov	a,#0x04		; OUT8 FIFO at address 0x0010
   0026 90 7F F0            474 	mov	dptr,#OUT8ADDR
   0029 F0                  475 	movx	@dptr,a
   002A 90 7F A1            476 	mov	dptr,#ISOCTL
   002D E4                  477 	clr	a		; enable ISO endpoints
   002E F0                  478 	movx	@dptr,a
   002F 90 7F AF            479 	mov	dptr,#USBBAV
   0032 74 01               480 	mov	a,#1		; enable autovector, disable breakpoint logic
   0034 F0                  481 	movx	@dptr,a
   0035 74 01               482 	mov	a,#0x01		; enable ISO endpoint 8 for input/output
   0037 90 7F E0            483 	mov	dptr,#INISOVAL
   003A F0                  484 	movx	@dptr,a
   003B 90 7F E1            485 	mov	dptr,#OUTISOVAL
   003E F0                  486 	movx	@dptr,a
   003F 90 7F DD            487 	mov	dptr,#USBPAIR
   0042 74 89               488 	mov	a,#0x89		; pair EP 2&3 for input & output, ISOSEND0
   0044 F0                  489 	movx	@dptr,a
   0045 90 7F DE            490 	mov	dptr,#IN07VAL
   0048 74 03               491 	mov	a,#0x3		; enable EP0+EP1
   004A F0                  492 	movx	@dptr,a
   004B 90 7F DF            493 	mov	dptr,#OUT07VAL
   004E 74 01               494 	mov	a,#0x1		; enable EP0
   0050 F0                  495 	movx	@dptr,a
                            496 	;; USB:	init endpoint toggles
   0051 90 7F D7            497 	mov	dptr,#TOGCTL
   0054 74 12               498 	mov	a,#0x12
   0056 F0                  499 	movx	@dptr,a
   0057 74 32               500 	mov	a,#0x32		; clear EP 2 in toggle
   0059 F0                  501 	movx	@dptr,a
   005A 74 02               502 	mov	a,#0x02
   005C F0                  503 	movx	@dptr,a
   005D 74 22               504 	mov	a,#0x22		; clear EP 2 out toggle
   005F F0                  505 	movx	@dptr,a
                            506 	;; configure IO ports
   0060 90 7F 93            507 	mov	dptr,#PORTACFG
   0063 74 00               508 	mov	a,#0
   0065 F0                  509 	movx	@dptr,a
   0066 90 7F 96            510 	mov	dptr,#OUTA
   0069 74 82               511 	mov	a,#0x82		; set PROG hi
   006B F0                  512 	movx	@dptr,a
   006C 90 7F 9C            513 	mov	dptr,#OEA
   006F 74 C2               514 	mov	a,#0xc2		; out: TMS,TDI,PROG  in: DONE
   0071 F0                  515 	movx	@dptr,a
   0072 90 7F 94            516 	mov	dptr,#PORTBCFG
   0075 74 00               517 	mov	a,#0
   0077 F0                  518 	movx	@dptr,a
   0078 90 7F 9D            519 	mov	dptr,#OEB
   007B 74 00               520 	mov	a,#0
   007D F0                  521 	movx	@dptr,a
   007E 90 7F 95            522 	mov	dptr,#PORTCCFG
   0081 74 C3               523 	mov	a,#0xc3		; RD/WR/TXD0/RXD0 are special function pins
   0083 F0                  524 	movx	@dptr,a
   0084 90 7F 98            525 	mov	dptr,#OUTC
   0087 74 28               526 	mov	a,#0x28
   0089 F0                  527 	movx	@dptr,a
   008A 90 7F 9E            528 	mov	dptr,#OEC
   008D 74 2A               529 	mov	a,#0x2a		; out: LEDCON,LEDSTA,TCK  in: TDO,INIT
   008F F0                  530 	movx	@dptr,a
                            531 	;; enable interrupts
   0090 75 A8 92            532 	mov	ie,#0x92	; enable timer 0 and ser 0 int
   0093 75 E8 01            533 	mov	eie,#0x01	; enable USB interrupts
   0096 90 7F AE            534 	mov	dptr,#USBIEN
   0099 74 01               535 	mov	a,#1		; enable SUDAV interrupt
   009B F0                  536 	movx	@dptr,a
   009C 90 7F AC            537 	mov	dptr,#IN07IEN
   009F 74 03               538 	mov	a,#3		; enable EP0+EP1 interrupt
   00A1 F0                  539 	movx	@dptr,a
   00A2 90 7F AD            540 	mov	dptr,#OUT07IEN
   00A5 74 01               541 	mov	a,#1		; enable EP0 interrupt
   00A7 F0                  542 	movx	@dptr,a
                            543 	;; initialize UART 0 for T7F communication
   00A8 75 98 52            544 	mov	scon0,#0x52	; Mode 1, Timer 1, Receiver enable
                            545         ;; copy configuration to bit addressable variables
   00AB 75 20 00            546         mov     ctrlreg,#AUDIOCTRLCNTRES
   00AE 78rE1               547         mov     r0,#parpttmute
   00B0 E2                  548         movx    a,@r0
   00B1 A2 E0               549         mov     c,acc.0
   00B3 92*08               550         mov     pttmute,c
   00B5 92*01               551         mov     ctrl_pttmute,c
                            552 	;; turn off transmitter
   00B7 90 C0 08            553 	mov	dptr,#AUDIOCTRL
   00BA E5 20               554 	mov	a,ctrlreg
   00BC F0                  555 	movx	@dptr,a
                            556 	;; Initialize modem disc port / t7f port
   00BD 90 C0 0C            557 	mov	dptr,#AUDIOMDISCTRIS
   00C0 74 FF               558 	mov	a,#0xff
   00C2 F0                  559 	movx	@dptr,a
   00C3 F5*20               560 	mov	mdisctris,a
   00C5 90 C0 0D            561 	mov	dptr,#AUDIOMDISCOUT
   00C8 E4                  562 	clr	a
   00C9 F0                  563 	movx	@dptr,a
   00CA F5*21               564 	mov	mdiscout,a
   00CC 90 C0 0A            565 	mov	dptr,#AUDIOT7FOUT
   00CF 74 1F               566 	mov	a,#0x1f
   00D1 F0                  567 	movx	@dptr,a
   00D2 F5*1F               568 	mov	t7fout,a
                            569 	;; Copy serial number
   00D4 78rF0               570 	mov	r0,#parserial
   00D6 90s0Cr90            571 	mov	dptr,#stringserial+2
   00D9 E2                  572 1$:	movx	a,@r0
   00DA 60 06               573 	jz	2$
   00DC F0                  574 	movx	@dptr,a
   00DD A3                  575 	inc	dptr
   00DE A3                  576 	inc	dptr
   00DF 08                  577 	inc	r0
   00E0 80 F7               578 	sjmp	1$
   00E2 E8                  579 2$:	mov	a,r0
   00E3 24 11               580 	add	a,#1-0xf0	; 1-parserial
   00E5 25 E0               581 	add	a,acc
   00E7 90s0Cr8E            582 	mov	dptr,#stringserial
   00EA F0                  583 	movx	@dptr,a
                            584 	;; check parameters
   00EB                     585 chkparam:
   00EB 75*08 80            586 	mov	divrel,#0x80
   00EE 78rE0               587 	mov	r0,#parframesize
   00F0 E2                  588 	movx	a,@r0
   00F1 B4 02 02            589 	cjne	a,#02,11$
   00F4 80 4E               590 	sjmp	2$
   00F6 B4 03 02            591 11$:	cjne	a,#03,1$
   00F9 80 49               592 	sjmp	2$
   00FB 24 F8               593 1$:	add	a,#-8
   00FD 50 0B               594 	jnc	3$
   00FF 24 F0               595 	add	a,#-16
   0101 40 03               596 	jc	4$
   0103 E2                  597 	movx	a,@r0
   0104 80 06               598 	sjmp	5$
                            599 	;; sampling rate is: 24000000Hz/(divider+2)
   0106 74 18               600 4$:	mov	a,#24
   0108 80 02               601 	sjmp	5$
   010A 74 08               602 3$:	mov	a,#8
                            603 	;; 16 bit by 8 bit divide
                            604 	;; r2:	divisor
                            605 	;; r3:	loop counter
                            606 	;; r4:	dividend/result low
                            607 	;; r5:	dividend/result mid
                            608 	;; r6:	dividend/result high
   010C FA                  609 5$:	mov	r2,a
   010D 7B 11               610 	mov	r3,#17
   010F 7C C0               611 	mov	r4,#24000
   0111 7D 5D               612 	mov	r5,#24000>>8
   0113 7E 00               613 	mov	r6,#0
   0115 C3                  614 6$:	clr	c
   0116 EE                  615 	mov	a,r6
   0117 9A                  616 	subb	a,r2
   0118 40 01               617 	jc	7$
   011A FE                  618 	mov	r6,a
   011B B3                  619 7$:	cpl	c
   011C EC                  620 	mov	a,r4
   011D 33                  621 	rlc	a
   011E FC                  622 	mov	r4,a
   011F ED                  623 	mov	a,r5
   0120 33                  624 	rlc	a
   0121 FD                  625 	mov	r5,a
   0122 EE                  626 	mov	a,r6
   0123 33                  627 	rlc	a
   0124 FE                  628 	mov	r6,a
   0125 DB EE               629 	djnz	r3,6$
                            630 	;; subtract two
   0127 EC                  631 	mov	a,r4
   0128 C3                  632 	clr	c
   0129 94 02               633 	subb	a,#2
   012B FC                  634 	mov	r4,a
   012C ED                  635 	mov	a,r5
   012D 94 00               636 	subb	a,#0
   012F FD                  637 	mov	r5,a
                            638 	;; store result into audio divider
   0130 90 C0 02            639 	mov	dptr,#AUDIODIVIDERHI
   0133 F0                  640 	movx	@dptr,a
   0134 EC                  641 	mov	a,r4
   0135 90 C0 01            642 	mov	dptr,#AUDIODIVIDERLO
   0138 F0                  643 	movx	@dptr,a
   0139 C3                  644 	clr	c
   013A 94 08               645 	subb	a,#0x08
   013C F5*06               646 	mov	divider,a
   013E ED                  647 	mov	a,r5
   013F 94 00               648 	subb	a,#0
   0141 F5*07               649 	mov	divider+1,a
                            650 	;; reload divider into accu
   0143 EA                  651 	mov	a,r2
   0144 F5*09               652 2$:	mov	framesize,a
   0146 90s0Cr14            653 	mov	dptr,#descinframesize
   0149 F0                  654 	movx	@dptr,a
   014A 90s0Cr48            655 	mov	dptr,#descoutframesize
   014D F0                  656 	movx	@dptr,a
                            657 	;; set sampling rate in descriptor
   014E 75 F0 E8            658 	mov	b,#1000
   0151 A4                  659 	mul	ab
   0152 90s0Cr0D            660 	mov	dptr,#descinsrate
   0155 F0                  661 	movx	@dptr,a
   0156 90s0Cr41            662 	mov	dptr,#descoutsrate
   0159 F0                  663 	movx	@dptr,a
   015A AB F0               664 	mov	r3,b
   015C E5*09               665 	mov	a,framesize
   015E 75 F0 03            666 	mov	b,#1000>>8
   0161 A4                  667 	mul	ab
   0162 2B                  668 	add	a,r3
   0163 90s0Cr0E            669 	mov	dptr,#descinsrate+1
   0166 F0                  670 	movx	@dptr,a
   0167 90s0Cr42            671 	mov	dptr,#descoutsrate+1
   016A F0                  672 	movx	@dptr,a
   016B E4                  673 	clr	a
   016C 35 F0               674 	addc	a,b
   016E 90s0Cr0F            675 	mov	dptr,#descinsrate+2
   0171 F0                  676 	movx	@dptr,a
   0172 90s0Cr43            677 	mov	dptr,#descoutsrate+2
   0175 F0                  678 	movx	@dptr,a
                            679 	;; initialize USB state
   0176                     680 usbinit:
                            681 
                    0000    682 	.if	0
                            683 	;;  XXXXX
                            684 	;; check if windows needs 11025Hz
                            685 	mov	a,#12
                            686 	mov	dptr,#descinframesize
                            687 	movx	@dptr,a
                            688 	mov	dptr,#descoutframesize
                            689 	movx	@dptr,a
                            690 	mov	a,#0x11
                            691 	mov	dptr,#descinsrate
                            692 	movx	@dptr,a
                            693 	mov	dptr,#descoutsrate
                            694 	movx	@dptr,a
                            695 	mov	a,#0x2b
                            696 	mov	dptr,#descinsrate+1
                            697 	movx	@dptr,a
                            698 	mov	dptr,#descoutsrate+1
                            699 	movx	@dptr,a
                            700 	mov	a,#0
                            701 	mov	dptr,#descinsrate+2
                            702 	movx	@dptr,a
                            703 	mov	dptr,#descoutsrate+2
                            704 	movx	@dptr,a
                            705 	;;  XXXXX
                            706 	.endif
                            707 	
   0176 E4                  708 	clr	a
   0177 F5*22               709 	mov	numconfig,a
   0179 78r23               710 	mov	r0,#altsetting
   017B 7A 04               711 	mov	r2,#NUMINTERFACES
   017D F6                  712 3$:	mov	@r0,a
   017E 08                  713 	inc	r0
   017F DA FC               714 	djnz	r2,3$
                            715 	;; give Windows a chance to finish the writecpucs control transfer
                            716 	;; 20ms delay loop
   0181 90 D1 20            717 	mov	dptr,#(-12000)&0xffff
   0184 A3                  718 2$:	inc	dptr		; 3 cycles
   0185 E5 82               719 	mov	a,dpl0		; 2 cycles
   0187 45 83               720 	orl	a,dph0		; 2 cycles
   0189 70 F9               721 	jnz	2$		; 3 cycles
                    0001    722 	.if	1
                            723 	;; disconnect from USB bus
   018B 90 7F D6            724 	mov	dptr,#USBCS
   018E 74 0A               725 	mov	a,#10
   0190 F0                  726 	movx	@dptr,a
                            727 	;; wait 0.3 sec
   0191 7A 1E               728 	mov	r2,#30
                            729 	;; 10ms delay loop
   0193 90 E8 90            730 0$:	mov	dptr,#(-6000)&0xffff
   0196 A3                  731 1$:	inc	dptr            ; 3 cycles
   0197 E5 82               732 	mov	a,dpl0          ; 2 cycles
   0199 45 83               733 	orl	a,dph0          ; 2 cycles
   019B 70 F9               734 	jnz	1$              ; 3 cycles
   019D DA F4               735 	djnz	r2,0$
                            736 	;; reconnect to USB bus
   019F 90 7F D6            737 	mov	dptr,#USBCS
                            738 	;mov	a,#2		; 8051 handles control
                            739 	;movx	@dptr,a
   01A2 74 06               740 	mov	a,#6		; reconnect, 8051 handles control
   01A4 F0                  741 	movx	@dptr,a
                            742 	.endif
                            743 
                            744 	;; final
   01A5 12s08rBC            745 	lcall	fillusbintr
   01A8                     746 fifoinit:
                            747 	;; first wait for a new frame
   01A8 90 7F D8            748 	mov	dptr,#USBFRAMEL
   01AB E0                  749 	movx	a,@dptr
   01AC FA                  750 	mov	r2,a
   01AD E0                  751 1$:	movx	a,@dptr
   01AE B5 02 02            752 	cjne	a,ar2,2$
   01B1 80 FA               753 	sjmp	1$
   01B3 90 C0 01            754 2$:	mov	dptr,#AUDIORXFIFOCNT
   01B6 E0                  755 	movx	a,@dptr
   01B7 24 FC               756 	add	a,#-4
   01B9 54 3F               757 	anl	a,#0x3f
   01BB 60 07               758 	jz	4$
   01BD FA                  759 	mov	r2,a
   01BE 90 C0 00            760 	mov	dptr,#AUDIORXFIFO
   01C1 E0                  761 3$:	movx	a,@dptr
   01C2 DA FD               762 	djnz	r2,3$
   01C4 90 C0 02            763 4$:	mov	dptr,#AUDIOTXFIFOCNT
   01C7 E0                  764 	movx	a,@dptr
   01C8 24 FC               765 	add	a,#-4
   01CA 54 3F               766 	anl	a,#0x3f
   01CC 60 F6               767 	jz	4$
   01CE FA                  768 	mov	r2,a
   01CF 90 C0 00            769 	mov	dptr,#AUDIOTXFIFO
   01D2 E4                  770 	clr	a
   01D3 F0                  771 5$:	movx	@dptr,a
   01D4 DA FD               772 	djnz	r2,5$
   01D6                     773 6$:	;; clear SOFIR interrupt
   01D6 90 7F AB            774 	mov	dptr,#USBIRQ
   01D9 74 02               775 	mov	a,#0x02
   01DB F0                  776 	movx	@dptr,a
                            777 	;; finally enable SOFIR interrupt
   01DC 90 7F AE            778 	mov	dptr,#USBIEN
   01DF 74 03               779 	mov	a,#3		; enable SUDAV+SOFIR interrupt
   01E1 F0                  780 	movx	@dptr,a	
   01E2 12s08rBC            781 	lcall	fillusbintr
   01E5 02s00r00            782 	ljmp	mainloop
                            783 
                            784 
                            785 	.area	CSEG (CODE)
                    0002    786 	ar2 = 0x02
                    0003    787 	ar3 = 0x03
                    0004    788 	ar4 = 0x04
                    0005    789 	ar5 = 0x05
                    0006    790 	ar6 = 0x06
                    0007    791 	ar7 = 0x07
                    0000    792 	ar0 = 0x00
                    0001    793 	ar1 = 0x01
                            794 
                            795 	;; WARNING!  The assembler doesn't check for
                            796 	;; out of range short jump labels!! Double check
                            797 	;; that the jump labels are within the range!
   0000                     798 mainloop:
   0000 E5*0C               799 	mov	a,pttforce
   0002 A2 E0               800 	mov	c,acc.0
   0004 92*00               801 	mov	ctrl_ptt,c
   0006 92*02               802 	mov	ctrl_ledptt,c
   0008 B3                  803 	cpl	c
   0009 82*08               804 	anl	c,pttmute
   000B 92*01               805 	mov	ctrl_pttmute,c
   000D 90 C0 08            806 	mov	dptr,#AUDIOCTRL
   0010 E5 20               807 	mov	a,ctrlreg
   0012 F0                  808 	movx	@dptr,a
   0013 02s00r00            809 	ljmp	mainloop
                            810 
                            811 	;; ------------------ interrupt handlers ------------------------
                            812 
   0016                     813 int0_isr:
   0016 C0 E0               814 	push	acc
   0018 C0 F0               815 	push	b
   001A C0 82               816 	push	dpl0
   001C C0 83               817 	push	dph0
   001E C0 D0               818 	push	psw
   0020 75 D0 00            819 	mov	psw,#0x00
   0023 C0 86               820 	push	dps
   0025 75 86 00            821 	mov	dps,#0
                            822 	;; clear interrupt
   0028 C2 89               823 	clr	tcon+1
                            824 	;; handle interrupt
                            825 	;; epilogue
   002A D0 86               826 	pop	dps
   002C D0 D0               827 	pop	psw
   002E D0 83               828 	pop	dph0
   0030 D0 82               829 	pop	dpl0
   0032 D0 F0               830 	pop	b
   0034 D0 E0               831 	pop	acc
   0036 32                  832 	reti
                            833 
   0037                     834 timer0_isr:
   0037 C0 E0               835 	push	acc
   0039 C0 F0               836 	push	b
   003B C0 82               837 	push	dpl0
   003D C0 83               838 	push	dph0
   003F C0 D0               839 	push	psw
   0041 75 D0 00            840 	mov	psw,#0x00
   0044 C0 86               841 	push	dps
   0046 75 86 00            842 	mov	dps,#0
                            843 	;; clear interrupt
   0049 C2 8D               844 	clr	tcon+5
                            845 	;; handle interrupt
                    0000    846 	.if	0
                            847 	inc	leddiv
                            848 	mov	a,leddiv
                            849 	anl	a,#7
                            850 	jnz	0$
                            851 	mov	dptr,#OUTC
                            852 	movx	a,@dptr
                            853 	xrl	a,#0x08
                            854 	movx	@dptr,a
                            855 0$:
                            856 	.endif
                            857 	;; epilogue
   004B D0 86               858 	pop	dps
   004D D0 D0               859 	pop	psw
   004F D0 83               860 	pop	dph0
   0051 D0 82               861 	pop	dpl0
   0053 D0 F0               862 	pop	b
   0055 D0 E0               863 	pop	acc
   0057 32                  864 	reti
                            865 
   0058                     866 int1_isr:
   0058 C0 E0               867 	push	acc
   005A C0 F0               868 	push	b
   005C C0 82               869 	push	dpl0
   005E C0 83               870 	push	dph0
   0060 C0 D0               871 	push	psw
   0062 75 D0 00            872 	mov	psw,#0x00
   0065 C0 86               873 	push	dps
   0067 75 86 00            874 	mov	dps,#0
                            875 	;; clear interrupt
   006A C2 8B               876 	clr	tcon+3
                            877 	;; handle interrupt
                            878 	;; epilogue
   006C D0 86               879 	pop	dps
   006E D0 D0               880 	pop	psw
   0070 D0 83               881 	pop	dph0
   0072 D0 82               882 	pop	dpl0
   0074 D0 F0               883 	pop	b
   0076 D0 E0               884 	pop	acc
   0078 32                  885 	reti
                            886 
   0079                     887 timer1_isr:
   0079 C0 E0               888 	push	acc
   007B C0 F0               889 	push	b
   007D C0 82               890 	push	dpl0
   007F C0 83               891 	push	dph0
   0081 C0 D0               892 	push	psw
   0083 75 D0 00            893 	mov	psw,#0x00
   0086 C0 86               894 	push	dps
   0088 75 86 00            895 	mov	dps,#0
                            896 	;; clear interrupt
   008B C2 8F               897 	clr	tcon+7
                            898 	;; handle interrupt
                            899 	;; epilogue
   008D D0 86               900 	pop	dps
   008F D0 D0               901 	pop	psw
   0091 D0 83               902 	pop	dph0
   0093 D0 82               903 	pop	dpl0
   0095 D0 F0               904 	pop	b
   0097 D0 E0               905 	pop	acc
   0099 32                  906 	reti
                            907 
   009A                     908 ser0_isr:
   009A C0 E0               909 	push	acc
   009C C0 F0               910 	push	b
   009E C0 82               911 	push	dpl0
   00A0 C0 83               912 	push	dph0
   00A2 C0 D0               913 	push	psw
   00A4 75 D0 00            914 	mov	psw,#0x00
   00A7 C0 86               915 	push	dps
   00A9 75 86 00            916 	mov	dps,#0
   00AC C0 00               917 	push	ar0
                            918 	;; clear interrupt
   00AE 10 98 16            919 	jbc	scon0+0,1$	; RI
   00B1 10 99 0F            920 0$:	jbc	scon0+1,2$	; TI
                            921 	;; handle interrupt
                            922 	;; epilogue
   00B4 D0 00               923 3$:	pop	ar0
   00B6 D0 86               924 	pop	dps
   00B8 D0 D0               925 	pop	psw
   00BA D0 83               926 	pop	dph0
   00BC D0 82               927 	pop	dpl0
   00BE D0 F0               928 	pop	b
   00C0 D0 E0               929 	pop	acc
   00C2 32                  930 	reti
                            931 
   00C3 D2*09               932 2$:	setb	uartempty
   00C5 80 EA               933 	sjmp	0$
                            934 
   00C7 E5*1D               935 1$:	mov	a,uartwr
   00C9 24r0D               936 	add	a,#uartbuf
   00CB F8                  937 	mov	r0,a
   00CC E5 99               938 	mov	a,sbuf0
   00CE F6                  939 	mov	@r0,a
   00CF E5*1D               940 	mov	a,uartwr
   00D1 04                  941 	inc	a
   00D2 54 0F               942 	anl	a,#0xf
   00D4 F5*1D               943 	mov	uartwr,a
   00D6 80 DC               944 	sjmp	3$
                            945 
   00D8                     946 timer2_isr:
   00D8 C0 E0               947 	push	acc
   00DA C0 F0               948 	push	b
   00DC C0 82               949 	push	dpl0
   00DE C0 83               950 	push	dph0
   00E0 C0 D0               951 	push	psw
   00E2 75 D0 00            952 	mov	psw,#0x00
   00E5 C0 86               953 	push	dps
   00E7 75 86 00            954 	mov	dps,#0
                            955 	;; clear interrupt
   00EA C2 CF               956 	clr	t2con+7
                            957 	;; handle interrupt
                            958 	;; epilogue
   00EC D0 86               959 	pop	dps
   00EE D0 D0               960 	pop	psw
   00F0 D0 83               961 	pop	dph0
   00F2 D0 82               962 	pop	dpl0
   00F4 D0 F0               963 	pop	b
   00F6 D0 E0               964 	pop	acc
   00F8 32                  965 	reti
                            966 
   00F9                     967 resume_isr:
   00F9 C0 E0               968 	push	acc
   00FB C0 F0               969 	push	b
   00FD C0 82               970 	push	dpl0
   00FF C0 83               971 	push	dph0
   0101 C0 D0               972 	push	psw
   0103 75 D0 00            973 	mov	psw,#0x00
   0106 C0 86               974 	push	dps
   0108 75 86 00            975 	mov	dps,#0
                            976 	;; clear interrupt
   010B C2 DC               977 	clr	eicon+4
                            978 	;; handle interrupt
                            979 	;; epilogue
   010D D0 86               980 	pop	dps
   010F D0 D0               981 	pop	psw
   0111 D0 83               982 	pop	dph0
   0113 D0 82               983 	pop	dpl0
   0115 D0 F0               984 	pop	b
   0117 D0 E0               985 	pop	acc
   0119 32                  986 	reti
                            987 
   011A                     988 ser1_isr:
   011A C0 E0               989 	push	acc
   011C C0 F0               990 	push	b
   011E C0 82               991 	push	dpl0
   0120 C0 83               992 	push	dph0
   0122 C0 D0               993 	push	psw
   0124 75 D0 00            994 	mov	psw,#0x00
   0127 C0 86               995 	push	dps
   0129 75 86 00            996 	mov	dps,#0
                            997 	;; clear interrupt
   012C C2 C0               998 	clr	scon1+0
   012E C2 C1               999 	clr	scon1+1
                           1000 	;; handle interrupt
                           1001 	;; epilogue
   0130 D0 86              1002 	pop	dps
   0132 D0 D0              1003 	pop	psw
   0134 D0 83              1004 	pop	dph0
   0136 D0 82              1005 	pop	dpl0
   0138 D0 F0              1006 	pop	b
   013A D0 E0              1007 	pop	acc
   013C 32                 1008 	reti
                           1009 
   013D                    1010 i2c_isr:
   013D C0 E0              1011 	push	acc
   013F C0 F0              1012 	push	b
   0141 C0 82              1013 	push	dpl0
   0143 C0 83              1014 	push	dph0
   0145 C0 D0              1015 	push	psw
   0147 75 D0 00           1016 	mov	psw,#0x00
   014A C0 86              1017 	push	dps
   014C 75 86 00           1018 	mov	dps,#0
                           1019 	;; clear interrupt
   014F E5 91              1020 	mov	a,exif
   0151 C2 E5              1021 	clr	acc.5
   0153 F5 91              1022 	mov	exif,a
                           1023 	;; handle interrupt
                           1024 	;; epilogue
   0155 D0 86              1025 	pop	dps
   0157 D0 D0              1026 	pop	psw
   0159 D0 83              1027 	pop	dph0
   015B D0 82              1028 	pop	dpl0
   015D D0 F0              1029 	pop	b
   015F D0 E0              1030 	pop	acc
   0161 32                 1031 	reti
                           1032 
   0162                    1033 int4_isr:
   0162 C0 E0              1034 	push	acc
   0164 C0 F0              1035 	push	b
   0166 C0 82              1036 	push	dpl0
   0168 C0 83              1037 	push	dph0
   016A C0 D0              1038 	push	psw
   016C 75 D0 00           1039 	mov	psw,#0x00
   016F C0 86              1040 	push	dps
   0171 75 86 00           1041 	mov	dps,#0
                           1042 	;; clear interrupt
   0174 E5 91              1043 	mov	a,exif
   0176 C2 E6              1044 	clr	acc.6
   0178 F5 91              1045 	mov	exif,a
                           1046 	;; handle interrupt
                           1047 	;; epilogue
   017A D0 86              1048 	pop	dps
   017C D0 D0              1049 	pop	psw
   017E D0 83              1050 	pop	dph0
   0180 D0 82              1051 	pop	dpl0
   0182 D0 F0              1052 	pop	b
   0184 D0 E0              1053 	pop	acc
   0186 32                 1054 	reti
                           1055 
   0187                    1056 int5_isr:
   0187 C0 E0              1057 	push	acc
   0189 C0 F0              1058 	push	b
   018B C0 82              1059 	push	dpl0
   018D C0 83              1060 	push	dph0
   018F C0 D0              1061 	push	psw
   0191 75 D0 00           1062 	mov	psw,#0x00
   0194 C0 86              1063 	push	dps
   0196 75 86 00           1064 	mov	dps,#0
                           1065 	;; clear interrupt
   0199 E5 91              1066 	mov	a,exif
   019B C2 E7              1067 	clr	acc.7
   019D F5 91              1068 	mov	exif,a
                           1069 	;; handle interrupt
                           1070 	;; epilogue
   019F D0 86              1071 	pop	dps
   01A1 D0 D0              1072 	pop	psw
   01A3 D0 83              1073 	pop	dph0
   01A5 D0 82              1074 	pop	dpl0
   01A7 D0 F0              1075 	pop	b
   01A9 D0 E0              1076 	pop	acc
   01AB 32                 1077 	reti
                           1078 
   01AC                    1079 int6_isr:
   01AC C0 E0              1080 	push	acc
   01AE C0 F0              1081 	push	b
   01B0 C0 82              1082 	push	dpl0
   01B2 C0 83              1083 	push	dph0
   01B4 C0 D0              1084 	push	psw
   01B6 75 D0 00           1085 	mov	psw,#0x00
   01B9 C0 86              1086 	push	dps
   01BB 75 86 00           1087 	mov	dps,#0
                           1088 	;; clear interrupt
   01BE C2 DB              1089 	clr	eicon+3
                           1090 	;; handle interrupt
                           1091 	;; epilogue
   01C0 D0 86              1092 	pop	dps
   01C2 D0 D0              1093 	pop	psw
   01C4 D0 83              1094 	pop	dph0
   01C6 D0 82              1095 	pop	dpl0
   01C8 D0 F0              1096 	pop	b
   01CA D0 E0              1097 	pop	acc
   01CC 32                 1098 	reti
                           1099 
   01CD                    1100 usb_sudav_isr:
   01CD C0 E0              1101 	push	acc
   01CF C0 F0              1102 	push	b
   01D1 C0 82              1103 	push	dpl0
   01D3 C0 83              1104 	push	dph0
   01D5 C0 84              1105 	push	dpl1
   01D7 C0 85              1106 	push	dph1
   01D9 C0 D0              1107 	push	psw
   01DB 75 D0 00           1108 	mov	psw,#0x00
   01DE C0 86              1109 	push	dps
   01E0 75 86 00           1110 	mov	dps,#0
   01E3 C0 00              1111 	push	ar0
   01E5 C0 07              1112 	push	ar7
                           1113 	;; clear interrupt
   01E7 E5 91              1114 	mov	a,exif
   01E9 C2 E4              1115 	clr	acc.4
   01EB F5 91              1116 	mov	exif,a
   01ED 90 7F AB           1117 	mov	dptr,#USBIRQ
   01F0 74 01              1118 	mov	a,#0x01
   01F2 F0                 1119 	movx	@dptr,a
                           1120 	;; handle interrupt
   01F3 75*00 00           1121 	mov	ctrlcode,#0		; reset control out code
   01F6 90 7F E9           1122 	mov	dptr,#SETUPDAT+1
   01F9 E0                 1123 	movx	a,@dptr			; bRequest field
                           1124 	;; standard commands
                           1125 	;; USB_REQ_GET_DESCRIPTOR
   01FA B4 06 59           1126 	cjne	a,#USB_REQ_GET_DESCRIPTOR,cmdnotgetdesc
   01FD 90 7F E8           1127 	mov	dptr,#SETUPDAT		; bRequestType == 0x80
   0200 E0                 1128 	movx	a,@dptr
   0201 B4 80 4F           1129 	cjne	a,#USB_DIR_IN,setupstallstd
   0204 90 7F EB           1130 	mov	dptr,#SETUPDAT+3
   0207 E0                 1131 	movx	a,@dptr
   0208 B4 01 0C           1132 	cjne	a,#USB_DT_DEVICE,cmdnotgetdescdev
   020B 90 7F D4           1133 	mov	dptr,#SUDPTRH
   020E 74s0B              1134 	mov	a,#>devicedescr
   0210 F0                 1135 	movx	@dptr,a
   0211 A3                 1136 	inc	dptr
   0212 74r74              1137 	mov	a,#<devicedescr
   0214 F0                 1138 	movx	@dptr,a
   0215 80 39              1139 	sjmp	setupackstd
   0217                    1140 cmdnotgetdescdev:
   0217 B4 02 12           1141 	cjne	a,#USB_DT_CONFIG,cmdnotgetdesccfg
   021A 90 7F EA           1142 	mov	dptr,#SETUPDAT+2
   021D E0                 1143 	movx	a,@dptr
   021E 70 33              1144 	jnz	setupstallstd
   0220 90 7F D4           1145 	mov	dptr,#SUDPTRH
   0223 74s0B              1146 	mov	a,#>config0descr
   0225 F0                 1147 	movx	@dptr,a
   0226 A3                 1148 	inc	dptr
   0227 74r86              1149 	mov	a,#<config0descr
   0229 F0                 1150 	movx	@dptr,a
   022A 80 24              1151 	sjmp	setupackstd
   022C                    1152 cmdnotgetdesccfg:
   022C B4 03 24           1153 	cjne	a,#USB_DT_STRING,setupstallstd
   022F 90 7F EA           1154 	mov	dptr,#SETUPDAT+2
   0232 E0                 1155 	movx	a,@dptr
   0233 24 FC              1156 	add	a,#-numstrings
   0235 40 1C              1157 	jc	setupstallstd
   0237 E0                 1158 	movx	a,@dptr
   0238 25 E0              1159 	add	a,acc
   023A 24r54              1160 	add	a,#<stringdescr
   023C F5 82              1161 	mov	dpl0,a
   023E E4                 1162 	clr	a
   023F 34s0C              1163 	addc	a,#>stringdescr
   0241 F5 83              1164 	mov	dph0,a
   0243 E0                 1165 	movx	a,@dptr
   0244 F5 F0              1166 	mov	b,a
   0246 A3                 1167 	inc	dptr
   0247 E0                 1168 	movx	a,@dptr
   0248 90 7F D4           1169 	mov	dptr,#SUDPTRH
   024B F0                 1170 	movx	@dptr,a
   024C A3                 1171 	inc	dptr
   024D E5 F0              1172 	mov	a,b
   024F F0                 1173 	movx	@dptr,a
                           1174 	; sjmp	setupackstd	
   0250                    1175 setupackstd:
   0250 02s06r60           1176 	ljmp	setupack
   0253                    1177 setupstallstd:
   0253 02s06r5C           1178 	ljmp	setupstall
   0256                    1179 cmdnotgetdesc:
                           1180 	;; USB_REQ_SET_CONFIGURATION
   0256 B4 09 41           1181 	cjne	a,#USB_REQ_SET_CONFIGURATION,cmdnotsetconf
   0259 90 7F E8           1182 	mov	dptr,#SETUPDAT
   025C E0                 1183 	movx	a,@dptr
   025D 70 F4              1184 	jnz	setupstallstd
   025F 90 7F EA           1185 	mov	dptr,#SETUPDAT+2
   0262 E0                 1186 	movx	a,@dptr
   0263 24 FE              1187 	add	a,#-2
   0265 40 EC              1188 	jc	setupstallstd
   0267 E0                 1189 	movx	a,@dptr
   0268 F5*22              1190 	mov	numconfig,a
   026A                    1191 cmdresettoggleshalt:
   026A 90 7F D7           1192 	mov	dptr,#TOGCTL
   026D 78 07              1193 	mov	r0,#7
   026F E8                 1194 0$:	mov	a,r0
   0270 44 10              1195 	orl	a,#0x10
   0272 F0                 1196 	movx	@dptr,a
   0273 44 30              1197 	orl	a,#0x30
   0275 F0                 1198 	movx	@dptr,a
   0276 E8                 1199 	mov	a,r0
   0277 F0                 1200 	movx	@dptr,a
   0278 44 20              1201 	orl	a,#0x20
   027A F0                 1202 	movx	@dptr,a
   027B D8 F2              1203 	djnz	r0,0$
   027D E4                 1204 	clr	a
   027E F0                 1205 	movx	@dptr,a
   027F 74 02              1206 	mov	a,#2
   0281 90 7F B6           1207 	mov	dptr,#IN1CS
   0284 78 07              1208 	mov	r0,#7
   0286 F0                 1209 1$:	movx	@dptr,a
   0287 A3                 1210 	inc	dptr
   0288 A3                 1211 	inc	dptr
   0289 D8 FB              1212 	djnz	r0,1$
   028B 90 7F C6           1213 	mov	dptr,#OUT1CS
   028E 78 07              1214 	mov	r0,#7
   0290 F0                 1215 2$:	movx	@dptr,a
   0291 A3                 1216 	inc	dptr
   0292 A3                 1217 	inc	dptr
   0293 D8 FB              1218 	djnz	r0,2$
   0295 12s08rBC           1219 	lcall	fillusbintr
   0298 80 B6              1220 	sjmp	setupackstd
   029A                    1221 cmdnotsetconf:
                           1222 	;; USB_REQ_SET_INTERFACE
   029A B4 0B 1E           1223 	cjne	a,#USB_REQ_SET_INTERFACE,cmdnotsetint
   029D 90 7F E8           1224 	mov	dptr,#SETUPDAT
   02A0 E0                 1225 	movx	a,@dptr
   02A1 B4 01 AF           1226 	cjne	a,#USB_RECIP_INTERFACE|USB_DIR_OUT,setupstallstd
   02A4 E5*22              1227 	mov	a,numconfig
   02A6 B4 01 AA           1228 	cjne	a,#1,setupstallstd
   02A9 90 7F EC           1229 	mov	dptr,#SETUPDAT+4
   02AC E0                 1230 	movx	a,@dptr
   02AD 24 FC              1231 	add	a,#-NUMINTERFACES
   02AF 40 A2              1232 	jc	setupstallstd
   02B1 24r27              1233 	add	a,#NUMINTERFACES+altsetting
   02B3 F8                 1234 	mov	r0,a
   02B4 90 7F EA           1235 	mov	dptr,#SETUPDAT+2
   02B7 E0                 1236 	movx	a,@dptr
   02B8 F6                 1237 	mov	@r0,a
   02B9 80 AF              1238 	sjmp	cmdresettoggleshalt
   02BB                    1239 cmdnotsetint:
                           1240 	;; USB_REQ_GET_INTERFACE
   02BB B4 0A 24           1241 	cjne	a,#USB_REQ_GET_INTERFACE,cmdnotgetint
   02BE 90 7F E8           1242 	mov	dptr,#SETUPDAT
   02C1 E0                 1243 	movx	a,@dptr
   02C2 B4 81 8E           1244 	cjne	a,#USB_RECIP_INTERFACE|USB_DIR_IN,setupstallstd
   02C5 E5*22              1245 	mov	a,numconfig
   02C7 B4 01 89           1246 	cjne	a,#1,setupstallstd
   02CA 90 7F EC           1247 	mov	dptr,#SETUPDAT+4
   02CD E0                 1248 	movx	a,@dptr
   02CE 24 FC              1249 	add	a,#-NUMINTERFACES
   02D0 40 81              1250 	jc	setupstallstd
   02D2 24r27              1251 	add	a,#NUMINTERFACES+altsetting
   02D4 F8                 1252 	mov	r0,a
   02D5 E6                 1253 	mov	a,@r0
   02D6                    1254 cmdrespondonebyte:
   02D6 90 7F 00           1255 	mov	dptr,#IN0BUF
   02D9 F0                 1256 	movx	@dptr,a
   02DA 90 7F B5           1257 	mov	dptr,#IN0BC
   02DD 74 01              1258 	mov	a,#1
   02DF F0                 1259 	movx	@dptr,a	
   02E0 80 4E              1260 	sjmp	setupackstd2
   02E2                    1261 cmdnotgetint:
                           1262 	;; USB_REQ_GET_CONFIGURATION
   02E2 B4 08 0B           1263 	cjne	a,#USB_REQ_GET_CONFIGURATION,cmdnotgetconf
   02E5 90 7F E8           1264 	mov	dptr,#SETUPDAT
   02E8 E0                 1265 	movx	a,@dptr
   02E9 B4 80 47           1266 	cjne	a,#USB_RECIP_DEVICE|USB_DIR_IN,setupstallstd2
   02EC E5*22              1267 	mov	a,numconfig
   02EE 80 E6              1268 	sjmp	cmdrespondonebyte	
   02F0                    1269 cmdnotgetconf:
                           1270 	;; USB_REQ_GET_STATUS (0)
   02F0 70 44              1271 	jnz	cmdnotgetstat
   02F2 90 7F E8           1272 	mov	dptr,#SETUPDAT
   02F5 E0                 1273 	movx	a,@dptr
   02F6 B4 80 11           1274 	cjne	a,#USB_RECIP_DEVICE|USB_DIR_IN,cmdnotgetstatdev
   02F9 74 01              1275 	mov	a,#1
   02FB                    1276 cmdrespondstat:
   02FB 90 7F 00           1277 	mov	dptr,#IN0BUF
   02FE F0                 1278 	movx	@dptr,a
   02FF A3                 1279 	inc	dptr
   0300 E4                 1280 	clr	a
   0301 F0                 1281 	movx	@dptr,a
   0302 90 7F B5           1282 	mov	dptr,#IN0BC
   0305 74 02              1283 	mov	a,#2
   0307 F0                 1284 	movx	@dptr,a	
   0308 80 26              1285 	sjmp	setupackstd2
   030A                    1286 cmdnotgetstatdev:
   030A B4 81 03           1287 	cjne	a,#USB_RECIP_INTERFACE|USB_DIR_IN,cmdnotgetstatintf
   030D E4                 1288 	clr	a
   030E 80 EB              1289 	sjmp	cmdrespondstat
   0310                    1290 cmdnotgetstatintf:
   0310 B4 82 20           1291 	cjne	a,#USB_RECIP_ENDPOINT|USB_DIR_IN,setupstallstd2
   0313 90 7F EC           1292 	mov	dptr,#SETUPDAT+4
   0316 E0                 1293 	movx	a,@dptr
   0317 90 7F C4           1294 	mov	dptr,#OUT1CS-2
   031A 30 E7 03           1295 	jnb	acc.7,0$
   031D 90 7F B4           1296 	mov	dptr,#IN1CS-2
   0320 54 0F              1297 0$:	anl	a,#15
   0322 60 0F              1298 	jz	setupstallstd2
   0324 20 E3 0C           1299 	jb	acc.3,setupstallstd2
   0327 25 E0              1300 	add	a,acc
   0329 25 82              1301 	add	a,dpl0
   032B F5 82              1302 	mov	dpl0,a
   032D E0                 1303 	movx	a,@dptr
   032E 80 CB              1304 	sjmp	cmdrespondstat
   0330                    1305 setupackstd2:
   0330 02s06r60           1306 	ljmp	setupack
   0333                    1307 setupstallstd2:
   0333 02s06r5C           1308 	ljmp	setupstall
   0336                    1309 cmdnotgetstat:
                           1310 	;; USB_REQ_SET_FEATURE
   0336 B4 03 05           1311 	cjne	a,#USB_REQ_SET_FEATURE,cmdnotsetftr
   0339 75 F0 01           1312 	mov	b,#1
   033C 80 06              1313 	sjmp	handleftr
   033E                    1314 cmdnotsetftr:
                           1315 	;; USB_REQ_CLEAR_FEATURE
   033E B4 01 44           1316 	cjne	a,#USB_REQ_CLEAR_FEATURE,cmdnotclrftr
   0341 75 F0 00           1317 	mov	b,#0
   0344                    1318 handleftr:
   0344 90 7F E8           1319 	mov	dptr,#SETUPDAT
   0347 E0                 1320 	movx	a,@dptr
   0348 B4 02 E8           1321 	cjne	a,#USB_RECIP_ENDPOINT|USB_DIR_OUT,setupstallstd2
   034B A3                 1322 	inc	dptr
   034C A3                 1323 	inc	dptr
   034D E0                 1324 	movx	a,@dptr
   034E 70 E3              1325 	jnz	setupstallstd2	; not ENDPOINT_HALT feature
   0350 A3                 1326 	inc	dptr
   0351 E0                 1327 	movx	a,@dptr
   0352 70 DF              1328 	jnz	setupstallstd2
   0354 A3                 1329 	inc	dptr
   0355 E0                 1330 	movx	a,@dptr
   0356 90 7F C4           1331 	mov	dptr,#OUT1CS-2
   0359 30 E7 05           1332 	jnb	acc.7,0$
   035C 90 7F B4           1333 	mov	dptr,#IN1CS-2
   035F 44 10              1334 	orl	a,#0x10
   0361 20 E3 CF           1335 0$:	jb	acc.3,setupstallstd2
                           1336 	;; clear data toggle
   0364 54 1F              1337 	anl	a,#0x1f
   0366 05 86              1338 	inc	dps
   0368 90 7F D7           1339 	mov	dptr,#TOGCTL
   036B F0                 1340 	movx	@dptr,a
   036C 44 20              1341 	orl	a,#0x20
   036E F0                 1342 	movx	@dptr,a
   036F 54 0F              1343 	anl	a,#15
   0371 F0                 1344 	movx	@dptr,a
   0372 15 86              1345 	dec	dps	
                           1346 	;; clear/set ep halt feature
   0374 25 E0              1347 	add	a,acc
   0376 25 82              1348 	add	a,dpl0
   0378 F5 82              1349 	mov	dpl0,a
   037A E5 F0              1350 	mov	a,b
   037C F0                 1351 	movx	@dptr,a
   037D 80 B1              1352 	sjmp	setupackstd2
                           1353 
   037F                    1354 cmdnotc0_1:
   037F 02s04r17           1355 	ljmp	cmdnotc0
   0382                    1356 setupstallc0_1:
   0382 02s06r5C           1357 	ljmp	setupstall
                           1358 	
   0385                    1359 cmdnotclrftr:
                           1360 	;; vendor specific commands
                           1361 	;; 0xc0
   0385 B4 C0 F7           1362 	cjne	a,#0xc0,cmdnotc0_1
   0388 90 7F E8           1363 	mov	dptr,#SETUPDAT		; bRequestType == 0xc0
   038B E0                 1364 	movx	a,@dptr
   038C B4 C0 F3           1365 	cjne	a,#0xc0,setupstallc0_1
                           1366 	;; fill status buffer
   038F E5*0C              1367 	mov	a,pttforce
   0391 F5 F0              1368 	mov	b,a
   0393 A2 E0              1369 	mov	c,acc.0
   0395 92 F2              1370 	mov	b.2,c
   0397 90 C0 09           1371 	mov	dptr,#AUDIOSTAT
   039A E0                 1372 	movx	a,@dptr
   039B A2 E0              1373 	mov	c,acc.0
   039D B3                 1374 	cpl	c
   039E 92 F3              1375 	mov	b.3,c
   03A0 A2*09              1376 	mov	c,uartempty
   03A2 92 F5              1377 	mov	b.5,c
   03A4 E4                 1378 	clr	a
   03A5 90 7F 04           1379 	mov	dptr,#(IN0BUF+4)
   03A8 F0                 1380 	movx	@dptr,a
                           1381 	;; bytewide elements
   03A9 90 7F 00           1382 	mov	dptr,#(IN0BUF)
   03AC E5 F0              1383 	mov	a,b
   03AE F0                 1384 	movx	@dptr,a
   03AF E4                 1385 	clr	a
   03B0 90 7F 01           1386 	mov	dptr,#(IN0BUF+1)
   03B3 F0                 1387 	movx	@dptr,a
   03B4 90 7F 02           1388 	mov	dptr,#(IN0BUF+2)
   03B7 F0                 1389 	movx	@dptr,a
   03B8 90 C0 04           1390 	mov	dptr,#AUDIORSSI
   03BB E0                 1391 	movx	a,@dptr
   03BC 90 7F 03           1392 	mov	dptr,#(IN0BUF+3)
   03BF F0                 1393 	movx	@dptr,a
                           1394 	;; counter
   03C0 05*04              1395 	inc	irqcount
   03C2 E5*04              1396 	mov	a,irqcount
   03C4 90 7F 05           1397 	mov	dptr,#(IN0BUF+5)
   03C7 F0                 1398 	movx	@dptr,a
                           1399 	;; additional fields (HDLC state mach)
   03C8 E4                 1400 	clr	a
   03C9 A3                 1401 	inc	dptr
   03CA F0                 1402 	movx	@dptr,a
   03CB A3                 1403 	inc	dptr
   03CC F0                 1404 	movx	@dptr,a
   03CD A3                 1405 	inc	dptr
   03CE F0                 1406 	movx	@dptr,a
   03CF A3                 1407 	inc	dptr
   03D0 F0                 1408 	movx	@dptr,a
   03D1 A3                 1409 	inc	dptr
   03D2 F0                 1410 	movx	@dptr,a
   03D3 A3                 1411 	inc	dptr
   03D4 F0                 1412 	movx	@dptr,a
   03D5 A3                 1413 	inc	dptr
   03D6 F0                 1414 	movx	@dptr,a
   03D7 A3                 1415 	inc	dptr
   03D8 F0                 1416 	movx	@dptr,a
   03D9 A3                 1417 	inc	dptr
   03DA F0                 1418 	movx	@dptr,a
   03DB A3                 1419 	inc	dptr
   03DC F0                 1420 	movx	@dptr,a
   03DD A3                 1421 	inc	dptr
   03DE F0                 1422 	movx	@dptr,a
   03DF A3                 1423 	inc	dptr
   03E0 F0                 1424 	movx	@dptr,a
                           1425 	;; FPGA registers
   03E1 90 C0 01           1426 	mov	dptr,#AUDIORXFIFOCNT
   03E4 E0                 1427 	movx	a,@dptr
   03E5 90 7F 12           1428 	mov	dptr,#(IN0BUF+18)
   03E8 F0                 1429 	movx	@dptr,a
   03E9 90 C0 02           1430 	mov	dptr,#AUDIOTXFIFOCNT
   03EC E0                 1431 	movx	a,@dptr
   03ED 90 7F 13           1432 	mov	dptr,#(IN0BUF+19)
   03F0 F0                 1433 	movx	@dptr,a
   03F1 E5 20              1434 	mov	a,ctrlreg
   03F3 A3                 1435 	inc	dptr
   03F4 F0                 1436 	movx	@dptr,a
   03F5 90 C0 09           1437 	mov	dptr,#AUDIOSTAT
   03F8 E0                 1438 	movx	a,@dptr
   03F9 90 7F 15           1439 	mov	dptr,#(IN0BUF+21)
   03FC F0                 1440 	movx	@dptr,a
                           1441 	;; Anchor Registers
   03FD 90 7F C8           1442 	mov	dptr,#OUT2CS
   0400 E0                 1443 	movx	a,@dptr
   0401 90 7F 16           1444 	mov	dptr,#(IN0BUF+22)
   0404 F0                 1445 	movx	@dptr,a
                           1446 	;; set length
   0405 90 7F EE           1447 	mov	dptr,#SETUPDAT+6	; wLength
   0408 E0                 1448 	movx	a,@dptr
   0409 24 E9              1449 	add	a,#-(6+12+4+1)
   040B 50 01              1450 	jnc	4$
   040D E4                 1451 	clr	a
   040E 24 17              1452 4$:	add	a,#(6+12+4+1)
   0410 90 7F B5           1453 	mov	dptr,#IN0BC
   0413 F0                 1454 	movx	@dptr,a
   0414 02s06r60           1455 	ljmp	setupack
   0417                    1456 cmdnotc0:
                           1457 	;; 0xc8
   0417 B4 C8 19           1458 	cjne	a,#0xc8,cmdnotc8
   041A 90 7F E8           1459 	mov	dptr,#SETUPDAT	; bRequestType == 0xc0
   041D E0                 1460 	movx	a,@dptr
   041E B4 C0 0F           1461 	cjne	a,#0xc0,setupstallc8
   0421 74 04              1462 	mov	a,#4
   0423 90 7F 00           1463 	mov	dptr,#IN0BUF
   0426 F0                 1464 	movx	@dptr,a
   0427 90 7F B5           1465 	mov	dptr,#IN0BC
   042A 74 01              1466 	mov	a,#1
   042C F0                 1467 	movx	@dptr,a
   042D 02s06r60           1468 	ljmp	setupack
   0430                    1469 setupstallc8:
   0430 02s06r5C           1470 	ljmp	setupstall
   0433                    1471 cmdnotc8:
                           1472 	;; 0xc9
   0433 B4 C9 21           1473 	cjne	a,#0xc9,cmdnotc9
   0436 90 7F E8           1474 	mov	dptr,#SETUPDAT	; bRequestType == 0xc0
   0439 E0                 1475 	movx	a,@dptr
   043A B4 C0 17           1476 	cjne	a,#0xc0,setupstallc9
   043D 90 7F 00           1477 	mov	dptr,#IN0BUF
   0440 78rF0              1478 	mov	r0,#parserial
   0442 E2                 1479 0$:	movx	a,@r0
   0443 60 05              1480 	jz	1$
   0445 F0                 1481 	movx	@dptr,a
   0446 08                 1482 	inc	r0
   0447 A3                 1483 	inc	dptr
   0448 80 F8              1484 	sjmp	0$
   044A E8                 1485 1$:	mov	a,r0
   044B 24 10              1486 	add	a,#-0xf0	; -parserial
   044D 90 7F B5           1487 	mov	dptr,#IN0BC
   0450 F0                 1488 	movx	@dptr,a
   0451 02s06r60           1489 	ljmp	setupack
   0454                    1490 setupstallc9:
   0454 02s06r5C           1491 	ljmp	setupstall
   0457                    1492 cmdnotc9:
                           1493 	;; 0xd0
   0457 B4 D0 45           1494 	cjne	a,#0xd0,cmdnotd0
   045A 90 7F E8           1495 	mov	dptr,#SETUPDAT	; bRequestType == 0xc0
   045D E0                 1496 	movx	a,@dptr
   045E B4 C0 3B           1497 	cjne	a,#0xc0,setupstalld0
   0461 90 7F EC           1498 	mov	dptr,#SETUPDAT+4	; wIndex
   0464 E0                 1499 	movx	a,@dptr
   0465 B4 01 08           1500 	cjne	a,#1,0$
   0468 90 7F EA           1501 	mov	dptr,#SETUPDAT+2	; wValue
   046B E0                 1502 	movx	a,@dptr
   046C 54 01              1503 	anl	a,#1
   046E F5*0C              1504 	mov	pttforce,a
   0470                    1505 0$:	;; PTT status
   0470 90 7F 00           1506 	mov	dptr,#IN0BUF
   0473 E5*0C              1507 	mov	a,pttforce
   0475 F0                 1508 	movx	@dptr,a
                           1509 	;; DCD status
   0476 90 C0 09           1510 	mov	dptr,#AUDIOSTAT
   0479 E0                 1511 	movx	a,@dptr
   047A 54 01              1512 	anl	a,#1
   047C 64 01              1513 	xrl	a,#1
   047E 90 7F 01           1514 	mov	dptr,#IN0BUF+1
   0481 F0                 1515 	movx	@dptr,a
                           1516 	;; RSSI
   0482 90 C0 04           1517 	mov	dptr,#AUDIORSSI
   0485 E0                 1518 	movx	a,@dptr
   0486 90 7F 02           1519 	mov	dptr,#IN0BUF+2
   0489 F0                 1520 	movx	@dptr,a
                           1521 	;; length
   048A 90 7F EE           1522 	mov	dptr,#SETUPDAT+6	; wLength
   048D E0                 1523 	movx	a,@dptr
   048E 24 FD              1524 	add	a,#-3
   0490 50 01              1525 	jnc	2$
   0492 E4                 1526 	clr	a
   0493 24 03              1527 2$:	add	a,#3
   0495 90 7F B5           1528 	mov	dptr,#IN0BC
   0498 F0                 1529 	movx	@dptr,a
   0499 02s06r60           1530 	ljmp	setupack
   049C                    1531 setupstalld0:
   049C 02s06r5C           1532 	ljmp	setupstall
   049F                    1533 cmdnotd0:
                           1534 	;; 0xd2
   049F B4 D2 20           1535 	cjne	a,#0xd2,cmdnotd2
   04A2 90 7F E8           1536 	mov	dptr,#SETUPDAT	; bRequestType == 0x40
   04A5 E0                 1537 	movx	a,@dptr
   04A6 B4 40 16           1538 	cjne	a,#0x40,setupstalld2
   04A9 90 7F EA           1539 	mov	dptr,#SETUPDAT+2	; wValue
   04AC E0                 1540 	movx	a,@dptr
   04AD F5 F0              1541 	mov	b,a
   04AF 90 7F 98           1542 	mov	dptr,#OUTC
   04B2 E0                 1543 	movx	a,@dptr
   04B3 A2 F0              1544 	mov	c,b.0
   04B5 92 E3              1545 	mov	acc.3,c
   04B7 A2 F1              1546 	mov	c,b.1
   04B9 92 E5              1547 	mov	acc.5,c
   04BB F0                 1548 	movx	@dptr,a
   04BC 02s06r60           1549 	ljmp	setupack
   04BF                    1550 setupstalld2:
   04BF 02s06r5C           1551 	ljmp	setupstall
   04C2                    1552 cmdnotd2:
                           1553 	;; 0xd3
   04C2 B4 D3 16           1554 	cjne	a,#0xd3,cmdnotd3
   04C5 90 7F E8           1555 	mov	dptr,#SETUPDAT	; bRequestType == 0x40
   04C8 E0                 1556 	movx	a,@dptr
   04C9 B4 40 07           1557 	cjne	a,#0x40,setupstalld3
   04CC 90 7F EA           1558 	mov	dptr,#SETUPDAT+2	; wValue
   04CF E0                 1559 	movx	a,@dptr
   04D0 10*09 03           1560 	jbc	uartempty,cmdd2cont
   04D3                    1561 setupstalld3:
   04D3 02s06r5C           1562 	ljmp	setupstall
   04D6                    1563 cmdd2cont:
   04D6 F5 99              1564 	mov	sbuf0,a
   04D8 02s06r60           1565 	ljmp	setupack
   04DB                    1566 cmdnotd3:
                           1567 	;; 0xd4
   04DB B4 D4 49           1568 	cjne	a,#0xd4,cmdnotd4
   04DE 90 7F E8           1569 	mov	dptr,#SETUPDAT	; bRequestType == 0xc0
   04E1 E0                 1570 	movx	a,@dptr
   04E2 B4 C0 3F           1571 	cjne	a,#0xc0,setupstalld4
   04E5 90 7F EC           1572 	mov	dptr,#SETUPDAT+4	; wIndex
   04E8 E0                 1573 	movx	a,@dptr
   04E9 90 7F EA           1574 	mov	dptr,#SETUPDAT+2	; wValue
   04EC B4 01 09           1575 	cjne	a,#1,0$
   04EF E0                 1576 	movx	a,@dptr
   04F0 90 C0 0D           1577 	mov	dptr,#AUDIOMDISCOUT
   04F3 F0                 1578 	movx	@dptr,a
   04F4 F5*21              1579 	mov	mdiscout,a
   04F6 80 0A              1580 	sjmp	1$
   04F8 B4 02 07           1581 0$:	cjne	a,#2,1$
   04FB E0                 1582 	movx	a,@dptr
   04FC 90 C0 0C           1583 	mov	dptr,#AUDIOMDISCTRIS
   04FF F0                 1584 	movx	@dptr,a
   0500 F5*20              1585 	mov	mdisctris,a
   0502 90 C0 0E           1586 1$:	mov	dptr,#AUDIOMDISCIN
   0505 E0                 1587 	movx	a,@dptr
   0506 90 7F 00           1588 	mov	dptr,#IN0BUF+0
   0509 F0                 1589 	movx	@dptr,a
   050A E5*21              1590 	mov	a,mdiscout
   050C A3                 1591 	inc	dptr
   050D F0                 1592 	movx	@dptr,a
   050E E5*20              1593 	mov	a,mdisctris
   0510 A3                 1594 	inc	dptr
   0511 F0                 1595 	movx	@dptr,a
                           1596 	;; length
   0512 90 7F EE           1597 	mov	dptr,#SETUPDAT+6	; wLength
   0515 E0                 1598 	movx	a,@dptr
   0516 24 FD              1599 	add	a,#-3
   0518 50 01              1600 	jnc	2$
   051A E4                 1601 	clr	a
   051B 24 03              1602 2$:	add	a,#3
   051D 90 7F B5           1603 	mov	dptr,#IN0BC
   0520 F0                 1604 	movx	@dptr,a
   0521 02s06r60           1605 	ljmp	setupack
   0524                    1606 setupstalld4:
   0524 02s06r5C           1607 	ljmp	setupstall
   0527                    1608 cmdnotd4:
                           1609 	;; 0xd5
   0527 B4 D5 3F           1610 	cjne	a,#0xd5,cmdnotd5
   052A 90 7F E8           1611 	mov	dptr,#SETUPDAT	; bRequestType == 0xc0
   052D E0                 1612 	movx	a,@dptr
   052E B4 C0 32           1613 	cjne	a,#0xc0,setupstalld5
   0531 90 7F EC           1614 	mov	dptr,#SETUPDAT+4	; wIndex
   0534 E0                 1615 	movx	a,@dptr
   0535 B4 01 0A           1616 	cjne	a,#1,0$
   0538 90 7F EA           1617 	mov	dptr,#SETUPDAT+2	; wValue
   053B E0                 1618 	movx	a,@dptr
   053C 90 C0 0A           1619 	mov	dptr,#AUDIOT7FOUT
   053F F0                 1620 	movx	@dptr,a
   0540 F5*1F              1621 	mov	t7fout,a
   0542 90 C0 0B           1622 0$:	mov	dptr,#AUDIOT7FIN
   0545 E0                 1623 	movx	a,@dptr
   0546 90 7F 00           1624 	mov	dptr,#IN0BUF+0
   0549 F0                 1625 	movx	@dptr,a
   054A E5*1F              1626 	mov	a,t7fout
   054C A3                 1627 	inc	dptr
   054D 90 7F 01           1628 	mov	dptr,#IN0BUF+1
   0550 F0                 1629 	movx	@dptr,a
                           1630 	;; length
   0551 90 7F EE           1631 	mov	dptr,#SETUPDAT+6	; wLength
   0554 E0                 1632 	movx	a,@dptr
   0555 24 FE              1633 	add	a,#-2
   0557 50 01              1634 	jnc	2$
   0559 E4                 1635 	clr	a
   055A 24 02              1636 2$:	add	a,#2
   055C 90 7F B5           1637 	mov	dptr,#IN0BC
   055F F0                 1638 	movx	@dptr,a
   0560 02s06r60           1639 	ljmp	setupack
   0563                    1640 setupstalld5:
   0563                    1641 setupstalle0:
   0563 02s06r5C           1642 	ljmp	setupstall
   0566                    1643 cmdnote0_0:
   0566 02s05rFC           1644 	ljmp    cmdnote0
   0569                    1645 cmdnotd5:
                           1646 	;; 0xe0
   0569 B4 E0 FA           1647 	cjne	a,#0xe0,cmdnote0_0
   056C 90 7F E8           1648 	mov	dptr,#SETUPDAT		; bRequestType == 0xc0
   056F E0                 1649 	movx	a,@dptr
   0570 B4 C0 F0           1650 	cjne	a,#0xc0,setupstalle0
                           1651 	;; set PTT, LED's and counter mode
   0573 90 7F EC           1652 	mov	dptr,#SETUPDAT+4	; wIndex
   0576 E0                 1653 	movx	a,@dptr
   0577 B4 01 12           1654 	cjne	a,#1,1$
   057A 90 7F EA           1655 	mov	dptr,#SETUPDAT+2	; wValue
   057D E0                 1656 	movx	a,@dptr
   057E 54 78              1657 	anl	a,#0x78
   0580 C5 20              1658 	xch	a,ctrlreg
   0582 54 07              1659 	anl	a,#0x07
   0584 45 20              1660 	orl	a,ctrlreg
   0586 F5 20              1661 	mov	ctrlreg,a
   0588 90 C0 08           1662 	mov	dptr,#AUDIOCTRL
   058B F0                 1663 	movx	@dptr,a
   058C 90 7F EE           1664 1$:	mov	dptr,#SETUPDAT+6	; wLength
   058F E0                 1665 	movx	a,@dptr
   0590 60 0D              1666 	jz	3$
   0592 B4 01 11           1667 	cjne	a,#1,2$
   0595 E5 20              1668 	mov	a,ctrlreg
   0597 90 7F 00           1669 	mov	dptr,#IN0BUF
   059A 54 7F              1670 	anl	a,#0x7f
   059C F0                 1671 	movx	@dptr,a
   059D 74 01              1672 	mov	a,#1
   059F 90 7F B5           1673 3$:	mov	dptr,#IN0BC
   05A2 F0                 1674 	movx	@dptr,a
   05A3 02s06r60           1675 	ljmp	setupack
   05A6 90 C0 08           1676 2$:	mov	dptr,#AUDIOCTRL
   05A9 D2*07              1677 	setb	ctrl_cntsel
   05AB E5 20              1678 	mov	a,ctrlreg
   05AD F0                 1679 	movx	@dptr,a
   05AE 90 C0 05           1680 	mov	dptr,#AUDIOCNTLOW
   05B1 E0                 1681 	movx	a,@dptr
   05B2 90 7F 04           1682 	mov	dptr,#IN0BUF+4
   05B5 F0                 1683 	movx	@dptr,a
   05B6 90 C0 06           1684 	mov	dptr,#AUDIOCNTMID
   05B9 E0                 1685 	movx	a,@dptr
   05BA 90 7F 05           1686 	mov	dptr,#IN0BUF+5
   05BD F0                 1687 	movx	@dptr,a
   05BE 90 C0 07           1688 	mov	dptr,#AUDIOCNTHIGH
   05C1 E0                 1689 	movx	a,@dptr
   05C2 90 7F 06           1690 	mov	dptr,#IN0BUF+6
   05C5 F0                 1691 	movx	@dptr,a
   05C6 90 C0 08           1692 	mov	dptr,#AUDIOCTRL
   05C9 C2*07              1693 	clr	ctrl_cntsel
   05CB E5 20              1694 	mov	a,ctrlreg
   05CD F0                 1695 	movx	@dptr,a
   05CE 90 7F 00           1696 	mov	dptr,#IN0BUF
   05D1 F0                 1697 	movx	@dptr,a
   05D2 90 C0 05           1698 	mov	dptr,#AUDIOCNTLOW
   05D5 E0                 1699 	movx	a,@dptr
   05D6 90 7F 01           1700 	mov	dptr,#IN0BUF+1
   05D9 F0                 1701 	movx	@dptr,a
   05DA 90 C0 06           1702 	mov	dptr,#AUDIOCNTMID
   05DD E0                 1703 	movx	a,@dptr
   05DE 90 7F 02           1704 	mov	dptr,#IN0BUF+2
   05E1 F0                 1705 	movx	@dptr,a
   05E2 90 C0 07           1706 	mov	dptr,#AUDIOCNTHIGH
   05E5 E0                 1707 	movx	a,@dptr
   05E6 90 7F 03           1708 	mov	dptr,#IN0BUF+3
   05E9 F0                 1709 	movx	@dptr,a
                           1710 	;; length
   05EA 90 7F EE           1711 	mov	dptr,#SETUPDAT+6	; wLength
   05ED E0                 1712 	movx	a,@dptr
   05EE 24 F9              1713 	add	a,#-7
   05F0 50 01              1714 	jnc	4$
   05F2 E4                 1715 	clr	a
   05F3 24 07              1716 4$:	add	a,#7
   05F5 90 7F B5           1717 	mov	dptr,#IN0BC
   05F8 F0                 1718 	movx	@dptr,a
   05F9 02s06r60           1719 	ljmp	setupack
   05FC                    1720 cmdnote0:
                           1721 	;; 0xe1
   05FC B4 E1 3A           1722 	cjne	a,#0xe1,cmdnote1
   05FF 90 7F E8           1723 	mov	dptr,#SETUPDAT		; bRequestType == 0xc0
   0602 E0                 1724 	movx	a,@dptr
   0603 B4 C0 30           1725 	cjne	a,#0xc0,setupstalle1
   0606 90 7F 00           1726 	mov	dptr,#IN0BUF
   0609 E5*05              1727 	mov	a,sofcount
   060B F0                 1728 	movx	@dptr,a
   060C A3                 1729 	inc	dptr
   060D E5*09              1730 	mov	a,framesize
   060F F0                 1731 	movx	@dptr,a
   0610 A3                 1732 	inc	dptr
   0611 E5*06              1733 	mov	a,divider
   0613 F0                 1734 	movx	@dptr,a
   0614 A3                 1735 	inc	dptr
   0615 E5*07              1736 	mov	a,divider+1
   0617 F0                 1737 	movx	@dptr,a
   0618 A3                 1738 	inc	dptr
   0619 E5*08              1739 	mov	a,divrel
   061B F0                 1740 	movx	@dptr,a
   061C A3                 1741 	inc	dptr
   061D E5*0A              1742 	mov	a,pllcorrvar
   061F F0                 1743 	movx	@dptr,a
   0620 A3                 1744 	inc	dptr
   0621 E5*0B              1745 	mov	a,txfifocount
   0623 F0                 1746 	movx	@dptr,a
                           1747 
                           1748 	;mov	dptr,#AUDIOTXFIFOCNT
                           1749 	;movx	a,@dptr
                           1750 	;mov	dptr,#IN0BUF+6
                           1751 	;movx	@dptr,a
                           1752 
                           1753 	;; length
   0624 90 7F EE           1754 	mov	dptr,#SETUPDAT+6	; wLength
   0627 E0                 1755 	movx	a,@dptr
   0628 24 F9              1756 	add	a,#-7
   062A 50 01              1757 	jnc	1$
   062C E4                 1758 	clr	a
   062D 24 07              1759 1$:	add	a,#7
   062F 90 7F B5           1760 	mov	dptr,#IN0BC
   0632 F0                 1761 	movx	@dptr,a
   0633 02s06r60           1762 	ljmp	setupack
   0636                    1763 setupstalle1:
   0636 02s06r5C           1764 	ljmp	setupstall
   0639                    1765 cmdnote1:
                           1766 	;; 0xe2
   0639 B4 E2 20           1767 	cjne	a,#0xe2,cmdnote2
   063C 90 7F E8           1768 	mov	dptr,#SETUPDAT		; bRequestType == 0xc0
   063F E0                 1769 	movx	a,@dptr
   0640 B4 C0 16           1770 	cjne	a,#0xc0,setupstalle2
   0643 90 7F 00           1771 	mov	dptr,#IN0BUF
   0646 78r00              1772 	mov	r0,#txsamples
   0648 AF*09              1773 	mov	r7,framesize
   064A E6                 1774 1$:	mov	a,@r0
   064B F0                 1775 	movx	@dptr,a
   064C 08                 1776 	inc	r0
   064D A3                 1777 	inc	dptr
   064E DF FA              1778 	djnz	r7,1$
   0650 90 7F B5           1779 	mov	dptr,#IN0BC
   0653 E5*09              1780 	mov	a,framesize
   0655 F0                 1781 	movx	@dptr,a
   0656 02s06r60           1782 	ljmp	setupack
   0659                    1783 setupstalle2:
   0659 02s06r5C           1784 	ljmp	setupstall
   065C                    1785 cmdnote2:
                           1786 
                           1787 	;; unknown commands fall through to setupstall
                           1788 
   065C                    1789 setupstall:
   065C 74 03              1790 	mov	a,#3
   065E 80 02              1791 	sjmp	endsetup
   0660                    1792 setupack:
   0660 74 02              1793 	mov	a,#2
   0662                    1794 endsetup:
   0662 90 7F B4           1795 	mov	dptr,#EP0CS
   0665 F0                 1796 	movx	@dptr,a
   0666                    1797 endusbisr:
                           1798 	;; epilogue
   0666 D0 07              1799 	pop	ar7
   0668 D0 00              1800 	pop	ar0
   066A D0 86              1801 	pop	dps
   066C D0 D0              1802 	pop	psw
   066E D0 85              1803 	pop	dph1
   0670 D0 84              1804 	pop	dpl1
   0672 D0 83              1805 	pop	dph0
   0674 D0 82              1806 	pop	dpl0
   0676 D0 F0              1807 	pop	b
   0678 D0 E0              1808 	pop	acc
   067A 32                 1809 	reti
                           1810 
   067B                    1811 usb_sof_isr:
   067B C0 E0              1812 	push	acc
   067D C0 F0              1813 	push	b
   067F C0 82              1814 	push	dpl0
   0681 C0 83              1815 	push	dph0
   0683 C0 84              1816 	push	dpl1
   0685 C0 85              1817 	push	dph1
   0687 C0 D0              1818 	push	psw
   0689 75 D0 00           1819 	mov	psw,#0x00
   068C C0 86              1820 	push	dps
   068E 75 86 00           1821 	mov	dps,#0
   0691 C0 02              1822 	push	ar2
   0693 C0 03              1823 	push	ar3
   0695 C0 00              1824 	push	ar0
                           1825 	;; clear interrupt
   0697 E5 91              1826 	mov	a,exif
   0699 C2 E4              1827 	clr	acc.4
   069B F5 91              1828 	mov	exif,a
   069D 90 7F AB           1829 	mov	dptr,#USBIRQ
   06A0 74 02              1830 	mov	a,#0x02
   06A2 F0                 1831 	movx	@dptr,a
                           1832 	;; handle interrupt
   06A3 05*05              1833 	inc	sofcount
                           1834 	;; debugging: we have two cases
                           1835 	;; if the ISO frame size is just 2 bytes,
                           1836 	;; we return the frame number, otherwise
                           1837 	;; the required numbers of samples
   06A5 E5*09              1838 	mov	a,framesize
   06A7 B4 02 14           1839 	cjne	a,#2,1$
                           1840 	;; copy the frame number
   06AA 90 7F D8           1841 	mov	dptr,#USBFRAMEL
   06AD E0                 1842 	movx	a,@dptr
   06AE A3                 1843 	inc	dptr
   06AF 05 86              1844 	inc	dps
   06B1 90 7F 68           1845 	mov	dptr,#IN8DATA
   06B4 F0                 1846 	movx	@dptr,a
   06B5 15 86              1847 	dec	dps
   06B7 E0                 1848 	movx	a,@dptr
   06B8 05 86              1849 	inc	dps
   06BA F0                 1850 	movx	@dptr,a
   06BB 02s07rAE           1851 	ljmp	sofendisr
   06BE B4 03 36           1852 1$:	cjne	a,#3,sofsampleisr
   06C1 90 7F A0           1853 	mov	dptr,#ISOERR
   06C4 E0                 1854 	movx	a,@dptr
   06C5 20 E0 23           1855 	jb	acc.0,3$
   06C8 90 7F 70           1856 	mov	dptr,#OUT8BCH
   06CB E0                 1857 	movx	a,@dptr
   06CC 70 1D              1858 	jnz	3$
   06CE 90 7F 71           1859 	mov	dptr,#OUT8BCL
   06D1 E0                 1860 	movx	a,@dptr
   06D2 B4 03 16           1861 	cjne	a,#3,3$
   06D5 FA                 1862 	mov	r2,a
   06D6 90 7F 60           1863 	mov	dptr,#OUT8DATA
   06D9 05 86              1864 	inc	dps
   06DB 90 7F 68           1865 	mov	dptr,#IN8DATA
   06DE 15 86              1866 	dec	dps
   06E0 E0                 1867 2$:	movx	a,@dptr
   06E1 05 86              1868 	inc	dps
   06E3 F0                 1869 	movx	@dptr,a
   06E4 15 86              1870 	dec	dps
   06E6 DA F8              1871 	djnz	r2,2$
   06E8 02s07rAE           1872 	ljmp	sofendisr
   06EB 7A 03              1873 3$:	mov	r2,#3
   06ED 90 7F 68           1874 	mov	dptr,#IN8DATA
   06F0 E4                 1875 	clr	a
   06F1 F0                 1876 4$:	movx	@dptr,a
   06F2 DA FD              1877 	djnz	r2,4$
   06F4 02s07rAE           1878 	ljmp	sofendisr
   06F7                    1879 sofsampleisr:
   06F7 90 C0 01           1880 	mov	dptr,#AUDIORXFIFOCNT
   06FA E0                 1881 	movx	a,@dptr
   06FB C3                 1882 	clr	c
   06FC 95*09              1883 	subb	a,framesize
   06FE E0                 1884 	movx	a,@dptr
   06FF 40 02              1885 	jc	1$
   0701 E5*09              1886 	mov	a,framesize
   0703 FA                 1887 1$:	mov	r2,a
   0704 FB                 1888 	mov	r3,a
   0705 60 12              1889 	jz	2$
   0707 90 C0 00           1890 	mov	dptr,#AUDIORXFIFO
   070A 05 86              1891 	inc	dps
   070C 90 7F 68           1892 	mov	dptr,#IN8DATA
   070F 15 86              1893 	dec	dps
   0711 E0                 1894 3$:	movx	a,@dptr
   0712 05 86              1895 	inc	dps
   0714 F0                 1896 	movx	@dptr,a
   0715 15 86              1897 	dec	dps
   0717 DA F8              1898 	djnz	r2,3$
   0719 E5*09              1899 2$:	mov	a,framesize
   071B C3                 1900 	clr	c
   071C 9B                 1901 	subb	a,r3
   071D 60 08              1902 	jz	4$
   071F FA                 1903 	mov	r2,a
   0720 90 7F 68           1904 	mov	dptr,#IN8DATA
   0723 E4                 1905 	clr	a
   0724 F0                 1906 5$:	movx	@dptr,a
   0725 DA FD              1907 	djnz	r2,5$
                           1908 	;; sample rate adjustment
   0727 90 C0 01           1909 4$:	mov	dptr,#AUDIORXFIFOCNT
   072A E0                 1910 	movx	a,@dptr
   072B F5*0A              1911 	mov	pllcorrvar,a
   072D 24 FC              1912 	add	a,#-4
   072F 60 05              1913 	jz	10$		; no adjustment
   0731 33                 1914 	rlc	a
   0732 95 E0              1915 	subb	a,acc
   0734 D2 E0              1916 	setb	acc.0
   0736 FB                 1917 10$:	mov	r3,a		; r3 & acc contain the adjust value
   0737 25*08              1918 	add	a,divrel
                           1919 	;; zero is the guard value
   0739 60 02              1920 	jz	11$
   073B F5*08              1921 	mov	divrel,a
   073D E5*08              1922 11$:	mov	a,divrel
   073F 03                 1923 	rr	a
   0740 03                 1924 	rr	a
   0741 03                 1925 	rr	a
   0742 03                 1926 	rr	a
   0743 54 0F              1927 	anl	a,#0xf
   0745 2B                 1928 	add	a,r3		; momentary correction
   0746 25*06              1929 	add	a,divider
   0748 FA                 1930 	mov	r2,a
   0749 E5*07              1931 	mov	a,divider+1
   074B 34 00              1932 	addc	a,#0
   074D 90 C0 02           1933 	mov	dptr,#AUDIODIVIDERHI
   0750 F0                 1934 	movx	@dptr,a
   0751 EA                 1935 	mov	a,r2
   0752 90 C0 01           1936 	mov	dptr,#AUDIODIVIDERLO
   0755 F0                 1937 	movx	@dptr,a
                           1938 	;; OUT data
   0756 90 7F A0           1939 	mov	dptr,#ISOERR
   0759 E0                 1940 	movx	a,@dptr
   075A 20 E0 39           1941 	jb	acc.0,20$
   075D 90 7F 70           1942 	mov	dptr,#OUT8BCH
   0760 E0                 1943 	movx	a,@dptr
   0761 70 33              1944 	jnz	20$
   0763 90 7F 71           1945 	mov	dptr,#OUT8BCL
   0766 E0                 1946 	movx	a,@dptr
   0767 C3                 1947 	clr	c
   0768 95*09              1948 	subb	a,framesize
   076A 70 2A              1949 	jnz	20$
   076C 90 C0 02           1950 	mov	dptr,#AUDIOTXFIFOCNT
   076F E0                 1951 	movx	a,@dptr
   0770 F5*0B              1952 	mov	txfifocount,a
   0772 C3                 1953 	clr	c
   0773 95*09              1954 	subb	a,framesize
   0775 E5*0B              1955 	mov	a,txfifocount
   0777 40 02              1956 	jc	14$
   0779 E5*09              1957 	mov	a,framesize
   077B 60 17              1958 14$:	jz	13$
   077D FA                 1959 	mov	r2,a
   077E 90 7F 60           1960 	mov	dptr,#OUT8DATA
   0781 05 86              1961 	inc	dps
   0783 90 C0 00           1962 	mov	dptr,#AUDIOTXFIFO
   0786 15 86              1963 	dec	dps
   0788 78r00              1964 	mov	r0,#txsamples
   078A E0                 1965 12$:	movx	a,@dptr
   078B 05 86              1966 	inc	dps
   078D F0                 1967 	movx	@dptr,a
   078E 15 86              1968 	dec	dps
   0790 F6                 1969 	mov	@r0,a
   0791 08                 1970 	inc	r0
   0792 DA F6              1971 	djnz	r2,12$
   0794 80 18              1972 13$:	sjmp	sofendisr
                           1973 	;; initialize TX if invalid packet
   0796 90 C0 02           1974 20$:	mov	dptr,#AUDIOTXFIFOCNT
   0799 E0                 1975 	movx	a,@dptr
   079A F5*0B              1976 	mov	txfifocount,a
   079C 24 FC              1977 	add	a,#-4
   079E 54 3F              1978 	anl	a,#0x3f
   07A0 60 0C              1979 	jz	sofendisr
   07A2 FA                 1980 	mov	r2,a
   07A3 90 C0 00           1981 	mov	dptr,#AUDIOTXFIFO
   07A6 E4                 1982 	clr	a
   07A7 78r00              1983 	mov	r0,#txsamples
   07A9 F0                 1984 21$:	movx	@dptr,a
   07AA F6                 1985 	mov	@r0,a
   07AB 08                 1986 	inc	r0
   07AC DA FB              1987 	djnz	r2,21$
                           1988 	
   07AE                    1989 sofendisr:
                           1990 	;; epilogue
   07AE D0 00              1991 	pop	ar0
   07B0 D0 03              1992 	pop	ar3
   07B2 D0 02              1993 	pop	ar2
   07B4 D0 86              1994 	pop	dps
   07B6 D0 D0              1995 	pop	psw
   07B8 D0 85              1996 	pop	dph1
   07BA D0 84              1997 	pop	dpl1
   07BC D0 83              1998 	pop	dph0
   07BE D0 82              1999 	pop	dpl0
   07C0 D0 F0              2000 	pop	b
   07C2 D0 E0              2001 	pop	acc
   07C4 32                 2002 	reti
                           2003 
                           2004 
   07C5                    2005 usb_sutok_isr:
   07C5 C0 E0              2006 	push	acc
   07C7 C0 F0              2007 	push	b
   07C9 C0 82              2008 	push	dpl0
   07CB C0 83              2009 	push	dph0
   07CD C0 D0              2010 	push	psw
   07CF 75 D0 00           2011 	mov	psw,#0x00
   07D2 C0 86              2012 	push	dps
   07D4 75 86 00           2013 	mov	dps,#0
                           2014 	;; clear interrupt
   07D7 E5 91              2015 	mov	a,exif
   07D9 C2 E4              2016 	clr	acc.4
   07DB F5 91              2017 	mov	exif,a
   07DD 90 7F AB           2018 	mov	dptr,#USBIRQ
   07E0 74 04              2019 	mov	a,#0x04
   07E2 F0                 2020 	movx	@dptr,a
                           2021 	;; handle interrupt
                           2022 	;; epilogue
   07E3 D0 86              2023 	pop	dps
   07E5 D0 D0              2024 	pop	psw
   07E7 D0 83              2025 	pop	dph0
   07E9 D0 82              2026 	pop	dpl0
   07EB D0 F0              2027 	pop	b
   07ED D0 E0              2028 	pop	acc
   07EF 32                 2029 	reti
                           2030 
   07F0                    2031 usb_suspend_isr:
   07F0 C0 E0              2032 	push	acc
   07F2 C0 F0              2033 	push	b
   07F4 C0 82              2034 	push	dpl0
   07F6 C0 83              2035 	push	dph0
   07F8 C0 D0              2036 	push	psw
   07FA 75 D0 00           2037 	mov	psw,#0x00
   07FD C0 86              2038 	push	dps
   07FF 75 86 00           2039 	mov	dps,#0
                           2040 	;; clear interrupt
   0802 E5 91              2041 	mov	a,exif
   0804 C2 E4              2042 	clr	acc.4
   0806 F5 91              2043 	mov	exif,a
   0808 90 7F AB           2044 	mov	dptr,#USBIRQ
   080B 74 08              2045 	mov	a,#0x08
   080D F0                 2046 	movx	@dptr,a
                           2047 	;; handle interrupt
                           2048 	;; epilogue
   080E D0 86              2049 	pop	dps
   0810 D0 D0              2050 	pop	psw
   0812 D0 83              2051 	pop	dph0
   0814 D0 82              2052 	pop	dpl0
   0816 D0 F0              2053 	pop	b
   0818 D0 E0              2054 	pop	acc
   081A 32                 2055 	reti
                           2056 
   081B                    2057 usb_usbreset_isr:
   081B C0 E0              2058 	push	acc
   081D C0 F0              2059 	push	b
   081F C0 82              2060 	push	dpl0
   0821 C0 83              2061 	push	dph0
   0823 C0 D0              2062 	push	psw
   0825 75 D0 00           2063 	mov	psw,#0x00
   0828 C0 86              2064 	push	dps
   082A 75 86 00           2065 	mov	dps,#0
                           2066 	;; clear interrupt
   082D E5 91              2067 	mov	a,exif
   082F C2 E4              2068 	clr	acc.4
   0831 F5 91              2069 	mov	exif,a
   0833 90 7F AB           2070 	mov	dptr,#USBIRQ
   0836 74 10              2071 	mov	a,#0x10
   0838 F0                 2072 	movx	@dptr,a
                           2073 	;; handle interrupt
                           2074 	;; epilogue
   0839 D0 86              2075 	pop	dps
   083B D0 D0              2076 	pop	psw
   083D D0 83              2077 	pop	dph0
   083F D0 82              2078 	pop	dpl0
   0841 D0 F0              2079 	pop	b
   0843 D0 E0              2080 	pop	acc
   0845 32                 2081 	reti
                           2082 
   0846                    2083 usb_ep0in_isr:
   0846 C0 E0              2084 	push	acc
   0848 C0 F0              2085 	push	b
   084A C0 82              2086 	push	dpl0
   084C C0 83              2087 	push	dph0
   084E C0 84              2088 	push	dpl1
   0850 C0 85              2089 	push	dph1
   0852 C0 D0              2090 	push	psw
   0854 75 D0 00           2091 	mov	psw,#0x00
   0857 C0 86              2092 	push	dps
   0859 75 86 00           2093 	mov	dps,#0
   085C C0 00              2094 	push	ar0
   085E C0 07              2095 	push	ar7
                           2096 	;; clear interrupt
   0860 E5 91              2097 	mov	a,exif
   0862 C2 E4              2098 	clr	acc.4
   0864 F5 91              2099 	mov	exif,a
   0866 90 7F A9           2100 	mov	dptr,#IN07IRQ
   0869 74 01              2101 	mov	a,#0x01
   086B F0                 2102 	movx	@dptr,a
                           2103 	;; handle interrupt
                           2104 	;; epilogue
   086C D0 07              2105 	pop	ar7
   086E D0 00              2106 	pop	ar0
   0870 D0 86              2107 	pop	dps
   0872 D0 D0              2108 	pop	psw
   0874 D0 85              2109 	pop	dph1
   0876 D0 84              2110 	pop	dpl1
   0878 D0 83              2111 	pop	dph0
   087A D0 82              2112 	pop	dpl0
   087C D0 F0              2113 	pop	b
   087E D0 E0              2114 	pop	acc
   0880 32                 2115 	reti
                           2116 
   0881                    2117 usb_ep0out_isr:
   0881 C0 E0              2118 	push	acc
   0883 C0 F0              2119 	push	b
   0885 C0 82              2120 	push	dpl0
   0887 C0 83              2121 	push	dph0
   0889 C0 84              2122 	push	dpl1
   088B C0 85              2123 	push	dph1
   088D C0 D0              2124 	push	psw
   088F 75 D0 00           2125 	mov	psw,#0x00
   0892 C0 86              2126 	push	dps
   0894 75 86 00           2127 	mov	dps,#0
   0897 C0 00              2128 	push	ar0
   0899 C0 06              2129 	push	ar6
                           2130 	;; clear interrupt
   089B E5 91              2131 	mov	a,exif
   089D C2 E4              2132 	clr	acc.4
   089F F5 91              2133 	mov	exif,a
   08A1 90 7F AA           2134 	mov	dptr,#OUT07IRQ
   08A4 74 01              2135 	mov	a,#0x01
   08A6 F0                 2136 	movx	@dptr,a
                           2137 	;; handle interrupt
                           2138 	;; epilogue
   08A7 D0 06              2139 	pop	ar6
   08A9 D0 00              2140 	pop	ar0
   08AB D0 86              2141 	pop	dps
   08AD D0 D0              2142 	pop	psw
   08AF D0 85              2143 	pop	dph1
   08B1 D0 84              2144 	pop	dpl1
   08B3 D0 83              2145 	pop	dph0
   08B5 D0 82              2146 	pop	dpl0
   08B7 D0 F0              2147 	pop	b
   08B9 D0 E0              2148 	pop	acc
   08BB 32                 2149 	reti
                           2150 
   08BC                    2151 fillusbintr::
   08BC E5*0C              2152 	mov	a,pttforce
   08BE F5 F0              2153 	mov	b,a
   08C0 A2 E0              2154 	mov	c,acc.0
   08C2 92 F2              2155 	mov	b.2,c
   08C4 90 C0 09           2156 	mov	dptr,#AUDIOSTAT
   08C7 E0                 2157 	movx	a,@dptr
   08C8 A2 E0              2158 	mov	c,acc.0
   08CA 92 F3              2159 	mov	b.3,c
   08CC A2*09              2160 	mov	c,uartempty
   08CE 92 F5              2161 	mov	b.5,c
                           2162 	;; bytewide elements
   08D0 90 7E 80           2163 	mov	dptr,#(IN1BUF)
   08D3 E5 F0              2164 	mov	a,b
   08D5 F0                 2165 	movx	@dptr,a
   08D6 E5*05              2166 	mov	a,sofcount
   08D8 90 7E 81           2167 	mov	dptr,#(IN1BUF+1)
   08DB F0                 2168 	movx	@dptr,a
   08DC 90 7F E0           2169 	mov	dptr,#INISOVAL
   08DF E0                 2170 	movx	a,@dptr
   08E0 90 7E 82           2171 	mov	dptr,#(IN1BUF+2)
   08E3 F0                 2172 	movx	@dptr,a
   08E4 90 C0 04           2173 	mov	dptr,#AUDIORSSI
   08E7 E0                 2174 	movx	a,@dptr
   08E8 90 7E 83           2175 	mov	dptr,#(IN1BUF+3)
   08EB F0                 2176 	movx	@dptr,a
                           2177 	; counter
   08EC 05*04              2178 	inc	irqcount
   08EE E5*04              2179 	mov	a,irqcount
   08F0 90 7E 84           2180 	mov	dptr,#(IN1BUF+4)
   08F3 F0                 2181 	movx	@dptr,a
                           2182 	; UART buffer
   08F4 75 F0 05           2183 	mov	b,#5
   08F7 90 7E 85           2184 	mov	dptr,#(IN1BUF+5)
   08FA E5*1E              2185 2$:	mov	a,uartrd
   08FC B5*1D 07           2186 	cjne	a,uartwr,3$
                           2187 	; set length
   08FF 90 7F B7           2188 	mov	dptr,#IN1BC
   0902 E5 F0              2189 	mov	a,b
   0904 F0                 2190 	movx	@dptr,a
   0905 22                 2191 	ret
                           2192 	
   0906 24r0D              2193 3$:	add	a,#uartbuf
   0908 F8                 2194 	mov	r0,a
   0909 E6                 2195 	mov	a,@r0
   090A F0                 2196 	movx	@dptr,a
   090B A3                 2197 	inc	dptr
   090C 05 F0              2198 	inc	b
   090E E5*1E              2199 	mov	a,uartrd
   0910 04                 2200 	inc	a
   0911 54 0F              2201 	anl	a,#0xf
   0913 F5*1E              2202 	mov	uartrd,a
   0915 80 E3              2203 	sjmp	2$
                           2204 
                           2205 	
   0917                    2206 usb_ep1in_isr:
   0917 C0 E0              2207 	push	acc
   0919 C0 F0              2208 	push	b
   091B C0 82              2209 	push	dpl0
   091D C0 83              2210 	push	dph0
   091F C0 D0              2211 	push	psw
   0921 75 D0 00           2212 	mov	psw,#0x00
   0924 C0 86              2213 	push	dps
   0926 75 86 00           2214 	mov	dps,#0
                           2215 	;; clear interrupt
   0929 E5 91              2216 	mov	a,exif
   092B C2 E4              2217 	clr	acc.4
   092D F5 91              2218 	mov	exif,a
   092F 90 7F A9           2219 	mov	dptr,#IN07IRQ
   0932 74 02              2220 	mov	a,#0x02
   0934 F0                 2221 	movx	@dptr,a
                           2222 	;; handle interrupt
   0935 12s08rBC           2223 	lcall	fillusbintr
                           2224 	;; epilogue
   0938 D0 86              2225 	pop	dps
   093A D0 D0              2226 	pop	psw
   093C D0 83              2227 	pop	dph0
   093E D0 82              2228 	pop	dpl0
   0940 D0 F0              2229 	pop	b
   0942 D0 E0              2230 	pop	acc
   0944 32                 2231 	reti
                           2232 
   0945                    2233 usb_ep1out_isr:
   0945 C0 E0              2234 	push	acc
   0947 C0 F0              2235 	push	b
   0949 C0 82              2236 	push	dpl0
   094B C0 83              2237 	push	dph0
   094D C0 D0              2238 	push	psw
   094F 75 D0 00           2239 	mov	psw,#0x00
   0952 C0 86              2240 	push	dps
   0954 75 86 00           2241 	mov	dps,#0
                           2242 	;; clear interrupt
   0957 E5 91              2243 	mov	a,exif
   0959 C2 E4              2244 	clr	acc.4
   095B F5 91              2245 	mov	exif,a
   095D 90 7F AA           2246 	mov	dptr,#OUT07IRQ
   0960 74 02              2247 	mov	a,#0x02
   0962 F0                 2248 	movx	@dptr,a
                           2249 	;; handle interrupt
                           2250 	;; epilogue
   0963 D0 86              2251 	pop	dps
   0965 D0 D0              2252 	pop	psw
   0967 D0 83              2253 	pop	dph0
   0969 D0 82              2254 	pop	dpl0
   096B D0 F0              2255 	pop	b
   096D D0 E0              2256 	pop	acc
   096F 32                 2257 	reti
                           2258 
   0970                    2259 usb_ep2in_isr:
   0970 C0 E0              2260 	push	acc
   0972 C0 F0              2261 	push	b
   0974 C0 82              2262 	push	dpl0
   0976 C0 83              2263 	push	dph0
   0978 C0 D0              2264 	push	psw
   097A 75 D0 00           2265 	mov	psw,#0x00
   097D C0 86              2266 	push	dps
   097F 75 86 00           2267 	mov	dps,#0
                           2268 	;; clear interrupt
   0982 E5 91              2269 	mov	a,exif
   0984 C2 E4              2270 	clr	acc.4
   0986 F5 91              2271 	mov	exif,a
   0988 90 7F A9           2272 	mov	dptr,#IN07IRQ
   098B 74 04              2273 	mov	a,#0x04
   098D F0                 2274 	movx	@dptr,a
                           2275 	;; handle interrupt
                           2276 	;; epilogue
   098E D0 86              2277 	pop	dps
   0990 D0 D0              2278 	pop	psw
   0992 D0 83              2279 	pop	dph0
   0994 D0 82              2280 	pop	dpl0
   0996 D0 F0              2281 	pop	b
   0998 D0 E0              2282 	pop	acc
   099A 32                 2283 	reti
                           2284 
   099B                    2285 usb_ep2out_isr:
   099B C0 E0              2286 	push	acc
   099D C0 F0              2287 	push	b
   099F C0 82              2288 	push	dpl0
   09A1 C0 83              2289 	push	dph0
   09A3 C0 D0              2290 	push	psw
   09A5 75 D0 00           2291 	mov	psw,#0x00
   09A8 C0 86              2292 	push	dps
   09AA 75 86 00           2293 	mov	dps,#0
                           2294 	;; clear interrupt
   09AD E5 91              2295 	mov	a,exif
   09AF C2 E4              2296 	clr	acc.4
   09B1 F5 91              2297 	mov	exif,a
   09B3 90 7F AA           2298 	mov	dptr,#OUT07IRQ
   09B6 74 04              2299 	mov	a,#0x04
   09B8 F0                 2300 	movx	@dptr,a
                           2301 	;; handle interrupt
                           2302 	;; epilogue
   09B9 D0 86              2303 	pop	dps
   09BB D0 D0              2304 	pop	psw
   09BD D0 83              2305 	pop	dph0
   09BF D0 82              2306 	pop	dpl0
   09C1 D0 F0              2307 	pop	b
   09C3 D0 E0              2308 	pop	acc
   09C5 32                 2309 	reti
                           2310 
   09C6                    2311 usb_ep3in_isr:
   09C6 C0 E0              2312 	push	acc
   09C8 C0 F0              2313 	push	b
   09CA C0 82              2314 	push	dpl0
   09CC C0 83              2315 	push	dph0
   09CE C0 D0              2316 	push	psw
   09D0 75 D0 00           2317 	mov	psw,#0x00
   09D3 C0 86              2318 	push	dps
   09D5 75 86 00           2319 	mov	dps,#0
                           2320 	;; clear interrupt
   09D8 E5 91              2321 	mov	a,exif
   09DA C2 E4              2322 	clr	acc.4
   09DC F5 91              2323 	mov	exif,a
   09DE 90 7F A9           2324 	mov	dptr,#IN07IRQ
   09E1 74 08              2325 	mov	a,#0x08
   09E3 F0                 2326 	movx	@dptr,a
                           2327 	;; handle interrupt
                           2328 	;; epilogue
   09E4 D0 86              2329 	pop	dps
   09E6 D0 D0              2330 	pop	psw
   09E8 D0 83              2331 	pop	dph0
   09EA D0 82              2332 	pop	dpl0
   09EC D0 F0              2333 	pop	b
   09EE D0 E0              2334 	pop	acc
   09F0 32                 2335 	reti
                           2336 
   09F1                    2337 usb_ep3out_isr:
   09F1 C0 E0              2338 	push	acc
   09F3 C0 F0              2339 	push	b
   09F5 C0 82              2340 	push	dpl0
   09F7 C0 83              2341 	push	dph0
   09F9 C0 D0              2342 	push	psw
   09FB 75 D0 00           2343 	mov	psw,#0x00
   09FE C0 86              2344 	push	dps
   0A00 75 86 00           2345 	mov	dps,#0
                           2346 	;; clear interrupt
   0A03 E5 91              2347 	mov	a,exif
   0A05 C2 E4              2348 	clr	acc.4
   0A07 F5 91              2349 	mov	exif,a
   0A09 90 7F AA           2350 	mov	dptr,#OUT07IRQ
   0A0C 74 08              2351 	mov	a,#0x08
   0A0E F0                 2352 	movx	@dptr,a
                           2353 	;; handle interrupt
                           2354 	;; epilogue
   0A0F D0 86              2355 	pop	dps
   0A11 D0 D0              2356 	pop	psw
   0A13 D0 83              2357 	pop	dph0
   0A15 D0 82              2358 	pop	dpl0
   0A17 D0 F0              2359 	pop	b
   0A19 D0 E0              2360 	pop	acc
   0A1B 32                 2361 	reti
                           2362 
   0A1C                    2363 usb_ep4in_isr:
   0A1C C0 E0              2364 	push	acc
   0A1E C0 F0              2365 	push	b
   0A20 C0 82              2366 	push	dpl0
   0A22 C0 83              2367 	push	dph0
   0A24 C0 D0              2368 	push	psw
   0A26 75 D0 00           2369 	mov	psw,#0x00
   0A29 C0 86              2370 	push	dps
   0A2B 75 86 00           2371 	mov	dps,#0
                           2372 	;; clear interrupt
   0A2E E5 91              2373 	mov	a,exif
   0A30 C2 E4              2374 	clr	acc.4
   0A32 F5 91              2375 	mov	exif,a
   0A34 90 7F A9           2376 	mov	dptr,#IN07IRQ
   0A37 74 10              2377 	mov	a,#0x10
   0A39 F0                 2378 	movx	@dptr,a
                           2379 	;; handle interrupt
                           2380 	;; epilogue
   0A3A D0 86              2381 	pop	dps
   0A3C D0 D0              2382 	pop	psw
   0A3E D0 83              2383 	pop	dph0
   0A40 D0 82              2384 	pop	dpl0
   0A42 D0 F0              2385 	pop	b
   0A44 D0 E0              2386 	pop	acc
   0A46 32                 2387 	reti
                           2388 
   0A47                    2389 usb_ep4out_isr:
   0A47 C0 E0              2390 	push	acc
   0A49 C0 F0              2391 	push	b
   0A4B C0 82              2392 	push	dpl0
   0A4D C0 83              2393 	push	dph0
   0A4F C0 D0              2394 	push	psw
   0A51 75 D0 00           2395 	mov	psw,#0x00
   0A54 C0 86              2396 	push	dps
   0A56 75 86 00           2397 	mov	dps,#0
                           2398 	;; clear interrupt
   0A59 E5 91              2399 	mov	a,exif
   0A5B C2 E4              2400 	clr	acc.4
   0A5D F5 91              2401 	mov	exif,a
   0A5F 90 7F AA           2402 	mov	dptr,#OUT07IRQ
   0A62 74 10              2403 	mov	a,#0x10
   0A64 F0                 2404 	movx	@dptr,a
                           2405 	;; handle interrupt
                           2406 	;; epilogue
   0A65 D0 86              2407 	pop	dps
   0A67 D0 D0              2408 	pop	psw
   0A69 D0 83              2409 	pop	dph0
   0A6B D0 82              2410 	pop	dpl0
   0A6D D0 F0              2411 	pop	b
   0A6F D0 E0              2412 	pop	acc
   0A71 32                 2413 	reti
                           2414 
   0A72                    2415 usb_ep5in_isr:
   0A72 C0 E0              2416 	push	acc
   0A74 C0 F0              2417 	push	b
   0A76 C0 82              2418 	push	dpl0
   0A78 C0 83              2419 	push	dph0
   0A7A C0 D0              2420 	push	psw
   0A7C 75 D0 00           2421 	mov	psw,#0x00
   0A7F C0 86              2422 	push	dps
   0A81 75 86 00           2423 	mov	dps,#0
                           2424 	;; clear interrupt
   0A84 E5 91              2425 	mov	a,exif
   0A86 C2 E4              2426 	clr	acc.4
   0A88 F5 91              2427 	mov	exif,a
   0A8A 90 7F A9           2428 	mov	dptr,#IN07IRQ
   0A8D 74 20              2429 	mov	a,#0x20
   0A8F F0                 2430 	movx	@dptr,a
                           2431 	;; handle interrupt
                           2432 	;; epilogue
   0A90 D0 86              2433 	pop	dps
   0A92 D0 D0              2434 	pop	psw
   0A94 D0 83              2435 	pop	dph0
   0A96 D0 82              2436 	pop	dpl0
   0A98 D0 F0              2437 	pop	b
   0A9A D0 E0              2438 	pop	acc
   0A9C 32                 2439 	reti
                           2440 
   0A9D                    2441 usb_ep5out_isr:
   0A9D C0 E0              2442 	push	acc
   0A9F C0 F0              2443 	push	b
   0AA1 C0 82              2444 	push	dpl0
   0AA3 C0 83              2445 	push	dph0
   0AA5 C0 D0              2446 	push	psw
   0AA7 75 D0 00           2447 	mov	psw,#0x00
   0AAA C0 86              2448 	push	dps
   0AAC 75 86 00           2449 	mov	dps,#0
                           2450 	;; clear interrupt
   0AAF E5 91              2451 	mov	a,exif
   0AB1 C2 E4              2452 	clr	acc.4
   0AB3 F5 91              2453 	mov	exif,a
   0AB5 90 7F AA           2454 	mov	dptr,#OUT07IRQ
   0AB8 74 20              2455 	mov	a,#0x20
   0ABA F0                 2456 	movx	@dptr,a
                           2457 	;; handle interrupt
                           2458 	;; epilogue
   0ABB D0 86              2459 	pop	dps
   0ABD D0 D0              2460 	pop	psw
   0ABF D0 83              2461 	pop	dph0
   0AC1 D0 82              2462 	pop	dpl0
   0AC3 D0 F0              2463 	pop	b
   0AC5 D0 E0              2464 	pop	acc
   0AC7 32                 2465 	reti
                           2466 
   0AC8                    2467 usb_ep6in_isr:
   0AC8 C0 E0              2468 	push	acc
   0ACA C0 F0              2469 	push	b
   0ACC C0 82              2470 	push	dpl0
   0ACE C0 83              2471 	push	dph0
   0AD0 C0 D0              2472 	push	psw
   0AD2 75 D0 00           2473 	mov	psw,#0x00
   0AD5 C0 86              2474 	push	dps
   0AD7 75 86 00           2475 	mov	dps,#0
                           2476 	;; clear interrupt
   0ADA E5 91              2477 	mov	a,exif
   0ADC C2 E4              2478 	clr	acc.4
   0ADE F5 91              2479 	mov	exif,a
   0AE0 90 7F A9           2480 	mov	dptr,#IN07IRQ
   0AE3 74 40              2481 	mov	a,#0x40
   0AE5 F0                 2482 	movx	@dptr,a
                           2483 	;; handle interrupt
                           2484 	;; epilogue
   0AE6 D0 86              2485 	pop	dps
   0AE8 D0 D0              2486 	pop	psw
   0AEA D0 83              2487 	pop	dph0
   0AEC D0 82              2488 	pop	dpl0
   0AEE D0 F0              2489 	pop	b
   0AF0 D0 E0              2490 	pop	acc
   0AF2 32                 2491 	reti
                           2492 
   0AF3                    2493 usb_ep6out_isr:
   0AF3 C0 E0              2494 	push	acc
   0AF5 C0 F0              2495 	push	b
   0AF7 C0 82              2496 	push	dpl0
   0AF9 C0 83              2497 	push	dph0
   0AFB C0 D0              2498 	push	psw
   0AFD 75 D0 00           2499 	mov	psw,#0x00
   0B00 C0 86              2500 	push	dps
   0B02 75 86 00           2501 	mov	dps,#0
                           2502 	;; clear interrupt
   0B05 E5 91              2503 	mov	a,exif
   0B07 C2 E4              2504 	clr	acc.4
   0B09 F5 91              2505 	mov	exif,a
   0B0B 90 7F AA           2506 	mov	dptr,#OUT07IRQ
   0B0E 74 40              2507 	mov	a,#0x40
   0B10 F0                 2508 	movx	@dptr,a
                           2509 	;; handle interrupt
                           2510 	;; epilogue
   0B11 D0 86              2511 	pop	dps
   0B13 D0 D0              2512 	pop	psw
   0B15 D0 83              2513 	pop	dph0
   0B17 D0 82              2514 	pop	dpl0
   0B19 D0 F0              2515 	pop	b
   0B1B D0 E0              2516 	pop	acc
   0B1D 32                 2517 	reti
                           2518 
   0B1E                    2519 usb_ep7in_isr:
   0B1E C0 E0              2520 	push	acc
   0B20 C0 F0              2521 	push	b
   0B22 C0 82              2522 	push	dpl0
   0B24 C0 83              2523 	push	dph0
   0B26 C0 D0              2524 	push	psw
   0B28 75 D0 00           2525 	mov	psw,#0x00
   0B2B C0 86              2526 	push	dps
   0B2D 75 86 00           2527 	mov	dps,#0
                           2528 	;; clear interrupt
   0B30 E5 91              2529 	mov	a,exif
   0B32 C2 E4              2530 	clr	acc.4
   0B34 F5 91              2531 	mov	exif,a
   0B36 90 7F A9           2532 	mov	dptr,#IN07IRQ
   0B39 74 80              2533 	mov	a,#0x80
   0B3B F0                 2534 	movx	@dptr,a
                           2535 	;; handle interrupt
                           2536 	;; epilogue
   0B3C D0 86              2537 	pop	dps
   0B3E D0 D0              2538 	pop	psw
   0B40 D0 83              2539 	pop	dph0
   0B42 D0 82              2540 	pop	dpl0
   0B44 D0 F0              2541 	pop	b
   0B46 D0 E0              2542 	pop	acc
   0B48 32                 2543 	reti
                           2544 
   0B49                    2545 usb_ep7out_isr:
   0B49 C0 E0              2546 	push	acc
   0B4B C0 F0              2547 	push	b
   0B4D C0 82              2548 	push	dpl0
   0B4F C0 83              2549 	push	dph0
   0B51 C0 D0              2550 	push	psw
   0B53 75 D0 00           2551 	mov	psw,#0x00
   0B56 C0 86              2552 	push	dps
   0B58 75 86 00           2553 	mov	dps,#0
                           2554 	;; clear interrupt
   0B5B E5 91              2555 	mov	a,exif
   0B5D C2 E4              2556 	clr	acc.4
   0B5F F5 91              2557 	mov	exif,a
   0B61 90 7F AA           2558 	mov	dptr,#OUT07IRQ
   0B64 74 80              2559 	mov	a,#0x80
   0B66 F0                 2560 	movx	@dptr,a
                           2561 	;; handle interrupt
                           2562 	;; epilogue
   0B67 D0 86              2563 	pop	dps
   0B69 D0 D0              2564 	pop	psw
   0B6B D0 83              2565 	pop	dph0
   0B6D D0 82              2566 	pop	dpl0
   0B6F D0 F0              2567 	pop	b
   0B71 D0 E0              2568 	pop	acc
   0B73 32                 2569 	reti
                           2570 	
                           2571 	;; -----------------------------------------------------
                           2572 	;; USB descriptors
                           2573 	;; -----------------------------------------------------
                           2574 
                           2575 	;; Device and/or Interface Class codes
                    0000   2576 	USB_CLASS_PER_INTERFACE         = 0
                    0001   2577 	USB_CLASS_AUDIO                 = 1
                    0002   2578 	USB_CLASS_COMM                  = 2
                    0003   2579 	USB_CLASS_HID                   = 3
                    0007   2580 	USB_CLASS_PRINTER               = 7
                    0008   2581 	USB_CLASS_MASS_STORAGE          = 8
                    0009   2582 	USB_CLASS_HUB                   = 9
                    00FF   2583 	USB_CLASS_VENDOR_SPEC           = 0xff
                           2584 
                    0001   2585 	USB_SUBCLASS_AUDIOCONTROL	= 1
                    0002   2586 	USB_SUBCLASS_AUDIOSTREAMING	= 2
                           2587 	
                           2588 	;; Descriptor types
                    0001   2589 	USB_DT_DEVICE                   = 0x01
                    0002   2590 	USB_DT_CONFIG                   = 0x02
                    0003   2591 	USB_DT_STRING                   = 0x03
                    0004   2592 	USB_DT_INTERFACE                = 0x04
                    0005   2593 	USB_DT_ENDPOINT                 = 0x05
                           2594 
                           2595 	;; Audio Class descriptor types
                    0020   2596 	USB_DT_AUDIO_UNDEFINED		= 0x20
                    0021   2597 	USB_DT_AUDIO_DEVICE		= 0x21
                    0022   2598 	USB_DT_AUDIO_CONFIG		= 0x22
                    0023   2599 	USB_DT_AUDIO_STRING		= 0x23
                    0024   2600 	USB_DT_AUDIO_INTERFACE		= 0x24
                    0025   2601 	USB_DT_AUDIO_ENDPOINT		= 0x25
                           2602 
                    0000   2603 	USB_SDT_AUDIO_UNDEFINED		= 0x00
                    0001   2604 	USB_SDT_AUDIO_HEADER		= 0x01
                    0002   2605 	USB_SDT_AUDIO_INPUT_TERMINAL	= 0x02
                    0003   2606 	USB_SDT_AUDIO_OUTPUT_TERMINAL	= 0x03
                    0004   2607 	USB_SDT_AUDIO_MIXER_UNIT	= 0x04
                    0005   2608 	USB_SDT_AUDIO_SELECTOR_UNIT	= 0x05
                    0006   2609 	USB_SDT_AUDIO_FEATURE_UNIT	= 0x06
                    0007   2610 	USB_SDT_AUDIO_PROCESSING_UNIT	= 0x07
                    0008   2611 	USB_SDT_AUDIO_EXTENSION_UNIT	= 0x08
                           2612 	
                           2613 	;; Standard requests
                    0000   2614 	USB_REQ_GET_STATUS              = 0x00
                    0001   2615 	USB_REQ_CLEAR_FEATURE           = 0x01
                    0003   2616 	USB_REQ_SET_FEATURE             = 0x03
                    0005   2617 	USB_REQ_SET_ADDRESS             = 0x05
                    0006   2618 	USB_REQ_GET_DESCRIPTOR          = 0x06
                    0007   2619 	USB_REQ_SET_DESCRIPTOR          = 0x07
                    0008   2620 	USB_REQ_GET_CONFIGURATION       = 0x08
                    0009   2621 	USB_REQ_SET_CONFIGURATION       = 0x09
                    000A   2622 	USB_REQ_GET_INTERFACE           = 0x0A
                    000B   2623 	USB_REQ_SET_INTERFACE           = 0x0B
                    000C   2624 	USB_REQ_SYNCH_FRAME             = 0x0C
                           2625 
                           2626 	;; Audio Class Requests
                    0001   2627 	USB_REQ_AUDIO_SET_CUR		= 0x01
                    0081   2628 	USB_REQ_AUDIO_GET_CUR		= 0x81
                    0002   2629 	USB_REQ_AUDIO_SET_MIN		= 0x02
                    0082   2630 	USB_REQ_AUDIO_GET_MIN		= 0x82
                    0003   2631 	USB_REQ_AUDIO_SET_MAX		= 0x03
                    0083   2632 	USB_REQ_AUDIO_GET_MAX		= 0x83
                    0004   2633 	USB_REQ_AUDIO_SET_RES		= 0x04
                    0084   2634 	USB_REQ_AUDIO_GET_RES		= 0x84
                    0005   2635 	USB_REQ_AUDIO_SET_MEM		= 0x05
                    0085   2636 	USB_REQ_AUDIO_GET_MEM		= 0x85
                    00FF   2637 	USB_REQ_AUDIO_GET_STAT		= 0xff
                           2638 	
                           2639 	;; USB Request Type and Endpoint Directions
                    0000   2640 	USB_DIR_OUT                     = 0
                    0080   2641 	USB_DIR_IN                      = 0x80
                           2642 
                    0000   2643 	USB_TYPE_STANDARD               = (0x00 << 5)
                    0020   2644 	USB_TYPE_CLASS                  = (0x01 << 5)
                    0040   2645 	USB_TYPE_VENDOR                 = (0x02 << 5)
                    0060   2646 	USB_TYPE_RESERVED               = (0x03 << 5)
                           2647 
                    0000   2648 	USB_RECIP_DEVICE                = 0x00
                    0001   2649 	USB_RECIP_INTERFACE             = 0x01
                    0002   2650 	USB_RECIP_ENDPOINT              = 0x02
                    0003   2651 	USB_RECIP_OTHER                 = 0x03
                           2652 
                           2653 	;; Request target types.
                    0000   2654 	USB_RT_DEVICE                   = 0x00
                    0001   2655 	USB_RT_INTERFACE                = 0x01
                    0002   2656 	USB_RT_ENDPOINT                 = 0x02
                           2657 
                    BAC0   2658 	VENDID	= 0xbac0
                    6137   2659 	PRODID	= 0x6137
                           2660 
   0B74                    2661 devicedescr:
   0B74 12                 2662 	.db	18			; bLength
   0B75 01                 2663 	.db	USB_DT_DEVICE		; bDescriptorType
   0B76 00 01              2664 	.db	0x00, 0x01		; bcdUSB
   0B78 00                 2665 	.db	USB_CLASS_PER_INTERFACE	; bDeviceClass
   0B79 00                 2666 	.db	0			; bDeviceSubClass
   0B7A 00                 2667 	.db	0x00			; bDeviceProtocol
   0B7B 40                 2668 	.db	0x40			; bMaxPacketSize0
   0B7C C0 BA              2669 	.db	<VENDID,>VENDID		; idVendor
   0B7E 37 61              2670 	.db	<PRODID,>PRODID		; idProduct
   0B80 01 00              2671 	.db	0x01,0x00		; bcdDevice
   0B82 01                 2672 	.db	1			; iManufacturer
   0B83 02                 2673 	.db	2			; iProduct
   0B84 03                 2674 	.db	3			; iSerialNumber
   0B85 01                 2675 	.db	1			; bNumConfigurations
                           2676 
   0B86                    2677 config0descr:
   0B86 09                 2678 	.db	9			; bLength
   0B87 02                 2679 	.db	USB_DT_CONFIG		; bDescriptorType
   0B88 CE 00              2680 	.db	<config0sz,>config0sz	; wTotalLength
   0B8A 04                 2681 	.db	4			; bNumInterfaces
   0B8B 01                 2682 	.db	1			; bConfigurationValue
   0B8C 00                 2683 	.db	0			; iConfiguration
   0B8D 40                 2684 	.db	0b01000000		; bmAttributs (self powered)
   0B8E 00                 2685 	.db	0			; MaxPower (mA/2) (self powered so 0)
                           2686 	;; standard packet interface (needed so the driver can hook to it)
                           2687 	;; interface descriptor I0:A0
   0B8F 09                 2688 	.db	9			; bLength
   0B90 04                 2689 	.db	USB_DT_INTERFACE	; bDescriptorType
   0B91 00                 2690 	.db	0			; bInterfaceNumber
   0B92 00                 2691 	.db	0			; bAlternateSetting
   0B93 01                 2692 	.db	1			; bNumEndpoints
   0B94 FF                 2693 	.db	0xff			; bInterfaceClass (vendor specific)
   0B95 00                 2694 	.db	0x00			; bInterfaceSubClass
   0B96 FF                 2695 	.db	0xff			; bInterfaceProtocol (vendor specific)
   0B97 00                 2696 	.db	0			; iInterface
                           2697 	;; endpoint descriptor I0:A0:E0
   0B98 07                 2698 	.db	7			; bLength
   0B99 05                 2699 	.db	USB_DT_ENDPOINT		; bDescriptorType
   0B9A 81                 2700 	.db	(USB_DIR_IN | 1)	; bEndpointAddress
   0B9B 02                 2701 	.db	0x02			; bmAttributes (bulk)
   0B9C 40 00              2702 	.db	0x40,0x00		; wMaxPacketSize
   0B9E 00                 2703 	.db	0			; bInterval
                           2704 	;; interface descriptor I0:A1
   0B9F 09                 2705 	.db	9			; bLength
   0BA0 04                 2706 	.db	USB_DT_INTERFACE	; bDescriptorType
   0BA1 00                 2707 	.db	0			; bInterfaceNumber
   0BA2 01                 2708 	.db	1			; bAlternateSetting
   0BA3 01                 2709 	.db	1			; bNumEndpoints
   0BA4 FF                 2710 	.db	0xff			; bInterfaceClass (vendor specific)
   0BA5 00                 2711 	.db	0x00			; bInterfaceSubClass
   0BA6 FF                 2712 	.db	0xff			; bInterfaceProtocol (vendor specific)
   0BA7 00                 2713 	.db	0			; iInterface
                           2714 	;; endpoint descriptor I0:A1:E0
   0BA8 07                 2715 	.db	7			; bLength
   0BA9 05                 2716 	.db	USB_DT_ENDPOINT		; bDescriptorType
   0BAA 81                 2717 	.db	(USB_DIR_IN | 1)	; bEndpointAddress
   0BAB 03                 2718 	.db	0x03			; bmAttributes (interrupt)
   0BAC 40 00              2719 	.db	0x40,0x00		; wMaxPacketSize
   0BAE 08                 2720 	.db	8			; bInterval
                           2721 	;; interface descriptor I1:A0
   0BAF 09                 2722 	.db	9			; bLength
   0BB0 04                 2723 	.db	USB_DT_INTERFACE	; bDescriptorType
   0BB1 01                 2724 	.db	1			; bInterfaceNumber
   0BB2 00                 2725 	.db	0			; bAlternateSetting
   0BB3 00                 2726 	.db	0			; bNumEndpoints (only control endpoint)
   0BB4 01                 2727 	.db	USB_CLASS_AUDIO		; bInterfaceClass (audio)
   0BB5 01                 2728 	.db	USB_SUBCLASS_AUDIOCONTROL ; bInterfaceSubClass
   0BB6 00                 2729 	.db	0x00			; bInterfaceProtocol (none)
   0BB7 00                 2730 	.db	0			; iInterface
   0BB8                    2731 acctrl:
                           2732 	;; class specific audio interface descriptor I1:A0
   0BB8 0A                 2733 	.db	10			; bLength
   0BB9 24                 2734 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0BBA 01                 2735 	.db	USB_SDT_AUDIO_HEADER	; bDescriptorSubtype
   0BBB 00 01              2736 	.db	0x00,0x01		; bcdADC (Audio Class Spec Revision 1.0)
   0BBD 34 00              2737 	.db	<acctrlsz,>acctrlsz	; wTotalLength (Audio Class specific desctiptors)
   0BBF 02                 2738 	.db	2			; bInCollection (number of streaming interfaces)
   0BC0 02                 2739 	.db	2			; baInterfaceNr0 (number of AudioStreaming interface)
   0BC1 03                 2740 	.db	3			; baInterfaceNr1 (number of AudioStreaming interface)
                           2741 	;; audio input terminal descriptor
   0BC2 0C                 2742 	.db	12			; bLength
   0BC3 24                 2743 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0BC4 02                 2744 	.db	USB_SDT_AUDIO_INPUT_TERMINAL ; bDescriptorSubtype
   0BC5 01                 2745 	.db	1			; bTerminalID
   0BC6 10 07              2746 	.db	0x10,0x07		; wTerminalType (Radio Receiver)
   0BC8 00                 2747 	.db	0			; bAssocTerminal (none)
   0BC9 01                 2748 	.db	1			; bNrChannels (one channel)
   0BCA 00 00              2749 	.db	0,0			; wChannelConfig (mono has no position bits)
   0BCC 00                 2750 	.db	0			; iChannelNames
   0BCD 00                 2751 	.db	0			; iTerminal
                           2752 	;; audio output terminal descriptor
   0BCE 09                 2753 	.db	9			; bLength
   0BCF 24                 2754 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0BD0 03                 2755 	.db	USB_SDT_AUDIO_OUTPUT_TERMINAL ; bDescriptorSubtype
   0BD1 02                 2756 	.db	2			; bTerminalID
   0BD2 11 07              2757 	.db	0x11,0x07		; wTerminalType (Radio Transmitter)
   0BD4 00                 2758 	.db	0			; bAssocTerminal (none)
   0BD5 03                 2759 	.db	3			; bSourceID
   0BD6 00                 2760 	.db	0			; iTerminal
                           2761 	;; USB input terminal descriptor
   0BD7 0C                 2762 	.db	12			; bLength
   0BD8 24                 2763 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0BD9 02                 2764 	.db	USB_SDT_AUDIO_INPUT_TERMINAL ; bDescriptorSubtype
   0BDA 03                 2765 	.db	3			; bTerminalID
   0BDB 01 01              2766 	.db	0x01,0x01		; wTerminalType (USB streaming)
   0BDD 00                 2767 	.db	0			; bAssocTerminal (none)
   0BDE 01                 2768 	.db	1			; bNrChannels (one channel)
   0BDF 00 00              2769 	.db	0,0			; wChannelConfig (mono has no position bits)
   0BE1 00                 2770 	.db	0			; iChannelNames
   0BE2 00                 2771 	.db	0			; iTerminal
                           2772 	;; USB output terminal descriptor
   0BE3 09                 2773 	.db	9			; bLength
   0BE4 24                 2774 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0BE5 03                 2775 	.db	USB_SDT_AUDIO_OUTPUT_TERMINAL ; bDescriptorSubtype
   0BE6 04                 2776 	.db	4			; bTerminalID
   0BE7 01 01              2777 	.db	0x01,0x01		; wTerminalType (USB streaming)
   0BE9 00                 2778 	.db	0			; bAssocTerminal (none)
   0BEA 01                 2779 	.db	1			; bSourceID
   0BEB 00                 2780 	.db	0			; iTerminal
                    0034   2781 acctrlsz = . - acctrl
                           2782 	;; interface descriptor I2:A0
   0BEC 09                 2783 	.db	9			; bLength
   0BED 04                 2784 	.db	USB_DT_INTERFACE	; bDescriptorType
   0BEE 02                 2785 	.db	2			; bInterfaceNumber
   0BEF 00                 2786 	.db	0			; bAlternateSetting
   0BF0 00                 2787 	.db	0			; bNumEndpoints (use control endpoint only)
   0BF1 01                 2788 	.db	USB_CLASS_AUDIO		; bInterfaceClass (audio)
   0BF2 02                 2789 	.db	USB_SUBCLASS_AUDIOSTREAMING ; bInterfaceSubClass
   0BF3 00                 2790 	.db	0x00			; bInterfaceProtocol (none)
   0BF4 00                 2791 	.db	0			; iInterface
                           2792 	;; interface descriptor I2:A1
   0BF5 09                 2793 	.db	9			; bLength
   0BF6 04                 2794 	.db	USB_DT_INTERFACE	; bDescriptorType
   0BF7 02                 2795 	.db	2			; bInterfaceNumber
   0BF8 01                 2796 	.db	1			; bAlternateSetting
   0BF9 01                 2797 	.db	1			; bNumEndpoints
   0BFA 01                 2798 	.db	USB_CLASS_AUDIO		; bInterfaceClass (audio)
   0BFB 02                 2799 	.db	USB_SUBCLASS_AUDIOSTREAMING ; bInterfaceSubClass
   0BFC 00                 2800 	.db	0x00			; bInterfaceProtocol (none)
   0BFD 00                 2801 	.db	0			; iInterface
                           2802 	;.db	1,0			; wNumClasses
                           2803 	;; audio class specific general interface descriptor I2:A1
   0BFE 07                 2804 	.db	7			; bLength
   0BFF 24                 2805 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0C00 01                 2806 	.db	0x01			; bDescriptorSubtype (general)
   0C01 04                 2807 	.db	4			; bTerminalLink
   0C02 01                 2808 	.db	1			; bDelay (in frames)
   0C03 01 00              2809 	.db	1,0			; wFormatTag (PCM)
                           2810 	;; audio class specific format type I interface descriptor I2:A1
   0C05 0B                 2811 	.db	11			; bLength
   0C06 24                 2812 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0C07 02                 2813 	.db	0x02			; bDescriptorSubtype (format type)
   0C08 01                 2814 	.db	0x01			; bFormatType (1)
   0C09 01                 2815 	.db	1			; bNrChannels
   0C0A 01                 2816 	.db	1			; bSubFrameSize
   0C0B 08                 2817 	.db	8			; bBitResolution
   0C0C 01                 2818 	.db	1			; bSamFreqType (one sampling frequency supported)
   0C0D                    2819 descinsrate:	
   0C0D 00 00 00           2820 	.db	0,0,0			; tSamFreq
                           2821 	;; endpoint descriptor I2:A1:E0
   0C10 09                 2822 	.db	9			; bLength
   0C11 05                 2823 	.db	USB_DT_ENDPOINT		; bDescriptorType
   0C12 88                 2824 	.db	(USB_DIR_IN | 8)	; bEndpointAddress
   0C13 01                 2825 	.db	0x01			; bmAttributes (iso)
   0C14                    2826 descinframesize:
   0C14 02 00              2827 	.db	0x02,0x00		; wMaxPacketSize
   0C16 01                 2828 	.db	1			; bInterval
   0C17 00                 2829 	.db	0			; bRefresh
   0C18 00                 2830 	.db	0			; bSynchAddress
                           2831 	;; audio class specific endpoint descriptor I2:A1:E0
   0C19 07                 2832 	.db	7			; bLength
   0C1A 25                 2833 	.db	USB_DT_AUDIO_ENDPOINT	; bDescriptorType
   0C1B 01                 2834 	.db	1			; bDescriptorSubtype (general)
   0C1C 00                 2835 	.db	0			; bmAttributes (no sampling rate control etc.)
   0C1D 00                 2836 	.db	0			; bLockDelayUnits
   0C1E 00 00              2837 	.db	0,0			; wLockDelay
                           2838 	;; interface descriptor I3:A0
   0C20 09                 2839 	.db	9			; bLength
   0C21 04                 2840 	.db	USB_DT_INTERFACE	; bDescriptorType
   0C22 03                 2841 	.db	3			; bInterfaceNumber
   0C23 00                 2842 	.db	0			; bAlternateSetting
   0C24 00                 2843 	.db	0			; bNumEndpoints (use control endpoint only)
   0C25 01                 2844 	.db	USB_CLASS_AUDIO		; bInterfaceClass (audio)
   0C26 02                 2845 	.db	USB_SUBCLASS_AUDIOSTREAMING ; bInterfaceSubClass
   0C27 00                 2846 	.db	0x00			; bInterfaceProtocol (none)
   0C28 00                 2847 	.db	0			; iInterface
                           2848 	;; interface descriptor I3:A1
   0C29 09                 2849 	.db	9			; bLength
   0C2A 04                 2850 	.db	USB_DT_INTERFACE	; bDescriptorType
   0C2B 03                 2851 	.db	3			; bInterfaceNumber
   0C2C 01                 2852 	.db	1			; bAlternateSetting
   0C2D 01                 2853 	.db	1			; bNumEndpoints
   0C2E 01                 2854 	.db	USB_CLASS_AUDIO		; bInterfaceClass (audio)
   0C2F 02                 2855 	.db	USB_SUBCLASS_AUDIOSTREAMING ; bInterfaceSubClass
   0C30 00                 2856 	.db	0x00			; bInterfaceProtocol (none)
   0C31 00                 2857 	.db	0			; iInterface
                           2858 	;.db	1,0			; wNumClasses
                           2859 	;; audio class specific general interface descriptor I3:A1
   0C32 07                 2860 	.db	7			; bLength
   0C33 24                 2861 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0C34 01                 2862 	.db	0x01			; bDescriptorSubtype (general)
   0C35 03                 2863 	.db	3			; bTerminalLink
   0C36 01                 2864 	.db	1			; bDelay (in frames)
   0C37 01 00              2865 	.db	1,0			; wFormatTag (PCM)
                           2866 	;; audio class specific format type I interface descriptor I3:A1
   0C39 0B                 2867 	.db	11			; bLength
   0C3A 24                 2868 	.db	USB_DT_AUDIO_INTERFACE	; bDescriptorType
   0C3B 02                 2869 	.db	0x02			; bDescriptorSubtype (format type)
   0C3C 01                 2870 	.db	0x01			; bFormatType (1)
   0C3D 01                 2871 	.db	1			; bNrChannels
   0C3E 01                 2872 	.db	1			; bSubFrameSize
   0C3F 08                 2873 	.db	8			; bBitResolution
   0C40 01                 2874 	.db	1			; bSamFreqType (one sampling frequency supported)
   0C41                    2875 descoutsrate:
   0C41 00 00 00           2876 	.db	0,0,0			; tSamFreq
                           2877 	;; endpoint descriptor I3:A1:E0
   0C44 09                 2878 	.db	9			; bLength
   0C45 05                 2879 	.db	USB_DT_ENDPOINT		; bDescriptorType
   0C46 08                 2880 	.db	(USB_DIR_OUT | 8)	; bEndpointAddress
   0C47 01                 2881 	.db	0x01			; bmAttributes (iso)
   0C48                    2882 descoutframesize:
   0C48 02 00              2883 	.db	0x02,0x00		; wMaxPacketSize
   0C4A 01                 2884 	.db	1			; bInterval
   0C4B 00                 2885 	.db	0			; bRefresh
   0C4C 00                 2886 	.db	0			; bSynchAddress
                           2887 	;; audio class specific endpoint descriptor I3:A1:E0
   0C4D 07                 2888 	.db	7			; bLength
   0C4E 25                 2889 	.db	USB_DT_AUDIO_ENDPOINT	; bDescriptorType
   0C4F 01                 2890 	.db	1			; bDescriptorSubtype (general)
   0C50 00                 2891 	.db	0			; bmAttributes (no sampling rate control etc.)
   0C51 00                 2892 	.db	0			; bLockDelayUnits
   0C52 00 00              2893 	.db	0,0			; wLockDelay
                    00CE   2894 config0sz = . - config0descr
                           2895 
   0C54                    2896 stringdescr:
   0C54r5Cs0C              2897 	.db	<string0,>string0
   0C56r60s0C              2898 	.db	<string1,>string1
   0C58r6Es0C              2899 	.db	<string2,>string2
   0C5Ar8Es0C              2900 	.db	<stringserial,>stringserial
                           2901 
                    0004   2902 numstrings = (. - stringdescr)/2
                           2903 
   0C5C                    2904 string0:
   0C5C 04                 2905 	.db	string0sz		; bLength
   0C5D 03                 2906 	.db	USB_DT_STRING		; bDescriptorType
   0C5E 00 00              2907 	.db	0,0			; LANGID[0]: Lang Neutral
                    0004   2908 string0sz = . - string0
                           2909 
   0C60                    2910 string1:
   0C60 0E                 2911 	.db	string1sz		; bLength
   0C61 03                 2912 	.db	USB_DT_STRING		; bDescriptorType
   0C62 42 00 61 00 79 00  2913 	.db	'B,0,'a,0,'y,0,'c,0,'o,0,'m,0
        63 00 6F 00 6D 00
                    000E   2914 string1sz = . - string1
                           2915 
   0C6E                    2916 string2:
   0C6E 20                 2917 	.db	string2sz		; bLength
   0C6F 03                 2918 	.db	USB_DT_STRING		; bDescriptorType
   0C70 55 00 53 00 42 00  2919 	.db	'U,0,'S,0,'B,0,'F,0,'L,0,'E,0,'X,0,' ,0
        46 00 4C 00 45 00
        58 00 20 00
   0C80 28 00 41 00 75 00  2920 	.db	'(,0,'A,0,'u,0,'d,0,'i,0,'o,0,'),0
        64 00 69 00 6F 00
        29 00
                    0020   2921 string2sz = . - string2
                           2922 	
   0C8E                    2923 stringserial:
   0C8E 02                 2924 	.db	2			; bLength
   0C8F 03                 2925 	.db	USB_DT_STRING		; bDescriptorType
   0C90 00 00 00 00 00 00  2926 	.dw	0,0,0,0,0,0,0,0
        00 00 00 00 00 00
        00 00 00 00
   0CA0 00 00 00 00 00 00  2927 	.dw	0,0,0,0,0,0,0,0
        00 00 00 00 00 00
        00 00 00 00
                           2928 
