; This file was generated by C2C-plus compiler version 3.28.10e

	include "p16F84.inc"
	;Variables *****************************************
__const_ptr__param00            equ 0x0c
param00_serial_printf           equ 0x0d
param00_delay_ms                equ 0x0e
_rs232_delay_counter            equ 0x10
_i_serial_printf                equ 0x11
param00_waitforlow              equ 0x12
_i_main                         equ 0x13
_c_main                         equ 0x14
_counter__c2c_putchar           equ 0x15
_data__c2c_putchar              equ 0x16
	ORG 0
	goto start__code

	ORG 4
_interrupt
	bcf INTCON, T0IF		;clear interrupt flag
	retfie

const_param__code
	clrf PCLATH
	addwf PCL, F
start__code
_main__code
	bcf INTCON, GIE
	bsf STATUS, RP0
	movlw D'255'
	movwf TRISB
	movlw D'1'
	movwf TRISA
	bcf STATUS, RP0
	movlw D'2'
	movwf PORTA
	movlw D'0'
	movwf _i_main
label_0000
	movlw D'3'
	subwf _i_main, W
	movlw 1
	btfsc STATUS, C
	clrw
	sublw 0
	btfsc STATUS, Z
	goto label_0001
	call _beepled
	incf _i_main, F
	goto label_0000
label_0001
label_0002
	movlw D'1'
	sublw 0
	btfsc STATUS, Z
	goto label_0003
	movf PORTB, W
	andlw D'1'
	sublw 0
	btfsc STATUS, Z
	goto label_0004
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'48'
	call __c2c_putchar
	movlw D'1'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0004
	movf PORTB, W
	andlw D'2'
	sublw 0
	btfsc STATUS, Z
	goto label_0009
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'49'
	call __c2c_putchar
	movlw D'2'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0009
	movf PORTB, W
	andlw D'4'
	sublw 0
	btfsc STATUS, Z
	goto label_0010
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'50'
	call __c2c_putchar
	movlw D'4'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0010
	movf PORTB, W
	andlw D'8'
	sublw 0
	btfsc STATUS, Z
	goto label_0011
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'51'
	call __c2c_putchar
	movlw D'8'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0011
	movf PORTB, W
	andlw D'16'
	sublw 0
	btfsc STATUS, Z
	goto label_0012
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'52'
	call __c2c_putchar
	movlw D'16'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0012
	movf PORTB, W
	andlw D'32'
	sublw 0
	btfsc STATUS, Z
	goto label_0013
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'53'
	call __c2c_putchar
	movlw D'32'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0013
	movf PORTB, W
	andlw D'64'
	sublw 0
	btfsc STATUS, Z
	goto label_0014
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'54'
	call __c2c_putchar
	movlw D'64'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0014
	movf PORTB, W
	andlw D'128'
	sublw 0
	btfsc STATUS, Z
	goto label_0015
	movf PORTA, W
	iorlw D'4'
	movwf PORTA
	movlw D'55'
	call __c2c_putchar
	movlw D'128'
	movwf param00_waitforlow
	call _waitforlow
	movf PORTA, W
	andlw D'251'
	movwf PORTA
label_0015
	goto label_0002
label_0003
_main__end
_serial_printf__code
_serial_printf
	movlw D'0'
	movwf _i_serial_printf
label_0018
	movf _i_serial_printf, W
	movwf __const_ptr__param00
	movf param00_serial_printf, W
	call const_param__code
	sublw D'0'
	movlw 1
	btfsc STATUS, Z
	clrw
	sublw 0
	btfsc STATUS, Z
	goto label_0019
	movf _i_serial_printf, W
	movwf __const_ptr__param00
	movf param00_serial_printf, W
	call const_param__code
	call __c2c_putchar
	incf _i_serial_printf, F
	goto label_0018
label_0019
	return
_serial_printf__end
_beepled__code
_beepled
	bsf PORTA, 2
	movlw D'250'
	movwf param00_delay_ms
	call _delay_ms
	bcf PORTA, 2
	movlw D'250'
	movwf param00_delay_ms
	call _delay_ms
	return
_beepled__end
_waitforlow__code
_waitforlow
label_0016
	movf PORTB, W
	andwf param00_waitforlow, W
	sublw 0
	btfsc STATUS, Z
	goto label_0017
	goto label_0016
label_0017
	return
_waitforlow__end
__c2c_putchar__code
__c2c_putchar
	movwf _data__c2c_putchar
	movlw D'9'
	movwf _counter__c2c_putchar
	bcf PORTA, 1
	nop
	nop
label_0005
	call __c2c_rs232_delay
	decfsz _counter__c2c_putchar, 1
	goto label_0006
	bsf PORTA, 1
	call __c2c_rs232_delay
	return
label_0006
	rrf _data__c2c_putchar, F
	btfss STATUS, C
	goto label_0007
	bsf PORTA, 1
	goto label_0005
label_0007
	bcf PORTA, 1
	goto label_0005
__c2c_putchar__end
__c2c_rs232_delay__code
__c2c_rs232_delay
	movlw D'17'
	movwf _rs232_delay_counter
label_0008
	decfsz _rs232_delay_counter, 1
	goto label_0008
	return
__c2c_rs232_delay__end
_delay_ms__code
_delay_ms
label_0020
	movlw D'86'
	movwf param00_delay_ms+1
	nop
	nop
label_0021
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	nop
	decfsz param00_delay_ms+1, 1
	goto label_0021
	nop
	decfsz param00_delay_ms, 1
	goto label_0020
	nop
	return
_delay_ms__end
	END
