
_USB1Interrupt:
	PUSH	DSWPAG
	PUSH	50
	PUSH	RCOUNT
	PUSH	W0
	MOV	#2, W0
	REPEAT	#12
	PUSH	[W0++]

;HID_Read_Write.c,31 :: 		void USB1Interrupt() iv IVT_ADDR_USB1INTERRUPT{
;HID_Read_Write.c,32 :: 		USB_Interrupt_Proc();
	CALL	_USB_Interrupt_Proc
;HID_Read_Write.c,33 :: 		}
L_end_USB1Interrupt:
	MOV	#26, W0
	REPEAT	#12
	POP	[W0--]
	POP	W0
	POP	RCOUNT
	POP	50
	POP	DSWPAG
	RETFIE
; end of _USB1Interrupt

_main:
	MOV	#2048, W15
	MOV	#6142, W0
	MOV	WREG, 32
	MOV	#1, W0
	MOV	WREG, 50
	MOV	#4, W0
	IOR	68
	LNK	#2

;HID_Read_Write.c,35 :: 		void main(void){
;HID_Read_Write.c,36 :: 		int Count = 0;
	PUSH	W10
	PUSH	W11
	MOV	#0, W0
	MOV	W0, [W14+0]
;HID_Read_Write.c,37 :: 		TRISB.RB0 = 0; PORTB.RB0 = 0;
	BCLR	TRISB, #0
	BCLR	PORTB, #0
;HID_Read_Write.c,39 :: 		PLLFBD = 70;             // PLL multiplier M=70
	MOV	#70, W0
	MOV	WREG, PLLFBD
;HID_Read_Write.c,40 :: 		CLKDIV = 0x0000;         // PLL prescaler N1=2, PLL postscaler N2=2
	CLR	CLKDIV
;HID_Read_Write.c,44 :: 		ACLKCON3 = 0xB4C1;       // Use primary oscillator (8MHz), APLL prescaler N1=2, APLL postscaler N2=2
	MOV	#46273, W0
	MOV	WREG, ACLKCON3
;HID_Read_Write.c,45 :: 		ACLKDIV3 = 0x0007;       // APLL multiplier M=24
	MOV	#7, W0
	MOV	WREG, ACLKDIV3
;HID_Read_Write.c,47 :: 		ANSELA = 0x00;           // Convert all I/O pins to digital
	CLR	ANSELA
;HID_Read_Write.c,48 :: 		ANSELB = 0x00;
	CLR	ANSELB
;HID_Read_Write.c,49 :: 		ANSELC = 0x00;
	CLR	ANSELC
;HID_Read_Write.c,50 :: 		ANSELD = 0x00;
	CLR	ANSELD
;HID_Read_Write.c,51 :: 		ANSELE = 0x00;
	CLR	ANSELE
;HID_Read_Write.c,52 :: 		ANSELG = 0x00;
	CLR	ANSELG
;HID_Read_Write.c,54 :: 		HID_Enable(&readbuff,&writebuff);
	MOV	#lo_addr(_writebuff), W11
	MOV	#lo_addr(_readbuff), W10
	CALL	_HID_Enable
;HID_Read_Write.c,56 :: 		while(1){
L_main0:
;HID_Read_Write.c,57 :: 		while(!HID_Read())
L_main2:
	CALL	_HID_Read
	CP0.B	W0
	BRA Z	L__main11
	GOTO	L_main3
L__main11:
;HID_Read_Write.c,58 :: 		;
	GOTO	L_main2
L_main3:
;HID_Read_Write.c,60 :: 		for(cnt=0;cnt<64;cnt++)
	MOV	#lo_addr(_cnt), W1
	CLR	W0
	MOV.B	W0, [W1]
L_main4:
	MOV	#lo_addr(_cnt), W0
	MOV.B	[W0], W1
	MOV.B	#64, W0
	CP.B	W1, W0
	BRA LTU	L__main12
	GOTO	L_main5
L__main12:
;HID_Read_Write.c,61 :: 		writebuff[cnt]=readbuff[cnt];
	MOV	#lo_addr(_cnt), W0
	ZE	[W0], W1
	MOV	#lo_addr(_writebuff), W0
	ADD	W0, W1, W2
	MOV	#lo_addr(_cnt), W0
	ZE	[W0], W1
	MOV	#lo_addr(_readbuff), W0
	ADD	W0, W1, W0
	MOV.B	[W0], [W2]
;HID_Read_Write.c,60 :: 		for(cnt=0;cnt<64;cnt++)
	MOV.B	#1, W1
	MOV	#lo_addr(_cnt), W0
	ADD.B	W1, [W0], [W0]
;HID_Read_Write.c,61 :: 		writebuff[cnt]=readbuff[cnt];
	GOTO	L_main4
L_main5:
;HID_Read_Write.c,63 :: 		LATB.RB0 = readbuff[63];
	MOV	#lo_addr(_readbuff+63), W0
	MOV.B	[W0], W0
	BTSS	W0, #0
	BCLR	LATB, #0
	BTSC	W0, #0
	BSET	LATB, #0
;HID_Read_Write.c,64 :: 		writebuff[0] = ++Count;
	MOV	[W14+0], W0
	ADD	W0, #1, W1
	MOV	W1, [W14+0]
	MOV	#lo_addr(_writebuff), W0
	MOV.B	W1, [W0]
;HID_Read_Write.c,66 :: 		while(!HID_Write(&writebuff,64))
L_main7:
	MOV.B	#64, W11
	MOV	#lo_addr(_writebuff), W10
	CALL	_HID_Write
	CP0.B	W0
	BRA Z	L__main13
	GOTO	L_main8
L__main13:
;HID_Read_Write.c,67 :: 		;
	GOTO	L_main7
L_main8:
;HID_Read_Write.c,68 :: 		}
	GOTO	L_main0
;HID_Read_Write.c,69 :: 		}
L_end_main:
	ULNK
L__main_end_loop:
	BRA	L__main_end_loop
; end of _main
