
_interrupt:

;SimPLC.mpas,128 :: 		begin
;SimPLC.mpas,131 :: 		if (USBIF_bit) then begin
	BTFSS       USBIF_bit+0, BitPos(USBIF_bit+0) 
	GOTO        L__interrupt2
;SimPLC.mpas,132 :: 		USB_Interrupt_Proc();
	CALL        _USB_Interrupt_Proc+0, 0
;SimPLC.mpas,133 :: 		end;
L__interrupt2:
;SimPLC.mpas,137 :: 		if (T0IF_bit) then begin  // 1ms Interrupt
	BTFSS       T0IF_bit+0, BitPos(T0IF_bit+0) 
	GOTO        L__interrupt5
;SimPLC.mpas,141 :: 		TMR0H := 0xD1;
	MOVLW       209
	MOVWF       TMR0H+0 
;SimPLC.mpas,142 :: 		TMR0L := 0x20;
	MOVLW       32
	MOVWF       TMR0L+0 
;SimPLC.mpas,143 :: 		gsm1msPing();
	CALL        _gsm1msPing+0, 0
;SimPLC.mpas,144 :: 		if (wrdRB7Tmr < 65535) then begin Inc(wrdRB7Tmr); end;
	MOVLW       255
	SUBWF       _wrdRB7Tmr+1, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__interrupt127
	MOVLW       255
	SUBWF       _wrdRB7Tmr+0, 0 
L__interrupt127:
	BTFSC       STATUS+0, 0 
	GOTO        L__interrupt8
	INFSNZ      _wrdRB7Tmr+0, 1 
	INCF        _wrdRB7Tmr+1, 1 
L__interrupt8:
;SimPLC.mpas,146 :: 		if (wrdLcdTmr <> 0) then begin Dec(wrdLcdTmr); end;
	MOVLW       0
	XORWF       _wrdLcdTmr+1, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__interrupt128
	MOVLW       0
	XORWF       _wrdLcdTmr+0, 0 
L__interrupt128:
	BTFSC       STATUS+0, 2 
	GOTO        L__interrupt11
	MOVLW       1
	SUBWF       _wrdLcdTmr+0, 1 
	MOVLW       0
	SUBWFB      _wrdLcdTmr+1, 1 
L__interrupt11:
;SimPLC.mpas,148 :: 		T0IF_bit := 0; // Clear interrupt flag
	BCF         T0IF_bit+0, BitPos(T0IF_bit+0) 
;SimPLC.mpas,149 :: 		end;
L__interrupt5:
;SimPLC.mpas,151 :: 		end;
L_end_interrupt:
L__interrupt126:
	RETFIE      1
; end of _interrupt

_setup:

;SimPLC.mpas,154 :: 		begin
;SimPLC.mpas,155 :: 		OSCCON := %01110000; //8MHz
	MOVLW       112
	MOVWF       OSCCON+0 
;SimPLC.mpas,156 :: 		PLLEN_bit := 1; //Enable PLL (48MHz now)
	BSF         PLLEN_bit+0, BitPos(PLLEN_bit+0) 
;SimPLC.mpas,157 :: 		TRISD := %00000000; //PortD all outputs
	CLRF        TRISD+0 
;SimPLC.mpas,158 :: 		LATD := %00000000; //PortD all off by default
	CLRF        LATD+0 
;SimPLC.mpas,161 :: 		LCD_BL_Direction := 0; //Output
	BCF         TRISA5_bit+0, BitPos(TRISA5_bit+0) 
;SimPLC.mpas,163 :: 		TRISB := %11111111; //PortB all inputs
	MOVLW       255
	MOVWF       TRISB+0 
;SimPLC.mpas,164 :: 		ANCON0 := %11111111; //All pins digital
	MOVLW       255
	MOVWF       ANCON0+0 
;SimPLC.mpas,165 :: 		ANCON1 := %00011111; //All pins digital
	MOVLW       31
	MOVWF       ANCON1+0 
;SimPLC.mpas,166 :: 		RBPU_bit := 0; //PortB Weak Pull-Ups Enabled
	BCF         RBPU_bit+0, BitPos(RBPU_bit+0) 
;SimPLC.mpas,167 :: 		IPEN_bit := 0; //Interrupt priority disable
	BCF         IPEN_bit+0, BitPos(IPEN_bit+0) 
;SimPLC.mpas,168 :: 		GIE_bit := 1; //Global interrupt enable
	BSF         GIE_bit+0, BitPos(GIE_bit+0) 
;SimPLC.mpas,169 :: 		PEIE_bit := 1; //Peripheral interrupt enable
	BSF         PEIE_bit+0, BitPos(PEIE_bit+0) 
;SimPLC.mpas,171 :: 		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
;SimPLC.mpas,174 :: 		T0CON := %10001000; //Timer0 On, 16-bit, internal clock, pre-scaler not assgnd
	MOVLW       136
	MOVWF       T0CON+0 
;SimPLC.mpas,175 :: 		T0IE_bit := 1; //Enable Timer0 overflow interrupts
	BSF         T0IE_bit+0, BitPos(T0IE_bit+0) 
;SimPLC.mpas,176 :: 		end;
L_end_setup:
	RETURN      0
; end of _setup

_startup:

;SimPLC.mpas,179 :: 		begin
;SimPLC.mpas,182 :: 		gsmDebugStateStrPtr := @USBout;
	MOVLW       _USBout+0
	MOVWF       _gsmDebugStateStrPtr+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       _gsmDebugStateStrPtr+1 
;SimPLC.mpas,185 :: 		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
;SimPLC.mpas,186 :: 		gsmInit();
	CALL        _gsmInit+0, 0
;SimPLC.mpas,187 :: 		gsm_MS_Init();
	CALL        _gsm_MS_Init+0, 0
;SimPLC.mpas,188 :: 		gsm_Msg_Init(); // Requires GSM_Msg module
	CALL        _gsm_Msg_Init+0, 0
;SimPLC.mpas,189 :: 		gsm_GPRS_Init(); // Requires GSM_GPRS module
	CALL        _gsm_GPRS_Init+0, 0
;SimPLC.mpas,190 :: 		strDestID := '';
	CLRF        _strDestID+0 
;SimPLC.mpas,191 :: 		wrdRB7Tmr := 65535;
	MOVLW       255
	MOVWF       _wrdRB7Tmr+0 
	MOVLW       255
	MOVWF       _wrdRB7Tmr+1 
;SimPLC.mpas,192 :: 		RTCC_Init();
	CALL        _RTCC_Init+0, 0
;SimPLC.mpas,193 :: 		dtmRTCC.Year := 14; dtmRTCC.Month := 1; dtmRTCC.Day := 1;
	MOVLW       14
	MOVWF       _dtmRTCC+0 
	MOVLW       1
	MOVWF       _dtmRTCC+1 
	MOVLW       1
	MOVWF       _dtmRTCC+2 
;SimPLC.mpas,194 :: 		dtmRTCC.Hour := 0; dtmRTCC.Minute := 0; dtmRTCC.Second := 0;
	CLRF        _dtmRTCC+3 
	CLRF        _dtmRTCC+4 
	CLRF        _dtmRTCC+5 
;SimPLC.mpas,195 :: 		RTCC_Write();
	CALL        _RTCC_Write+0, 0
;SimPLC.mpas,196 :: 		bitRTCC_Set := 0;
	BCF         _bitRTCC_Set+0, BitPos(_bitRTCC_Set+0) 
;SimPLC.mpas,198 :: 		LCD_BL := 1;
	BSF         LATA5_bit+0, BitPos(LATA5_bit+0) 
;SimPLC.mpas,199 :: 		LCD_Init();
	CALL        _Lcd_Init+0, 0
;SimPLC.mpas,200 :: 		LCD_Cmd(_LCD_CURSOR_OFF);
	MOVLW       12
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,201 :: 		LCD_Cmd(_LCD_CLEAR);
	MOVLW       1
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,202 :: 		Lcd_Out(1,6,'SimPLC');
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       6
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       83
	MOVWF       ?LocalText_startup_0+0 
	MOVLW       105
	MOVWF       ?LocalText_startup_0+1 
	MOVLW       109
	MOVWF       ?LocalText_startup_0+2 
	MOVLW       80
	MOVWF       ?LocalText_startup_0+3 
	MOVLW       76
	MOVWF       ?LocalText_startup_0+4 
	MOVLW       67
	MOVWF       ?LocalText_startup_0+5 
	CLRF        ?LocalText_startup_0+6 
	MOVLW       ?LocalText_startup_0+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(?LocalText_startup_0+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,203 :: 		Lcd_Out(2,1,'www.dizzy.co.za');
	MOVLW       2
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       119
	MOVWF       ?LocalText_startup_1+0 
	MOVLW       119
	MOVWF       ?LocalText_startup_1+1 
	MOVLW       119
	MOVWF       ?LocalText_startup_1+2 
	MOVLW       46
	MOVWF       ?LocalText_startup_1+3 
	MOVLW       100
	MOVWF       ?LocalText_startup_1+4 
	MOVLW       105
	MOVWF       ?LocalText_startup_1+5 
	MOVLW       122
	MOVWF       ?LocalText_startup_1+6 
	MOVLW       122
	MOVWF       ?LocalText_startup_1+7 
	MOVLW       121
	MOVWF       ?LocalText_startup_1+8 
	MOVLW       46
	MOVWF       ?LocalText_startup_1+9 
	MOVLW       99
	MOVWF       ?LocalText_startup_1+10 
	MOVLW       111
	MOVWF       ?LocalText_startup_1+11 
	MOVLW       46
	MOVWF       ?LocalText_startup_1+12 
	MOVLW       122
	MOVWF       ?LocalText_startup_1+13 
	MOVLW       97
	MOVWF       ?LocalText_startup_1+14 
	CLRF        ?LocalText_startup_1+15 
	MOVLW       ?LocalText_startup_1+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(?LocalText_startup_1+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,204 :: 		wrdLcdTmr := 5000;
	MOVLW       136
	MOVWF       _wrdLcdTmr+0 
	MOVLW       19
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,206 :: 		end;
L_end_startup:
	RETURN      0
; end of _startup

_gsmUartRxEcho:

;SimPLC.mpas,210 :: 		begin
;SimPLC.mpas,212 :: 		strncpyExNewLine(USBout, UartRxLine, 64);
	MOVLW       _USBout+0
	MOVWF       FARG_strncpyExNewLine_dest+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strncpyExNewLine_dest+1 
	MOVF        FARG_gsmUartRxEcho_UartRxLine+0, 0 
	MOVWF       FARG_strncpyExNewLine_from+0 
	MOVF        FARG_gsmUartRxEcho_UartRxLine+1, 0 
	MOVWF       FARG_strncpyExNewLine_from+1 
	MOVLW       64
	MOVWF       FARG_strncpyExNewLine_size+0 
	CALL        _strncpyExNewLine+0, 0
;SimPLC.mpas,213 :: 		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
;SimPLC.mpas,215 :: 		end;
L_end_gsmUartRxEcho:
	RETURN      0
; end of _gsmUartRxEcho

_gsmDebugStateStrReady:

;SimPLC.mpas,221 :: 		begin
;SimPLC.mpas,223 :: 		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
;SimPLC.mpas,225 :: 		end;
L_end_gsmDebugStateStrReady:
	RETURN      0
; end of _gsmDebugStateStrReady

_rtccSet:

;SimPLC.mpas,229 :: 		begin
;SimPLC.mpas,232 :: 		strcpy(USBout, 'Setting RTCC: ');
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       83
	MOVWF       ?LocalText_rtccSet_2+0 
	MOVLW       101
	MOVWF       ?LocalText_rtccSet_2+1 
	MOVLW       116
	MOVWF       ?LocalText_rtccSet_2+2 
	MOVLW       116
	MOVWF       ?LocalText_rtccSet_2+3 
	MOVLW       105
	MOVWF       ?LocalText_rtccSet_2+4 
	MOVLW       110
	MOVWF       ?LocalText_rtccSet_2+5 
	MOVLW       103
	MOVWF       ?LocalText_rtccSet_2+6 
	MOVLW       32
	MOVWF       ?LocalText_rtccSet_2+7 
	MOVLW       82
	MOVWF       ?LocalText_rtccSet_2+8 
	MOVLW       84
	MOVWF       ?LocalText_rtccSet_2+9 
	MOVLW       67
	MOVWF       ?LocalText_rtccSet_2+10 
	MOVLW       67
	MOVWF       ?LocalText_rtccSet_2+11 
	MOVLW       58
	MOVWF       ?LocalText_rtccSet_2+12 
	MOVLW       32
	MOVWF       ?LocalText_rtccSet_2+13 
	CLRF        ?LocalText_rtccSet_2+14 
	MOVLW       ?LocalText_rtccSet_2+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_rtccSet_2+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,233 :: 		pstr := @USBout + 14;
	MOVLW       14
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	MOVLW       _USBout+0
	ADDWF       R0, 1 
	MOVLW       hi_addr(_USBout+0)
	ADDWFC      R1, 1 
	MOVF        R0, 0 
	MOVWF       _pstr+0 
	MOVF        R1, 0 
	MOVWF       _pstr+1 
;SimPLC.mpas,234 :: 		RTCC_GenerateString(dtmRTCC, pstr);
	MOVLW       _dtmRTCC+0
	MOVWF       FARG_RTCC_GenerateString_dt+0 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FARG_RTCC_GenerateString_dt+1 
	MOVF        R0, 0 
	MOVWF       FARG_RTCC_GenerateString_rtccstring+0 
	MOVF        R1, 0 
	MOVWF       FARG_RTCC_GenerateString_rtccstring+1 
	CALL        _RTCC_GenerateString+0, 0
;SimPLC.mpas,235 :: 		strcat(USBout, '' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       13
	MOVWF       ?LocalText_rtccSet_3+0 
	MOVLW       10
	MOVWF       ?LocalText_rtccSet_3+1 
	MOVLW       0
	MOVWF       ?LocalText_rtccSet_3+2 
	MOVLW       ?LocalText_rtccSet_3+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(?LocalText_rtccSet_3+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,236 :: 		gsmDebugStateStrReady();
	CALL        _gsmDebugStateStrReady+0, 0
;SimPLC.mpas,239 :: 		RTCC_Write();
	CALL        _RTCC_Write+0, 0
;SimPLC.mpas,240 :: 		bitRTCC_Set := 1;
	BSF         _bitRTCC_Set+0, BitPos(_bitRTCC_Set+0) 
;SimPLC.mpas,241 :: 		end;
L_end_rtccSet:
	RETURN      0
; end of _rtccSet

_ByteToBin:

;SimPLC.mpas,246 :: 		begin
;SimPLC.mpas,247 :: 		mask := %10000000;
	MOVLW       128
	MOVWF       R1 
;SimPLC.mpas,248 :: 		ctr := 0;
	CLRF        R2 
;SimPLC.mpas,249 :: 		while (mask <> 0) do begin
L__ByteToBin20:
	MOVF        R1, 0 
	XORLW       0
	BTFSC       STATUS+0, 2 
	GOTO        L__ByteToBin21
;SimPLC.mpas,250 :: 		if (input and mask) then
	MOVF        R1, 0 
	ANDWF       FARG_ByteToBin_input+0, 0 
	MOVWF       R0 
	BTFSC       STATUS+0, 2 
	GOTO        L__ByteToBin25
;SimPLC.mpas,251 :: 		output[ctr] := '1'
	MOVF        R2, 0 
	ADDWF       FARG_ByteToBin_output+0, 0 
	MOVWF       FSR1 
	MOVLW       0
	ADDWFC      FARG_ByteToBin_output+1, 0 
	MOVWF       FSR1H 
	MOVLW       49
	MOVWF       POSTINC1+0 
	GOTO        L__ByteToBin26
;SimPLC.mpas,252 :: 		else
L__ByteToBin25:
;SimPLC.mpas,253 :: 		output[ctr] := '0';
	MOVF        R2, 0 
	ADDWF       FARG_ByteToBin_output+0, 0 
	MOVWF       FSR1 
	MOVLW       0
	ADDWFC      FARG_ByteToBin_output+1, 0 
	MOVWF       FSR1H 
	MOVLW       48
	MOVWF       POSTINC1+0 
L__ByteToBin26:
;SimPLC.mpas,254 :: 		Inc(ctr);
	INCF        R2, 1 
;SimPLC.mpas,255 :: 		mask := mask shr 1;
	RRCF        R1, 1 
	BCF         R1, 7 
;SimPLC.mpas,256 :: 		end;
	GOTO        L__ByteToBin20
L__ByteToBin21:
;SimPLC.mpas,257 :: 		output[ctr] := 0; // Mark the end of the string
	MOVF        R2, 0 
	ADDWF       FARG_ByteToBin_output+0, 0 
	MOVWF       FSR1 
	MOVLW       0
	ADDWFC      FARG_ByteToBin_output+1, 0 
	MOVWF       FSR1H 
	CLRF        POSTINC1+0 
;SimPLC.mpas,258 :: 		end;
L_end_ByteToBin:
	RETURN      0
; end of _ByteToBin

_generateStatusReport:

;SimPLC.mpas,262 :: 		begin
;SimPLC.mpas,263 :: 		pos := @dest;
	MOVF        FARG_generateStatusReport_dest+0, 0 
	MOVWF       generateStatusReport_pos+0 
	MOVF        FARG_generateStatusReport_dest+1, 0 
	MOVWF       generateStatusReport_pos+1 
;SimPLC.mpas,264 :: 		strcpy(pos, 'PORTA:');
	MOVF        FARG_generateStatusReport_dest+0, 0 
	MOVWF       FARG_strcpy_s1+0 
	MOVF        FARG_generateStatusReport_dest+1, 0 
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       80
	MOVWF       ?LocalText_generateStatusReport_4+0 
	MOVLW       79
	MOVWF       ?LocalText_generateStatusReport_4+1 
	MOVLW       82
	MOVWF       ?LocalText_generateStatusReport_4+2 
	MOVLW       84
	MOVWF       ?LocalText_generateStatusReport_4+3 
	MOVLW       65
	MOVWF       ?LocalText_generateStatusReport_4+4 
	MOVLW       58
	MOVWF       ?LocalText_generateStatusReport_4+5 
	CLRF        ?LocalText_generateStatusReport_4+6 
	MOVLW       ?LocalText_generateStatusReport_4+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_generateStatusReport_4+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,265 :: 		pos := pos + 6;
	MOVLW       6
	ADDWF       generateStatusReport_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      generateStatusReport_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       generateStatusReport_pos+0 
	MOVF        R1, 0 
	MOVWF       generateStatusReport_pos+1 
;SimPLC.mpas,266 :: 		ByteToBin(PORTA, pos);
	MOVF        PORTA+0, 0 
	MOVWF       FARG_ByteToBin_input+0 
	MOVF        R0, 0 
	MOVWF       FARG_ByteToBin_output+0 
	MOVF        R1, 0 
	MOVWF       FARG_ByteToBin_output+1 
	CALL        _ByteToBin+0, 0
;SimPLC.mpas,267 :: 		pos := pos + 8;
	MOVLW       8
	ADDWF       generateStatusReport_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      generateStatusReport_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       generateStatusReport_pos+0 
	MOVF        R1, 0 
	MOVWF       generateStatusReport_pos+1 
;SimPLC.mpas,268 :: 		pos^ := ',';
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVLW       44
	MOVWF       POSTINC1+0 
;SimPLC.mpas,269 :: 		Inc(pos);
	INFSNZ      generateStatusReport_pos+0, 1 
	INCF        generateStatusReport_pos+1, 1 
;SimPLC.mpas,270 :: 		strcpy(pos, 'PORTB:');
	MOVF        generateStatusReport_pos+0, 0 
	MOVWF       FARG_strcpy_s1+0 
	MOVF        generateStatusReport_pos+1, 0 
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       80
	MOVWF       ?LocalText_generateStatusReport_5+0 
	MOVLW       79
	MOVWF       ?LocalText_generateStatusReport_5+1 
	MOVLW       82
	MOVWF       ?LocalText_generateStatusReport_5+2 
	MOVLW       84
	MOVWF       ?LocalText_generateStatusReport_5+3 
	MOVLW       66
	MOVWF       ?LocalText_generateStatusReport_5+4 
	MOVLW       58
	MOVWF       ?LocalText_generateStatusReport_5+5 
	CLRF        ?LocalText_generateStatusReport_5+6 
	MOVLW       ?LocalText_generateStatusReport_5+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_generateStatusReport_5+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,271 :: 		pos := pos + 6;
	MOVLW       6
	ADDWF       generateStatusReport_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      generateStatusReport_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       generateStatusReport_pos+0 
	MOVF        R1, 0 
	MOVWF       generateStatusReport_pos+1 
;SimPLC.mpas,272 :: 		ByteToBin(PORTB, pos);
	MOVF        PORTB+0, 0 
	MOVWF       FARG_ByteToBin_input+0 
	MOVF        R0, 0 
	MOVWF       FARG_ByteToBin_output+0 
	MOVF        R1, 0 
	MOVWF       FARG_ByteToBin_output+1 
	CALL        _ByteToBin+0, 0
;SimPLC.mpas,273 :: 		pos := pos + 8;
	MOVLW       8
	ADDWF       generateStatusReport_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      generateStatusReport_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       generateStatusReport_pos+0 
	MOVF        R1, 0 
	MOVWF       generateStatusReport_pos+1 
;SimPLC.mpas,274 :: 		pos^ := ',';
	MOVFF       R0, FSR1
	MOVFF       R1, FSR1H
	MOVLW       44
	MOVWF       POSTINC1+0 
;SimPLC.mpas,275 :: 		Inc(pos);
	INFSNZ      generateStatusReport_pos+0, 1 
	INCF        generateStatusReport_pos+1, 1 
;SimPLC.mpas,276 :: 		strcpy(pos, 'LATD:');
	MOVF        generateStatusReport_pos+0, 0 
	MOVWF       FARG_strcpy_s1+0 
	MOVF        generateStatusReport_pos+1, 0 
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       76
	MOVWF       ?LocalText_generateStatusReport_6+0 
	MOVLW       65
	MOVWF       ?LocalText_generateStatusReport_6+1 
	MOVLW       84
	MOVWF       ?LocalText_generateStatusReport_6+2 
	MOVLW       68
	MOVWF       ?LocalText_generateStatusReport_6+3 
	MOVLW       58
	MOVWF       ?LocalText_generateStatusReport_6+4 
	CLRF        ?LocalText_generateStatusReport_6+5 
	MOVLW       ?LocalText_generateStatusReport_6+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_generateStatusReport_6+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,277 :: 		pos := pos + 5;
	MOVLW       5
	ADDWF       generateStatusReport_pos+0, 0 
	MOVWF       R0 
	MOVLW       0
	ADDWFC      generateStatusReport_pos+1, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	MOVWF       generateStatusReport_pos+0 
	MOVF        R1, 0 
	MOVWF       generateStatusReport_pos+1 
;SimPLC.mpas,278 :: 		ByteToBin(LATD, pos);
	MOVF        LATD+0, 0 
	MOVWF       FARG_ByteToBin_input+0 
	MOVF        R0, 0 
	MOVWF       FARG_ByteToBin_output+0 
	MOVF        R1, 0 
	MOVWF       FARG_ByteToBin_output+1 
	CALL        _ByteToBin+0, 0
;SimPLC.mpas,279 :: 		end;
L_end_generateStatusReport:
	RETURN      0
; end of _generateStatusReport

_msgSend:

;SimPLC.mpas,282 :: 		begin
;SimPLC.mpas,284 :: 		strcpy(USBout, 'Sending message to ');
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       83
	MOVWF       ?LocalText_msgSend_7+0 
	MOVLW       101
	MOVWF       ?LocalText_msgSend_7+1 
	MOVLW       110
	MOVWF       ?LocalText_msgSend_7+2 
	MOVLW       100
	MOVWF       ?LocalText_msgSend_7+3 
	MOVLW       105
	MOVWF       ?LocalText_msgSend_7+4 
	MOVLW       110
	MOVWF       ?LocalText_msgSend_7+5 
	MOVLW       103
	MOVWF       ?LocalText_msgSend_7+6 
	MOVLW       32
	MOVWF       ?LocalText_msgSend_7+7 
	MOVLW       109
	MOVWF       ?LocalText_msgSend_7+8 
	MOVLW       101
	MOVWF       ?LocalText_msgSend_7+9 
	MOVLW       115
	MOVWF       ?LocalText_msgSend_7+10 
	MOVLW       115
	MOVWF       ?LocalText_msgSend_7+11 
	MOVLW       97
	MOVWF       ?LocalText_msgSend_7+12 
	MOVLW       103
	MOVWF       ?LocalText_msgSend_7+13 
	MOVLW       101
	MOVWF       ?LocalText_msgSend_7+14 
	MOVLW       32
	MOVWF       ?LocalText_msgSend_7+15 
	MOVLW       116
	MOVWF       ?LocalText_msgSend_7+16 
	MOVLW       111
	MOVWF       ?LocalText_msgSend_7+17 
	MOVLW       32
	MOVWF       ?LocalText_msgSend_7+18 
	CLRF        ?LocalText_msgSend_7+19 
	MOVLW       ?LocalText_msgSend_7+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_msgSend_7+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,285 :: 		strcat(USBout, strDestID);
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       _strDestID+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(_strDestID+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,286 :: 		strcat(USBout, ':' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       58
	MOVWF       ?LocalText_msgSend_8+0 
	MOVLW       13
	MOVWF       ?LocalText_msgSend_8+1 
	MOVLW       10
	MOVWF       ?LocalText_msgSend_8+2 
	MOVLW       0
	MOVWF       ?LocalText_msgSend_8+3 
	MOVLW       ?LocalText_msgSend_8+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(?LocalText_msgSend_8+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,287 :: 		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
;SimPLC.mpas,288 :: 		strncpyExNewLine(USBout, strMsgSendTxt, 64);
	MOVLW       _USBout+0
	MOVWF       FARG_strncpyExNewLine_dest+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strncpyExNewLine_dest+1 
	MOVLW       _strMsgSendTxt+0
	MOVWF       FARG_strncpyExNewLine_from+0 
	MOVLW       hi_addr(_strMsgSendTxt+0)
	MOVWF       FARG_strncpyExNewLine_from+1 
	MOVLW       64
	MOVWF       FARG_strncpyExNewLine_size+0 
	CALL        _strncpyExNewLine+0, 0
;SimPLC.mpas,289 :: 		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
;SimPLC.mpas,291 :: 		if (strDestID[0] <> 0) then begin
	MOVF        _strDestID+0, 0 
	XORLW       0
	BTFSC       STATUS+0, 2 
	GOTO        L__msgSend30
;SimPLC.mpas,292 :: 		if (gsmMsgSendPending() = 1) then begin gsmMsgSendCancel(); end; // Cancel any message waiting to be sent
	CALL        _gsmMsgSendPending+0, 0
	MOVF        R0, 0 
	XORLW       1
	BTFSS       STATUS+0, 2 
	GOTO        L__msgSend33
	CALL        _gsmMsgSendCancel+0, 0
L__msgSend33:
;SimPLC.mpas,293 :: 		gsmMsgSend(strMsgSendTxt, strDestID);
	MOVLW       _strMsgSendTxt+0
	MOVWF       FARG_gsmMsgSend_MessageText+0 
	MOVLW       hi_addr(_strMsgSendTxt+0)
	MOVWF       FARG_gsmMsgSend_MessageText+1 
	MOVLW       _strDestID+0
	MOVWF       FARG_gsmMsgSend_DestinationID+0 
	MOVLW       hi_addr(_strDestID+0)
	MOVWF       FARG_gsmMsgSend_DestinationID+1 
	CALL        _gsmMsgSend+0, 0
;SimPLC.mpas,294 :: 		end;
L__msgSend30:
;SimPLC.mpas,295 :: 		end;
L_end_msgSend:
	RETURN      0
; end of _msgSend

_gsmMissedCall:

;SimPLC.mpas,298 :: 		begin
;SimPLC.mpas,300 :: 		LCD_Cmd(_LCD_Clear);
	MOVLW       1
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,301 :: 		LCD_Out(1,1,OriginatorID);
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVF        FARG_gsmMissedCall_OriginatorID+0, 0 
	MOVWF       FARG_Lcd_Out_text+0 
	MOVF        FARG_gsmMissedCall_OriginatorID+1, 0 
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,302 :: 		LCD_Out(2,1,'(Missed call)');
	MOVLW       2
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       40
	MOVWF       ?LocalText_gsmMissedCall_9+0 
	MOVLW       77
	MOVWF       ?LocalText_gsmMissedCall_9+1 
	MOVLW       105
	MOVWF       ?LocalText_gsmMissedCall_9+2 
	MOVLW       115
	MOVWF       ?LocalText_gsmMissedCall_9+3 
	MOVLW       115
	MOVWF       ?LocalText_gsmMissedCall_9+4 
	MOVLW       101
	MOVWF       ?LocalText_gsmMissedCall_9+5 
	MOVLW       100
	MOVWF       ?LocalText_gsmMissedCall_9+6 
	MOVLW       32
	MOVWF       ?LocalText_gsmMissedCall_9+7 
	MOVLW       99
	MOVWF       ?LocalText_gsmMissedCall_9+8 
	MOVLW       97
	MOVWF       ?LocalText_gsmMissedCall_9+9 
	MOVLW       108
	MOVWF       ?LocalText_gsmMissedCall_9+10 
	MOVLW       108
	MOVWF       ?LocalText_gsmMissedCall_9+11 
	MOVLW       41
	MOVWF       ?LocalText_gsmMissedCall_9+12 
	CLRF        ?LocalText_gsmMissedCall_9+13 
	MOVLW       ?LocalText_gsmMissedCall_9+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(?LocalText_gsmMissedCall_9+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,303 :: 		wrdLcdTmr := 2500;
	MOVLW       196
	MOVWF       _wrdLcdTmr+0 
	MOVLW       9
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,305 :: 		LATD0_bit := not LATD0_bit; // Toggle PortD.0
	BTG         LATD0_bit+0, BitPos(LATD0_bit+0) 
;SimPLC.mpas,306 :: 		if (strDestID[0] = 0) then begin
	MOVF        _strDestID+0, 0 
	XORLW       0
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMissedCall37
;SimPLC.mpas,307 :: 		strcpy(strDestID, OriginatorID);
	MOVLW       _strDestID+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_strDestID+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVF        FARG_gsmMissedCall_OriginatorID+0, 0 
	MOVWF       FARG_strcpy_s2+0 
	MOVF        FARG_gsmMissedCall_OriginatorID+1, 0 
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,308 :: 		end;
L__gsmMissedCall37:
;SimPLC.mpas,309 :: 		end;
L_end_gsmMissedCall:
	RETURN      0
; end of _gsmMissedCall

_gsmMsgRcvd:

;SimPLC.mpas,312 :: 		begin
;SimPLC.mpas,314 :: 		LCD_Cmd(_LCD_Clear);
	MOVLW       1
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,315 :: 		LCD_Out(1,1,OriginatorID);
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVF        FARG_gsmMsgRcvd_OriginatorID+0, 0 
	MOVWF       FARG_Lcd_Out_text+0 
	MOVF        FARG_gsmMsgRcvd_OriginatorID+1, 0 
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,316 :: 		LCD_Out(2,1,MessageText);
	MOVLW       2
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVF        FARG_gsmMsgRcvd_MessageText+0, 0 
	MOVWF       FARG_Lcd_Out_text+0 
	MOVF        FARG_gsmMsgRcvd_MessageText+1, 0 
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,317 :: 		wrdLcdTmr := 2500;
	MOVLW       196
	MOVWF       _wrdLcdTmr+0 
	MOVLW       9
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,319 :: 		if (strDestID[0] = 0) then begin  // If the destination ID has not yet been set then
	MOVF        _strDestID+0, 0 
	XORLW       0
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd41
;SimPLC.mpas,320 :: 		strcpy(strDestID, OriginatorID); // Copy it from the originator ID
	MOVLW       _strDestID+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_strDestID+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVF        FARG_gsmMsgRcvd_OriginatorID+0, 0 
	MOVWF       FARG_strcpy_s2+0 
	MOVF        FARG_gsmMsgRcvd_OriginatorID+1, 0 
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,321 :: 		end;                                   // (reply to sender)
L__gsmMsgRcvd41:
;SimPLC.mpas,322 :: 		if (gsmMsgJustArrived() = 1) then begin
	CALL        _gsmMsgJustArrived+0, 0
	MOVF        R0, 0 
	XORLW       1
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd44
;SimPLC.mpas,325 :: 		dtmRTCC := dtmGsmEvent;
	MOVLW       _dtmRTCC+0
	MOVWF       FSR1 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FSR1H 
	MOVLW       _dtmGsmEvent+0
	MOVWF       FSR2 
	MOVLW       hi_addr(_dtmGsmEvent+0)
	MOVWF       FSR2H 
	MOVLW       6
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	CALL        ___CA2AW+0, 0
;SimPLC.mpas,326 :: 		rtccSet();
	CALL        _rtccSet+0, 0
;SimPLC.mpas,327 :: 		gsmDateTimeWrite();
	CALL        _gsmDateTimeWrite+0, 0
;SimPLC.mpas,328 :: 		end;
L__gsmMsgRcvd44:
;SimPLC.mpas,329 :: 		lcase(MessageText); // Convert the entire message to lower case
	MOVF        FARG_gsmMsgRcvd_MessageText+0, 0 
	MOVWF       FARG_lcase_str+0 
	MOVF        FARG_gsmMsgRcvd_MessageText+1, 0 
	MOVWF       FARG_lcase_str+1 
	CALL        _lcase+0, 0
;SimPLC.mpas,331 :: 		if (MessageText[1] = 'n') then begin  // Looking for 'on'
	MOVLW       1
	ADDWF       FARG_gsmMsgRcvd_MessageText+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_gsmMsgRcvd_MessageText+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	XORLW       110
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd47
;SimPLC.mpas,332 :: 		LATD := 0xFF;
	MOVLW       255
	MOVWF       LATD+0 
;SimPLC.mpas,333 :: 		end else if (MessageText[1] = 'f') then begin  // Looking for 'off'
	GOTO        L__gsmMsgRcvd48
L__gsmMsgRcvd47:
	MOVLW       1
	ADDWF       FARG_gsmMsgRcvd_MessageText+0, 0 
	MOVWF       FSR0 
	MOVLW       0
	ADDWFC      FARG_gsmMsgRcvd_MessageText+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	XORLW       102
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd50
;SimPLC.mpas,334 :: 		LATD := 0x00;
	CLRF        LATD+0 
;SimPLC.mpas,335 :: 		end else if (MessageText[0] = 'c') then begin  // Query clock
	GOTO        L__gsmMsgRcvd51
L__gsmMsgRcvd50:
	MOVFF       FARG_gsmMsgRcvd_MessageText+0, FSR0
	MOVFF       FARG_gsmMsgRcvd_MessageText+1, FSR0H
	MOVF        POSTINC0+0, 0 
	XORLW       99
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd53
;SimPLC.mpas,336 :: 		strcpy(strMsgSendTxt, 'SimPLC Date/Time: ');
	MOVLW       _strMsgSendTxt+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_strMsgSendTxt+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       83
	MOVWF       ?LocalText_gsmMsgRcvd_10+0 
	MOVLW       105
	MOVWF       ?LocalText_gsmMsgRcvd_10+1 
	MOVLW       109
	MOVWF       ?LocalText_gsmMsgRcvd_10+2 
	MOVLW       80
	MOVWF       ?LocalText_gsmMsgRcvd_10+3 
	MOVLW       76
	MOVWF       ?LocalText_gsmMsgRcvd_10+4 
	MOVLW       67
	MOVWF       ?LocalText_gsmMsgRcvd_10+5 
	MOVLW       32
	MOVWF       ?LocalText_gsmMsgRcvd_10+6 
	MOVLW       68
	MOVWF       ?LocalText_gsmMsgRcvd_10+7 
	MOVLW       97
	MOVWF       ?LocalText_gsmMsgRcvd_10+8 
	MOVLW       116
	MOVWF       ?LocalText_gsmMsgRcvd_10+9 
	MOVLW       101
	MOVWF       ?LocalText_gsmMsgRcvd_10+10 
	MOVLW       47
	MOVWF       ?LocalText_gsmMsgRcvd_10+11 
	MOVLW       84
	MOVWF       ?LocalText_gsmMsgRcvd_10+12 
	MOVLW       105
	MOVWF       ?LocalText_gsmMsgRcvd_10+13 
	MOVLW       109
	MOVWF       ?LocalText_gsmMsgRcvd_10+14 
	MOVLW       101
	MOVWF       ?LocalText_gsmMsgRcvd_10+15 
	MOVLW       58
	MOVWF       ?LocalText_gsmMsgRcvd_10+16 
	MOVLW       32
	MOVWF       ?LocalText_gsmMsgRcvd_10+17 
	CLRF        ?LocalText_gsmMsgRcvd_10+18 
	MOVLW       ?LocalText_gsmMsgRcvd_10+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmMsgRcvd_10+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,337 :: 		pstr := @strMsgSendTxt + 18; //Point past the first 18 characters of the string
	MOVLW       18
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	MOVLW       _strMsgSendTxt+0
	ADDWF       R0, 1 
	MOVLW       hi_addr(_strMsgSendTxt+0)
	ADDWFC      R1, 1 
	MOVF        R0, 0 
	MOVWF       _pstr+0 
	MOVF        R1, 0 
	MOVWF       _pstr+1 
;SimPLC.mpas,338 :: 		RTCC_GenerateString(dtmRTCC, pstr);
	MOVLW       _dtmRTCC+0
	MOVWF       FARG_RTCC_GenerateString_dt+0 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FARG_RTCC_GenerateString_dt+1 
	MOVF        R0, 0 
	MOVWF       FARG_RTCC_GenerateString_rtccstring+0 
	MOVF        R1, 0 
	MOVWF       FARG_RTCC_GenerateString_rtccstring+1 
	CALL        _RTCC_GenerateString+0, 0
;SimPLC.mpas,339 :: 		msgSend();
	CALL        _msgSend+0, 0
;SimPLC.mpas,340 :: 		end else if (strncmp(MessageText, 'stat', 4) = 0) then begin  //Status report
	GOTO        L__gsmMsgRcvd54
L__gsmMsgRcvd53:
	MOVF        FARG_gsmMsgRcvd_MessageText+0, 0 
	MOVWF       FARG_strncmp_s1+0 
	MOVF        FARG_gsmMsgRcvd_MessageText+1, 0 
	MOVWF       FARG_strncmp_s1+1 
	MOVLW       115
	MOVWF       ?LocalText_gsmMsgRcvd_11+0 
	MOVLW       116
	MOVWF       ?LocalText_gsmMsgRcvd_11+1 
	MOVLW       97
	MOVWF       ?LocalText_gsmMsgRcvd_11+2 
	MOVLW       116
	MOVWF       ?LocalText_gsmMsgRcvd_11+3 
	CLRF        ?LocalText_gsmMsgRcvd_11+4 
	MOVLW       ?LocalText_gsmMsgRcvd_11+0
	MOVWF       FARG_strncmp_s2+0 
	MOVLW       hi_addr(?LocalText_gsmMsgRcvd_11+0)
	MOVWF       FARG_strncmp_s2+1 
	MOVLW       4
	MOVWF       FARG_strncmp_len+0 
	MOVLW       0
	MOVWF       FARG_strncmp_len+1 
	CALL        _strncmp+0, 0
	MOVLW       0
	XORWF       R1, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd139
	MOVLW       0
	XORWF       R0, 0 
L__gsmMsgRcvd139:
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd56
;SimPLC.mpas,341 :: 		generateStatusReport(strMsgSendTxt);
	MOVLW       _strMsgSendTxt+0
	MOVWF       FARG_generateStatusReport_dest+0 
	MOVLW       hi_addr(_strMsgSendTxt+0)
	MOVWF       FARG_generateStatusReport_dest+1 
	CALL        _generateStatusReport+0, 0
;SimPLC.mpas,342 :: 		msgSend();
	CALL        _msgSend+0, 0
;SimPLC.mpas,343 :: 		end else if (strncmp(MessageText, 'please call ', 12) = 0) then begin  // 'Please Call Me'
	GOTO        L__gsmMsgRcvd57
L__gsmMsgRcvd56:
	MOVF        FARG_gsmMsgRcvd_MessageText+0, 0 
	MOVWF       FARG_strncmp_s1+0 
	MOVF        FARG_gsmMsgRcvd_MessageText+1, 0 
	MOVWF       FARG_strncmp_s1+1 
	MOVLW       112
	MOVWF       ?LocalText_gsmMsgRcvd_12+0 
	MOVLW       108
	MOVWF       ?LocalText_gsmMsgRcvd_12+1 
	MOVLW       101
	MOVWF       ?LocalText_gsmMsgRcvd_12+2 
	MOVLW       97
	MOVWF       ?LocalText_gsmMsgRcvd_12+3 
	MOVLW       115
	MOVWF       ?LocalText_gsmMsgRcvd_12+4 
	MOVLW       101
	MOVWF       ?LocalText_gsmMsgRcvd_12+5 
	MOVLW       32
	MOVWF       ?LocalText_gsmMsgRcvd_12+6 
	MOVLW       99
	MOVWF       ?LocalText_gsmMsgRcvd_12+7 
	MOVLW       97
	MOVWF       ?LocalText_gsmMsgRcvd_12+8 
	MOVLW       108
	MOVWF       ?LocalText_gsmMsgRcvd_12+9 
	MOVLW       108
	MOVWF       ?LocalText_gsmMsgRcvd_12+10 
	MOVLW       32
	MOVWF       ?LocalText_gsmMsgRcvd_12+11 
	CLRF        ?LocalText_gsmMsgRcvd_12+12 
	MOVLW       ?LocalText_gsmMsgRcvd_12+0
	MOVWF       FARG_strncmp_s2+0 
	MOVLW       hi_addr(?LocalText_gsmMsgRcvd_12+0)
	MOVWF       FARG_strncmp_s2+1 
	MOVLW       12
	MOVWF       FARG_strncmp_len+0 
	MOVLW       0
	MOVWF       FARG_strncmp_len+1 
	CALL        _strncmp+0, 0
	MOVLW       0
	XORWF       R1, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd140
	MOVLW       0
	XORWF       R0, 0 
L__gsmMsgRcvd140:
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmMsgRcvd59
;SimPLC.mpas,344 :: 		LATD1_bit := not LATD1_bit;
	BTG         LATD1_bit+0, BitPos(LATD1_bit+0) 
;SimPLC.mpas,345 :: 		generateStatusReport(strMsgSendTxt);
	MOVLW       _strMsgSendTxt+0
	MOVWF       FARG_generateStatusReport_dest+0 
	MOVLW       hi_addr(_strMsgSendTxt+0)
	MOVWF       FARG_generateStatusReport_dest+1 
	CALL        _generateStatusReport+0, 0
;SimPLC.mpas,346 :: 		msgSend();
	CALL        _msgSend+0, 0
;SimPLC.mpas,347 :: 		end;
L__gsmMsgRcvd59:
L__gsmMsgRcvd57:
L__gsmMsgRcvd54:
L__gsmMsgRcvd51:
L__gsmMsgRcvd48:
;SimPLC.mpas,348 :: 		end;
L_end_gsmMsgRcvd:
	RETURN      0
; end of _gsmMsgRcvd

_gsmEvent:

;SimPLC.mpas,351 :: 		begin
;SimPLC.mpas,353 :: 		gsmevntPIN_Request: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       30
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent65
;SimPLC.mpas,355 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent65:
;SimPLC.mpas,356 :: 		gsmevntPIN_Fail: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       31
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent68
;SimPLC.mpas,358 :: 		strcpy(USBout, 'PIN entry failed' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_13+0 
	MOVLW       73
	MOVWF       ?LocalText_gsmEvent_13+1 
	MOVLW       78
	MOVWF       ?LocalText_gsmEvent_13+2 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_13+3 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_13+4 
	MOVLW       110
	MOVWF       ?LocalText_gsmEvent_13+5 
	MOVLW       116
	MOVWF       ?LocalText_gsmEvent_13+6 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_13+7 
	MOVLW       121
	MOVWF       ?LocalText_gsmEvent_13+8 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_13+9 
	MOVLW       102
	MOVWF       ?LocalText_gsmEvent_13+10 
	MOVLW       97
	MOVWF       ?LocalText_gsmEvent_13+11 
	MOVLW       105
	MOVWF       ?LocalText_gsmEvent_13+12 
	MOVLW       108
	MOVWF       ?LocalText_gsmEvent_13+13 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_13+14 
	MOVLW       100
	MOVWF       ?LocalText_gsmEvent_13+15 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_13+16 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_13+17 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_13+18 
	MOVLW       ?LocalText_gsmEvent_13+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_13+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,359 :: 		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
;SimPLC.mpas,361 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent68:
;SimPLC.mpas,362 :: 		gsmevntMissedCall: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       70
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent71
;SimPLC.mpas,363 :: 		gsmMissedCall(pstrGsmEventOriginatorID);
	MOVF        _pstrGsmEventOriginatorID+0, 0 
	MOVWF       FARG_gsmMissedCall_OriginatorID+0 
	MOVF        _pstrGsmEventOriginatorID+1, 0 
	MOVWF       FARG_gsmMissedCall_OriginatorID+1 
	CALL        _gsmMissedCall+0, 0
;SimPLC.mpas,364 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent71:
;SimPLC.mpas,365 :: 		gsmevntMsgRcvd: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       80
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent74
;SimPLC.mpas,366 :: 		gsmMsgRcvd(pstrGsmEventData, pstrGsmEventOriginatorID);
	MOVF        _pstrGsmEventData+0, 0 
	MOVWF       FARG_gsmMsgRcvd_MessageText+0 
	MOVF        _pstrGsmEventData+1, 0 
	MOVWF       FARG_gsmMsgRcvd_MessageText+1 
	MOVF        _pstrGsmEventOriginatorID+0, 0 
	MOVWF       FARG_gsmMsgRcvd_OriginatorID+0 
	MOVF        _pstrGsmEventOriginatorID+1, 0 
	MOVWF       FARG_gsmMsgRcvd_OriginatorID+1 
	CALL        _gsmMsgRcvd+0, 0
;SimPLC.mpas,367 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent74:
;SimPLC.mpas,368 :: 		gsmevntMsgSent: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       83
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent77
;SimPLC.mpas,370 :: 		strcpy(USBout, 'Message sent' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       77
	MOVWF       ?LocalText_gsmEvent_14+0 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_14+1 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_14+2 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_14+3 
	MOVLW       97
	MOVWF       ?LocalText_gsmEvent_14+4 
	MOVLW       103
	MOVWF       ?LocalText_gsmEvent_14+5 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_14+6 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_14+7 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_14+8 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_14+9 
	MOVLW       110
	MOVWF       ?LocalText_gsmEvent_14+10 
	MOVLW       116
	MOVWF       ?LocalText_gsmEvent_14+11 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_14+12 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_14+13 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_14+14 
	MOVLW       ?LocalText_gsmEvent_14+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_14+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,371 :: 		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
;SimPLC.mpas,373 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent77:
;SimPLC.mpas,374 :: 		gsmevntMsgDiscarded, gsmevntMsgSendFailed: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       82
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent80
	GOTO        L__gsmEvent78
L__gsmEvent80:
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       84
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent81
L__gsmEvent78:
;SimPLC.mpas,376 :: 		strcpy(USBout, 'Message send failed' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       77
	MOVWF       ?LocalText_gsmEvent_15+0 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_15+1 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_15+2 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_15+3 
	MOVLW       97
	MOVWF       ?LocalText_gsmEvent_15+4 
	MOVLW       103
	MOVWF       ?LocalText_gsmEvent_15+5 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_15+6 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_15+7 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_15+8 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_15+9 
	MOVLW       110
	MOVWF       ?LocalText_gsmEvent_15+10 
	MOVLW       100
	MOVWF       ?LocalText_gsmEvent_15+11 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_15+12 
	MOVLW       102
	MOVWF       ?LocalText_gsmEvent_15+13 
	MOVLW       97
	MOVWF       ?LocalText_gsmEvent_15+14 
	MOVLW       105
	MOVWF       ?LocalText_gsmEvent_15+15 
	MOVLW       108
	MOVWF       ?LocalText_gsmEvent_15+16 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_15+17 
	MOVLW       100
	MOVWF       ?LocalText_gsmEvent_15+18 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_15+19 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_15+20 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_15+21 
	MOVLW       ?LocalText_gsmEvent_15+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_15+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,377 :: 		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
;SimPLC.mpas,379 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent81:
;SimPLC.mpas,380 :: 		gsmevntGprsHttpResponseLine: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       112
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent84
;SimPLC.mpas,381 :: 		if (bitGsmGprsFirstLine) then begin
	BTFSS       _bitGsmGprsFirstLine+0, BitPos(_bitGsmGprsFirstLine+0) 
	GOTO        L__gsmEvent86
;SimPLC.mpas,383 :: 		LCD_Cmd(_LCD_Clear);
	MOVLW       1
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,384 :: 		LCD_Out(1,1,'HTTP Result:');
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       72
	MOVWF       ?LocalText_gsmEvent_16+0 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_16+1 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_16+2 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_16+3 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_16+4 
	MOVLW       82
	MOVWF       ?LocalText_gsmEvent_16+5 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_16+6 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_16+7 
	MOVLW       117
	MOVWF       ?LocalText_gsmEvent_16+8 
	MOVLW       108
	MOVWF       ?LocalText_gsmEvent_16+9 
	MOVLW       116
	MOVWF       ?LocalText_gsmEvent_16+10 
	MOVLW       58
	MOVWF       ?LocalText_gsmEvent_16+11 
	CLRF        ?LocalText_gsmEvent_16+12 
	MOVLW       ?LocalText_gsmEvent_16+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_16+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,385 :: 		LCD_Out(2,1,pstrGsmEventData);
	MOVLW       2
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVF        _pstrGsmEventData+0, 0 
	MOVWF       FARG_Lcd_Out_text+0 
	MOVF        _pstrGsmEventData+1, 0 
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,386 :: 		wrdLcdTmr := 2500;
	MOVLW       196
	MOVWF       _wrdLcdTmr+0 
	MOVLW       9
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,388 :: 		bitGsmGprsFirstLine := 0;
	BCF         _bitGsmGprsFirstLine+0, BitPos(_bitGsmGprsFirstLine+0) 
;SimPLC.mpas,389 :: 		end;
L__gsmEvent86:
;SimPLC.mpas,391 :: 		strcpy(USBout, 'HTTP response line: ');
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       72
	MOVWF       ?LocalText_gsmEvent_17+0 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_17+1 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_17+2 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_17+3 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_17+4 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_17+5 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_17+6 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_17+7 
	MOVLW       112
	MOVWF       ?LocalText_gsmEvent_17+8 
	MOVLW       111
	MOVWF       ?LocalText_gsmEvent_17+9 
	MOVLW       110
	MOVWF       ?LocalText_gsmEvent_17+10 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_17+11 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_17+12 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_17+13 
	MOVLW       108
	MOVWF       ?LocalText_gsmEvent_17+14 
	MOVLW       105
	MOVWF       ?LocalText_gsmEvent_17+15 
	MOVLW       110
	MOVWF       ?LocalText_gsmEvent_17+16 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_17+17 
	MOVLW       58
	MOVWF       ?LocalText_gsmEvent_17+18 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_17+19 
	CLRF        ?LocalText_gsmEvent_17+20 
	MOVLW       ?LocalText_gsmEvent_17+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_17+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,392 :: 		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
;SimPLC.mpas,393 :: 		strcpyTillChar(pstrGsmEventData, @USBout, 0, 61);
	MOVF        _pstrGsmEventData+0, 0 
	MOVWF       FARG_strcpyTillChar_source+0 
	MOVF        _pstrGsmEventData+1, 0 
	MOVWF       FARG_strcpyTillChar_source+1 
	MOVLW       _USBout+0
	MOVWF       FARG_strcpyTillChar_dest+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpyTillChar_dest+1 
	CLRF        FARG_strcpyTillChar_stop_char+0 
	MOVLW       61
	MOVWF       FARG_strcpyTillChar_max_len+0 
	CALL        _strcpyTillChar+0, 0
;SimPLC.mpas,394 :: 		strcat(USBout, '' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_18+0 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_18+1 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_18+2 
	MOVLW       ?LocalText_gsmEvent_18+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_18+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,395 :: 		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
;SimPLC.mpas,397 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent84:
;SimPLC.mpas,398 :: 		gsmevntGprsHttpResultErr: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       111
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent90
;SimPLC.mpas,400 :: 		LCD_Cmd(_LCD_Clear);
	MOVLW       1
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,401 :: 		LCD_Out(1,1,'HTTP Error:');
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       72
	MOVWF       ?LocalText_gsmEvent_19+0 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_19+1 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_19+2 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_19+3 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_19+4 
	MOVLW       69
	MOVWF       ?LocalText_gsmEvent_19+5 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_19+6 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_19+7 
	MOVLW       111
	MOVWF       ?LocalText_gsmEvent_19+8 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_19+9 
	MOVLW       58
	MOVWF       ?LocalText_gsmEvent_19+10 
	CLRF        ?LocalText_gsmEvent_19+11 
	MOVLW       ?LocalText_gsmEvent_19+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_19+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,402 :: 		LCD_Out(2,1,pstrGsmEventData);
	MOVLW       2
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVF        _pstrGsmEventData+0, 0 
	MOVWF       FARG_Lcd_Out_text+0 
	MOVF        _pstrGsmEventData+1, 0 
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,403 :: 		wrdLcdTmr := 2500;
	MOVLW       196
	MOVWF       _wrdLcdTmr+0 
	MOVLW       9
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,406 :: 		strcpy(USBout, 'HTTP response error, code ');
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       72
	MOVWF       ?LocalText_gsmEvent_20+0 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_20+1 
	MOVLW       84
	MOVWF       ?LocalText_gsmEvent_20+2 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_20+3 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_20+4 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_20+5 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_20+6 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_20+7 
	MOVLW       112
	MOVWF       ?LocalText_gsmEvent_20+8 
	MOVLW       111
	MOVWF       ?LocalText_gsmEvent_20+9 
	MOVLW       110
	MOVWF       ?LocalText_gsmEvent_20+10 
	MOVLW       115
	MOVWF       ?LocalText_gsmEvent_20+11 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_20+12 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_20+13 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_20+14 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_20+15 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_20+16 
	MOVLW       111
	MOVWF       ?LocalText_gsmEvent_20+17 
	MOVLW       114
	MOVWF       ?LocalText_gsmEvent_20+18 
	MOVLW       44
	MOVWF       ?LocalText_gsmEvent_20+19 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_20+20 
	MOVLW       99
	MOVWF       ?LocalText_gsmEvent_20+21 
	MOVLW       111
	MOVWF       ?LocalText_gsmEvent_20+22 
	MOVLW       100
	MOVWF       ?LocalText_gsmEvent_20+23 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_20+24 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_20+25 
	CLRF        ?LocalText_gsmEvent_20+26 
	MOVLW       ?LocalText_gsmEvent_20+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_20+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,407 :: 		strcat(USBout, pstrGsmEventData);
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVF        _pstrGsmEventData+0, 0 
	MOVWF       FARG_strcat_s2+0 
	MOVF        _pstrGsmEventData+1, 0 
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,408 :: 		strcat(USBout, '' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_21+0 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_21+1 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_21+2 
	MOVLW       ?LocalText_gsmEvent_21+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_21+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,409 :: 		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
;SimPLC.mpas,411 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent90:
;SimPLC.mpas,412 :: 		gsmevntGprsFailed: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       110
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent93
;SimPLC.mpas,414 :: 		LCD_Cmd(_LCD_Clear);
	MOVLW       1
	MOVWF       FARG_Lcd_Cmd_out_char+0 
	CALL        _Lcd_Cmd+0, 0
;SimPLC.mpas,415 :: 		LCD_Out(1,1,'GPRS Failed');
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       71
	MOVWF       ?LocalText_gsmEvent_22+0 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_22+1 
	MOVLW       82
	MOVWF       ?LocalText_gsmEvent_22+2 
	MOVLW       83
	MOVWF       ?LocalText_gsmEvent_22+3 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_22+4 
	MOVLW       70
	MOVWF       ?LocalText_gsmEvent_22+5 
	MOVLW       97
	MOVWF       ?LocalText_gsmEvent_22+6 
	MOVLW       105
	MOVWF       ?LocalText_gsmEvent_22+7 
	MOVLW       108
	MOVWF       ?LocalText_gsmEvent_22+8 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_22+9 
	MOVLW       100
	MOVWF       ?LocalText_gsmEvent_22+10 
	CLRF        ?LocalText_gsmEvent_22+11 
	MOVLW       ?LocalText_gsmEvent_22+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_22+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,416 :: 		wrdLcdTmr := 2500;
	MOVLW       196
	MOVWF       _wrdLcdTmr+0 
	MOVLW       9
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,419 :: 		strcpy(USBout, 'GPRS failed' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       71
	MOVWF       ?LocalText_gsmEvent_23+0 
	MOVLW       80
	MOVWF       ?LocalText_gsmEvent_23+1 
	MOVLW       82
	MOVWF       ?LocalText_gsmEvent_23+2 
	MOVLW       83
	MOVWF       ?LocalText_gsmEvent_23+3 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_23+4 
	MOVLW       102
	MOVWF       ?LocalText_gsmEvent_23+5 
	MOVLW       97
	MOVWF       ?LocalText_gsmEvent_23+6 
	MOVLW       105
	MOVWF       ?LocalText_gsmEvent_23+7 
	MOVLW       108
	MOVWF       ?LocalText_gsmEvent_23+8 
	MOVLW       101
	MOVWF       ?LocalText_gsmEvent_23+9 
	MOVLW       100
	MOVWF       ?LocalText_gsmEvent_23+10 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_23+11 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_23+12 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_23+13 
	MOVLW       ?LocalText_gsmEvent_23+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_23+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,420 :: 		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
;SimPLC.mpas,422 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent93:
;SimPLC.mpas,423 :: 		gsmevntDateTimeRead: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       150
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent96
;SimPLC.mpas,424 :: 		dtmRTCC := dtmGsmEvent;
	MOVLW       _dtmRTCC+0
	MOVWF       FSR1 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FSR1H 
	MOVLW       _dtmGsmEvent+0
	MOVWF       FSR2 
	MOVLW       hi_addr(_dtmGsmEvent+0)
	MOVWF       FSR2H 
	MOVLW       6
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	CALL        ___CA2AW+0, 0
;SimPLC.mpas,425 :: 		rtccSet();
	CALL        _rtccSet+0, 0
;SimPLC.mpas,426 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent96:
;SimPLC.mpas,427 :: 		gsmevntDateTimeWrite: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       151
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent99
;SimPLC.mpas,428 :: 		RTCC_Read();
	CALL        _RTCC_Read+0, 0
;SimPLC.mpas,429 :: 		dtmGsmEvent := dtmRTCC;
	MOVLW       _dtmGsmEvent+0
	MOVWF       FSR1 
	MOVLW       hi_addr(_dtmGsmEvent+0)
	MOVWF       FSR1H 
	MOVLW       _dtmRTCC+0
	MOVWF       FSR2 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FSR2H 
	MOVLW       6
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	CALL        ___CA2AW+0, 0
;SimPLC.mpas,430 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent99:
;SimPLC.mpas,431 :: 		gsmevntIMEI_Read: begin
	MOVF        FARG_gsmEvent_GsmEventType+0, 0 
	XORLW       20
	BTFSS       STATUS+0, 2 
	GOTO        L__gsmEvent102
;SimPLC.mpas,433 :: 		strcpy(USBout, 'IMEI: ');
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       73
	MOVWF       ?LocalText_gsmEvent_24+0 
	MOVLW       77
	MOVWF       ?LocalText_gsmEvent_24+1 
	MOVLW       69
	MOVWF       ?LocalText_gsmEvent_24+2 
	MOVLW       73
	MOVWF       ?LocalText_gsmEvent_24+3 
	MOVLW       58
	MOVWF       ?LocalText_gsmEvent_24+4 
	MOVLW       32
	MOVWF       ?LocalText_gsmEvent_24+5 
	CLRF        ?LocalText_gsmEvent_24+6 
	MOVLW       ?LocalText_gsmEvent_24+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_24+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,434 :: 		strcat(USBout, pstrGsmEventData);
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVF        _pstrGsmEventData+0, 0 
	MOVWF       FARG_strcat_s2+0 
	MOVF        _pstrGsmEventData+1, 0 
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,435 :: 		strcat(USBout, '' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcat_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcat_s1+1 
	MOVLW       13
	MOVWF       ?LocalText_gsmEvent_25+0 
	MOVLW       10
	MOVWF       ?LocalText_gsmEvent_25+1 
	MOVLW       0
	MOVWF       ?LocalText_gsmEvent_25+2 
	MOVLW       ?LocalText_gsmEvent_25+0
	MOVWF       FARG_strcat_s2+0 
	MOVLW       hi_addr(?LocalText_gsmEvent_25+0)
	MOVWF       FARG_strcat_s2+1 
	CALL        _strcat+0, 0
;SimPLC.mpas,436 :: 		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
;SimPLC.mpas,438 :: 		end;
	GOTO        L__gsmEvent62
L__gsmEvent102:
L__gsmEvent62:
;SimPLC.mpas,440 :: 		end;
L_end_gsmEvent:
	RETURN      0
; end of _gsmEvent

_lcdRTCC:

;SimPLC.mpas,444 :: 		begin  // Display the RTCC date/time on the LCD
;SimPLC.mpas,445 :: 		RTCC_Read();
	CALL        _RTCC_Read+0, 0
;SimPLC.mpas,446 :: 		memset(@strLCD, ' ', 16);
	MOVLW       _strLcd+0
	MOVWF       FARG_memset_p+0 
	MOVLW       hi_addr(_strLcd+0)
	MOVWF       FARG_memset_p+1 
	MOVLW       32
	MOVWF       FARG_memset_character+0 
	MOVLW       16
	MOVWF       FARG_memset_n+0 
	MOVLW       0
	MOVWF       FARG_memset_n+1 
	CALL        _memset+0, 0
;SimPLC.mpas,447 :: 		strLCD[16] := 0;
	CLRF        _strLcd+16 
;SimPLC.mpas,448 :: 		pstr := @strLcd + 4;
	MOVLW       4
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	MOVLW       _strLcd+0
	ADDWF       R0, 1 
	MOVLW       hi_addr(_strLcd+0)
	ADDWFC      R1, 1 
	MOVF        R0, 0 
	MOVWF       _pstr+0 
	MOVF        R1, 0 
	MOVWF       _pstr+1 
;SimPLC.mpas,449 :: 		RTCC_GenerateTimeString(dtmRTCC, pstr, 1);
	MOVLW       _dtmRTCC+0
	MOVWF       FARG_RTCC_GenerateTimeString_dt+0 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FARG_RTCC_GenerateTimeString_dt+1 
	MOVF        R0, 0 
	MOVWF       FARG_RTCC_GenerateTimeString_rtccstring+0 
	MOVF        R1, 0 
	MOVWF       FARG_RTCC_GenerateTimeString_rtccstring+1 
	MOVLW       1
	MOVWF       FARG_RTCC_GenerateTimeString_incl_sec+0 
	CALL        _RTCC_GenerateTimeString+0, 0
;SimPLC.mpas,450 :: 		strLcd[12] := ' ';
	MOVLW       32
	MOVWF       _strLcd+12 
;SimPLC.mpas,451 :: 		Lcd_Out(2,1,strLcd);
	MOVLW       2
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       _strLcd+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(_strLcd+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,452 :: 		pstr := @strLcd + 3;
	MOVLW       3
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	MOVLW       _strLcd+0
	ADDWF       R0, 1 
	MOVLW       hi_addr(_strLcd+0)
	ADDWFC      R1, 1 
	MOVF        R0, 0 
	MOVWF       _pstr+0 
	MOVF        R1, 0 
	MOVWF       _pstr+1 
;SimPLC.mpas,453 :: 		RTCC_GenerateDateStringDMY(dtmRTCC, pstr);
	MOVLW       _dtmRTCC+0
	MOVWF       FARG_RTCC_GenerateDateStringDMY_dt+0 
	MOVLW       hi_addr(_dtmRTCC+0)
	MOVWF       FARG_RTCC_GenerateDateStringDMY_dt+1 
	MOVF        R0, 0 
	MOVWF       FARG_RTCC_GenerateDateStringDMY_rtccstring+0 
	MOVF        R1, 0 
	MOVWF       FARG_RTCC_GenerateDateStringDMY_rtccstring+1 
	CALL        _RTCC_GenerateDateStringDMY+0, 0
;SimPLC.mpas,454 :: 		strLcd[13] := ' ';
	MOVLW       32
	MOVWF       _strLcd+13 
;SimPLC.mpas,455 :: 		Lcd_Out(1,1,strLcd);
	MOVLW       1
	MOVWF       FARG_Lcd_Out_row+0 
	MOVLW       1
	MOVWF       FARG_Lcd_Out_column+0 
	MOVLW       _strLcd+0
	MOVWF       FARG_Lcd_Out_text+0 
	MOVLW       hi_addr(_strLcd+0)
	MOVWF       FARG_Lcd_Out_text+1 
	CALL        _Lcd_Out+0, 0
;SimPLC.mpas,456 :: 		end;
L_end_lcdRTCC:
	RETURN      0
; end of _lcdRTCC

_main:

;SimPLC.mpas,459 :: 		begin
;SimPLC.mpas,461 :: 		setup();
	CALL        _setup+0, 0
;SimPLC.mpas,462 :: 		startup();
	CALL        _startup+0, 0
;SimPLC.mpas,463 :: 		gsmDateTimeRead(); // Request a read of the GSM modules date/time
	CALL        _gsmDateTimeRead+0, 0
;SimPLC.mpas,464 :: 		while (1) do begin
L__main106:
;SimPLC.mpas,465 :: 		if (OERR1_bit) then begin  // Check for UART rx overflow
	BTFSS       OERR1_bit+0, BitPos(OERR1_bit+0) 
	GOTO        L__main111
;SimPLC.mpas,470 :: 		strcpy(USBout, 'UART rx overflow occurred.' + Chr(13) + Chr(10));
	MOVLW       _USBout+0
	MOVWF       FARG_strcpy_s1+0 
	MOVLW       hi_addr(_USBout+0)
	MOVWF       FARG_strcpy_s1+1 
	MOVLW       85
	MOVWF       ?LocalText_main_26+0 
	MOVLW       65
	MOVWF       ?LocalText_main_26+1 
	MOVLW       82
	MOVWF       ?LocalText_main_26+2 
	MOVLW       84
	MOVWF       ?LocalText_main_26+3 
	MOVLW       32
	MOVWF       ?LocalText_main_26+4 
	MOVLW       114
	MOVWF       ?LocalText_main_26+5 
	MOVLW       120
	MOVWF       ?LocalText_main_26+6 
	MOVLW       32
	MOVWF       ?LocalText_main_26+7 
	MOVLW       111
	MOVWF       ?LocalText_main_26+8 
	MOVLW       118
	MOVWF       ?LocalText_main_26+9 
	MOVLW       101
	MOVWF       ?LocalText_main_26+10 
	MOVLW       114
	MOVWF       ?LocalText_main_26+11 
	MOVLW       102
	MOVWF       ?LocalText_main_26+12 
	MOVLW       108
	MOVWF       ?LocalText_main_26+13 
	MOVLW       111
	MOVWF       ?LocalText_main_26+14 
	MOVLW       119
	MOVWF       ?LocalText_main_26+15 
	MOVLW       32
	MOVWF       ?LocalText_main_26+16 
	MOVLW       111
	MOVWF       ?LocalText_main_26+17 
	MOVLW       99
	MOVWF       ?LocalText_main_26+18 
	MOVLW       99
	MOVWF       ?LocalText_main_26+19 
	MOVLW       117
	MOVWF       ?LocalText_main_26+20 
	MOVLW       114
	MOVWF       ?LocalText_main_26+21 
	MOVLW       114
	MOVWF       ?LocalText_main_26+22 
	MOVLW       101
	MOVWF       ?LocalText_main_26+23 
	MOVLW       100
	MOVWF       ?LocalText_main_26+24 
	MOVLW       46
	MOVWF       ?LocalText_main_26+25 
	MOVLW       13
	MOVWF       ?LocalText_main_26+26 
	MOVLW       10
	MOVWF       ?LocalText_main_26+27 
	MOVLW       0
	MOVWF       ?LocalText_main_26+28 
	MOVLW       ?LocalText_main_26+0
	MOVWF       FARG_strcpy_s2+0 
	MOVLW       hi_addr(?LocalText_main_26+0)
	MOVWF       FARG_strcpy_s2+1 
	CALL        _strcpy+0, 0
;SimPLC.mpas,471 :: 		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
;SimPLC.mpas,474 :: 		end;
L__main111:
;SimPLC.mpas,475 :: 		gsmPoll();
	CALL        _gsmPoll+0, 0
;SimPLC.mpas,478 :: 		if (wrdLcdTmr = 0) then begin
	MOVLW       0
	XORWF       _wrdLcdTmr+1, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__main144
	MOVLW       0
	XORWF       _wrdLcdTmr+0, 0 
L__main144:
	BTFSS       STATUS+0, 2 
	GOTO        L__main114
;SimPLC.mpas,479 :: 		lcdRTCC();
	CALL        _lcdRTCC+0, 0
;SimPLC.mpas,480 :: 		wrdLcdTmr := 1000;
	MOVLW       232
	MOVWF       _wrdLcdTmr+0 
	MOVLW       3
	MOVWF       _wrdLcdTmr+1 
;SimPLC.mpas,481 :: 		end;
L__main114:
;SimPLC.mpas,485 :: 		if (HID_Read() <> 0) then begin
	CALL        _HID_Read+0, 0
	MOVF        R0, 0 
	XORLW       0
	BTFSC       STATUS+0, 2 
	GOTO        L__main117
;SimPLC.mpas,490 :: 		end;
L__main117:
;SimPLC.mpas,493 :: 		if ((RB7_bit = 0) and (wrdRB7Tmr > 10000)) then begin
	BTFSC       RB7_bit+0, BitPos(RB7_bit+0) 
	GOTO        L__main145
	BSF         R2, 0 
	GOTO        L__main146
L__main145:
	BCF         R2, 0 
L__main146:
	MOVF        _wrdRB7Tmr+1, 0 
	SUBLW       39
	BTFSS       STATUS+0, 2 
	GOTO        L__main147
	MOVF        _wrdRB7Tmr+0, 0 
	SUBLW       16
L__main147:
	MOVLW       255
	BTFSC       STATUS+0, 0 
	MOVLW       0
	MOVWF       R1 
	CLRF        R0 
	BTFSC       R2, 0 
	INCF        R0, 1 
	MOVF        R1, 0 
	ANDWF       R0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L__main120
;SimPLC.mpas,499 :: 		if (not gsmGprsPending()) then begin
	CALL        _gsmGprsPending+0, 0
	COMF        R0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L__main123
;SimPLC.mpas,500 :: 		bitGsmGprsFirstLine := 1;
	BSF         _bitGsmGprsFirstLine+0, BitPos(_bitGsmGprsFirstLine+0) 
;SimPLC.mpas,502 :: 		gsmGprsHttpPost('www.dizzy.co.za/gprs_test.asp', 'unit=SimPLC');
	MOVLW       119
	MOVWF       ?LocalText_main_27+0 
	MOVLW       119
	MOVWF       ?LocalText_main_27+1 
	MOVLW       119
	MOVWF       ?LocalText_main_27+2 
	MOVLW       46
	MOVWF       ?LocalText_main_27+3 
	MOVLW       100
	MOVWF       ?LocalText_main_27+4 
	MOVLW       105
	MOVWF       ?LocalText_main_27+5 
	MOVLW       122
	MOVWF       ?LocalText_main_27+6 
	MOVLW       122
	MOVWF       ?LocalText_main_27+7 
	MOVLW       121
	MOVWF       ?LocalText_main_27+8 
	MOVLW       46
	MOVWF       ?LocalText_main_27+9 
	MOVLW       99
	MOVWF       ?LocalText_main_27+10 
	MOVLW       111
	MOVWF       ?LocalText_main_27+11 
	MOVLW       46
	MOVWF       ?LocalText_main_27+12 
	MOVLW       122
	MOVWF       ?LocalText_main_27+13 
	MOVLW       97
	MOVWF       ?LocalText_main_27+14 
	MOVLW       47
	MOVWF       ?LocalText_main_27+15 
	MOVLW       103
	MOVWF       ?LocalText_main_27+16 
	MOVLW       112
	MOVWF       ?LocalText_main_27+17 
	MOVLW       114
	MOVWF       ?LocalText_main_27+18 
	MOVLW       115
	MOVWF       ?LocalText_main_27+19 
	MOVLW       95
	MOVWF       ?LocalText_main_27+20 
	MOVLW       116
	MOVWF       ?LocalText_main_27+21 
	MOVLW       101
	MOVWF       ?LocalText_main_27+22 
	MOVLW       115
	MOVWF       ?LocalText_main_27+23 
	MOVLW       116
	MOVWF       ?LocalText_main_27+24 
	MOVLW       46
	MOVWF       ?LocalText_main_27+25 
	MOVLW       97
	MOVWF       ?LocalText_main_27+26 
	MOVLW       115
	MOVWF       ?LocalText_main_27+27 
	MOVLW       112
	MOVWF       ?LocalText_main_27+28 
	CLRF        ?LocalText_main_27+29 
	MOVLW       ?LocalText_main_27+0
	MOVWF       FARG_gsmGprsHttpPost_url+0 
	MOVLW       hi_addr(?LocalText_main_27+0)
	MOVWF       FARG_gsmGprsHttpPost_url+1 
	MOVLW       117
	MOVWF       ?LocalText_main_28+0 
	MOVLW       110
	MOVWF       ?LocalText_main_28+1 
	MOVLW       105
	MOVWF       ?LocalText_main_28+2 
	MOVLW       116
	MOVWF       ?LocalText_main_28+3 
	MOVLW       61
	MOVWF       ?LocalText_main_28+4 
	MOVLW       83
	MOVWF       ?LocalText_main_28+5 
	MOVLW       105
	MOVWF       ?LocalText_main_28+6 
	MOVLW       109
	MOVWF       ?LocalText_main_28+7 
	MOVLW       80
	MOVWF       ?LocalText_main_28+8 
	MOVLW       76
	MOVWF       ?LocalText_main_28+9 
	MOVLW       67
	MOVWF       ?LocalText_main_28+10 
	CLRF        ?LocalText_main_28+11 
	MOVLW       ?LocalText_main_28+0
	MOVWF       FARG_gsmGprsHttpPost_postdata+0 
	MOVLW       hi_addr(?LocalText_main_28+0)
	MOVWF       FARG_gsmGprsHttpPost_postdata+1 
	CALL        _gsmGprsHttpPost+0, 0
;SimPLC.mpas,503 :: 		end;
L__main123:
;SimPLC.mpas,505 :: 		wrdRB7Tmr := 0;
	CLRF        _wrdRB7Tmr+0 
	CLRF        _wrdRB7Tmr+1 
;SimPLC.mpas,506 :: 		end;
L__main120:
;SimPLC.mpas,508 :: 		end; // (while)
	GOTO        L__main106
;SimPLC.mpas,510 :: 		end.
L_end_main:
	GOTO        $+0
; end of _main
