; This file was generated by C2C compiler

	include "p16c84.inc"

	title "Variables *****************************************"
__res	equ 0xc
__cnt	equ 0xd
param00_delay_ms	equ 0xe
_loop2_delay_ms	equ 0xf
_loop1_delay_ms	equ 0x10
param00_lcd_putc	equ 0x11
_sertime_lcd_putc	equ 0x12
_count_lcd_printdec	equ 0x13
_nibble_lcd_printhex	equ 0x14
_bits_lcd_printbin	equ 0x15
_i_lcd_printbin	equ 0x1d
param00_lcd_scroll_left	equ 0x1e
param00_lcd_scroll_right	equ 0x1f
_count_delay_us	equ 0x20
_count2_delay_us	equ 0x21
param00_delay_s	equ 0x22
_i_delay_s	equ 0x23
_i_main	equ 0x24

	ORG 0
	goto go

	ORG 4
_interrupt
	bcf INTCON, T0IF		;clear interrupt flag
	retfie

go
_main
	bsf STATUS, RP0
	bcf TRISA, 1
	bcf STATUS, RP0
	movlw D'1'
	movwf param00_delay_s
	call _delay_s
	call _lcd_clear
	movlw D'1'
	movwf param00_delay_s
	call _delay_s
label_20
	movlw D'1'
	sublw 0
	btfsc STATUS, Z
	goto label_21
	movlw D'32'
	movwf _i_main
label_22
	movlw D'64'
	subwf _i_main, W
	movlw 1
	btfsc STATUS, C
	clrw
	sublw 0
	btfsc STATUS, Z
	goto label_23
	movf _i_main, W
	movwf param00_lcd_putc
	call _lcd_putc
	incf _i_main, F
	goto label_22
label_23
	movlw D'1'
	movwf param00_delay_s
	call _delay_s
	movlw D'0'
	movwf _i_main
label_24
	movlw D'16'
	subwf _i_main, W
	movlw 1
	btfsc STATUS, C
	clrw
	sublw 0
	btfsc STATUS, Z
	goto label_25
	movlw D'1'
	movwf param00_lcd_scroll_left
	call _lcd_scroll_left
	movlw D'200'
	movwf param00_delay_ms
	call _delay_ms
	incf _i_main, F
	goto label_24
label_25
	movlw D'2'
	movwf param00_delay_s
	call _delay_s
	movlw D'0'
	movwf _i_main
label_26
	movlw D'16'
	subwf _i_main, W
	movlw 1
	btfsc STATUS, C
	clrw
	sublw 0
	btfsc STATUS, Z
	goto label_27
	movlw D'1'
	movwf param00_lcd_scroll_right
	call _lcd_scroll_right
	movlw D'200'
	movwf param00_delay_ms
	call _delay_ms
	incf _i_main, F
	goto label_26
label_27
	movlw D'2'
	movwf param00_delay_s
	call _delay_s
	call _lcd_clear
	goto label_20
label_21
_delay_ms
	movf param00_delay_ms, W
	movwf _loop1_delay_ms

	MOVLW   110    ; close to 1.0 msec delay when set to .110
	MOVWF   _loop2_delay_ms

	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	DECFSZ  _loop2_delay_ms, F   ; decrement and leave result in LOOP2
	; skip next statement if zero
	GOTO $-7                ; goto _DELAY_2
	DECFSZ  _loop1_delay_ms, F
	GOTO $-0xb              ; goto _DELAY_1
	return
_lcd_putc
	bcf PORTA, 1
	movlw D'255'
	movwf _sertime_lcd_putc
label_0
	movf _sertime_lcd_putc, W
	sublw D'0'
	movlw 1
	btfsc STATUS, Z
	clrw
	decf _sertime_lcd_putc, F
	sublw 0
	btfsc STATUS, Z
	goto label_1
	goto label_0
label_1
	movlw 9		; 8 data + 1 start 
	clrc		; start bit

	skpnc	        ; bit time = 104.167 uSec
	bcf PORTA, 1
	skpc
	bsf PORTA, 1

	; 95 clk cycle delay
	goto $+1            ; 2-cycle NOP in 1 instruction!
	addlw b'00010000'	; increment upper nibble
	skpc		; delay = 6n -1 (1 less when falls thru)
	goto $-3   	; goto lcddloop loop sixteen times
	addlw -1		; dec w, valid z, c=1 if w=0 after decrement
	rrf param00_lcd_putc,F	; carry will be set - shifted in as stop bit
	skpz
	goto $-0xb        ; goto lcdtxloop txloop is 104 clk cycles
	bcf PORTA, 1
	movlw D'10'
	movwf param00_delay_ms
	call _delay_ms
	return
_lcd_clear
	movlw D'254'
	movwf param00_lcd_putc
	call _lcd_putc
	movlw D'1'
	movwf param00_lcd_putc
	call _lcd_putc
	return
_lcd_scroll_left
label_14
	movf param00_lcd_scroll_left, W
	sublw 0
	btfsc STATUS, Z
	goto label_15
	movlw D'254'
	movwf param00_lcd_putc
	call _lcd_putc
	movlw D'24'
	movwf param00_lcd_putc
	call _lcd_putc
	movlw D'10'
	movwf param00_delay_ms
	call _delay_ms
	movf param00_lcd_scroll_left, W
	decf param00_lcd_scroll_left, F
	goto label_14
label_15
	return
_lcd_scroll_right
label_16
	movf param00_lcd_scroll_right, W
	sublw 0
	btfsc STATUS, Z
	goto label_17
	movlw D'254'
	movwf param00_lcd_putc
	call _lcd_putc
	movlw D'28'
	movwf param00_lcd_putc
	call _lcd_putc
	movlw D'10'
	movwf param00_delay_ms
	call _delay_ms
	movf param00_lcd_scroll_right, W
	decf param00_lcd_scroll_right, F
	goto label_16
label_17
	return
_delay_s
	movlw D'0'
	movwf _i_delay_s
label_18
	movlw D'10'
	subwf _i_delay_s, W
	movlw 1
	btfsc STATUS, C
	clrw
	sublw 0
	btfsc STATUS, Z
	goto label_19
	movlw D'100'
	movwf param00_delay_ms
	call _delay_ms
	incf _i_delay_s, F
	goto label_18
label_19
	return

	END
