
_interrupt:

;USB_GSM.mbas,16 :: 		sub procedure interrupt
;USB_GSM.mbas,17 :: 		USB_Interrupt_Proc()
	CALL        _USB_Interrupt_Proc+0, 0
;USB_GSM.mbas,18 :: 		end sub
L_end_interrupt:
L__interrupt19:
	RETFIE      1
; end of _interrupt

_main:

;USB_GSM.mbas,20 :: 		main:
;USB_GSM.mbas,21 :: 		OSCCON = %01110000 '8MHz
	MOVLW       112
	MOVWF       OSCCON+0 
;USB_GSM.mbas,22 :: 		PLLEN_bit = 1 'Enable PLL (now 48MHz)
	BSF         PLLEN_bit+0, 6 
;USB_GSM.mbas,23 :: 		TRISD = %00000000
	CLRF        TRISD+0 
;USB_GSM.mbas,24 :: 		LATD = %00000000
	CLRF        LATD+0 
;USB_GSM.mbas,25 :: 		UART1_Init(9600)
	BSF         BAUDCON+0, 3, 0
	MOVLW       4
	MOVWF       SPBRGH+0 
	MOVLW       225
	MOVWF       SPBRG+0 
	BSF         TXSTA+0, 2, 0
	CALL        _UART1_Init+0, 0
;USB_GSM.mbas,26 :: 		HID_Enable(@USBin,@USBout)      ' Enable HID communication
	MOVLW       _USBin+0
	MOVWF       FARG_HID_Enable_readbuff+0 
	MOVLW       hi_addr(_USBin+0)
	MOVWF       FARG_HID_Enable_readbuff+1 
	MOVLW       _USBout+0
	MOVWF       FARG_HID_Enable_writebuff+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_HID_Enable_writebuff+1 
	CALL        _HID_Enable+0, 0
;USB_GSM.mbas,28 :: 		while (1)
L__main3:
;USB_GSM.mbas,29 :: 		if HID_Read <> 0 then
	CALL        _HID_Read+0, 0
	MOVF        R0, 0 
	XORLW       0
	BTFSC       STATUS+0, 2 
	GOTO        L__main8
;USB_GSM.mbas,30 :: 		UART1_Write_Text(USBin)
	MOVLW       _USBin+0
	MOVWF       FARG_UART1_Write_Text_uart_text+0 
	MOVLW       hi_addr(_USBin+0)
	MOVWF       FARG_UART1_Write_Text_uart_text+1 
	CALL        _UART1_Write_Text+0, 0
;USB_GSM.mbas,31 :: 		Inc(LATD)
	INCF        LATD+0, 1 
L__main8:
;USB_GSM.mbas,33 :: 		pos = 0
	CLRF        _pos+0 
;USB_GSM.mbas,34 :: 		while UART1_Data_Ready
L__main11:
	CALL        _UART1_Data_Ready+0, 0
	MOVF        R0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L__main12
;USB_GSM.mbas,35 :: 		USBout[pos] = UART1_Read
	MOVLW       _USBout+0
	MOVWF       FLOC__main+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FLOC__main+1 
	MOVF        _pos+0, 0 
	ADDWF       FLOC__main+0, 1 
	BTFSC       STATUS+0, 0 
	INCF        FLOC__main+1, 1 
	CALL        _UART1_Read+0, 0
	MOVFF       FLOC__main+0, FSR1
	MOVFF       FLOC__main+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
;USB_GSM.mbas,36 :: 		Inc(pos)
	INCF        _pos+0, 1 
;USB_GSM.mbas,37 :: 		wend
	GOTO        L__main11
L__main12:
;USB_GSM.mbas,38 :: 		if pos > 0 then
	MOVF        _pos+0, 0 
	SUBLW       0
	BTFSC       STATUS+0, 0 
	GOTO        L__main16
;USB_GSM.mbas,39 :: 		USBout[pos] = 0
	MOVLW       _USBout+0
	MOVWF       FSR1 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FSR1H 
	MOVF        _pos+0, 0 
	ADDWF       FSR1, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR1H, 1 
	CLRF        POSTINC1+0 
;USB_GSM.mbas,40 :: 		HID_Write(@USBout, 64)
	MOVLW       _USBout+0
	MOVWF       FARG_HID_Write_writebuff+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_HID_Write_writebuff+1 
	MOVLW       64
	MOVWF       FARG_HID_Write_len+0 
	CALL        _HID_Write+0, 0
L__main16:
;USB_GSM.mbas,42 :: 		wend
	GOTO        L__main3
L_end_main:
	GOTO        $+0
; end of _main
