
;CodeVisionAVR C Compiler V2.05.0 Professional
;(C) Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.
;http://www.hpinfotech.com

;Chip type                : ATmega64L
;Program type             : Application
;Clock frequency          : 8,000000 MHz
;Memory model             : Small
;Optimize for             : Speed
;(s)printf features       : int, width
;(s)scanf features        : int, width
;External RAM size        : 0
;Data Stack size          : 1024 byte(s)
;Heap size                : 0 byte(s)
;Promote 'char' to 'int'  : Yes
;'char' is unsigned       : Yes
;8 bit enums              : Yes
;global 'const' stored in FLASH: No
;Enhanced core instructions    : On
;Smart register allocation     : On
;Automatic register allocation : On

	#pragma AVRPART ADMIN PART_NAME ATmega64L
	#pragma AVRPART MEMORY PROG_FLASH 65536
	#pragma AVRPART MEMORY EEPROM 2048
	#pragma AVRPART MEMORY INT_SRAM SIZE 4351
	#pragma AVRPART MEMORY INT_SRAM START_ADDR 0x100

	#define CALL_SUPPORTED 1

	.LISTMAC
	.EQU UDRE=0x5
	.EQU RXC=0x7
	.EQU USR=0xB
	.EQU UDR=0xC
	.EQU SPSR=0xE
	.EQU SPDR=0xF
	.EQU EERE=0x0
	.EQU EEWE=0x1
	.EQU EEMWE=0x2
	.EQU EECR=0x1C
	.EQU EEDR=0x1D
	.EQU EEARL=0x1E
	.EQU EEARH=0x1F
	.EQU WDTCR=0x21
	.EQU MCUCR=0x35
	.EQU SPL=0x3D
	.EQU SPH=0x3E
	.EQU SREG=0x3F
	.EQU XMCRA=0x6D
	.EQU XMCRB=0x6C

	.DEF R0X0=R0
	.DEF R0X1=R1
	.DEF R0X2=R2
	.DEF R0X3=R3
	.DEF R0X4=R4
	.DEF R0X5=R5
	.DEF R0X6=R6
	.DEF R0X7=R7
	.DEF R0X8=R8
	.DEF R0X9=R9
	.DEF R0XA=R10
	.DEF R0XB=R11
	.DEF R0XC=R12
	.DEF R0XD=R13
	.DEF R0XE=R14
	.DEF R0XF=R15
	.DEF R0X10=R16
	.DEF R0X11=R17
	.DEF R0X12=R18
	.DEF R0X13=R19
	.DEF R0X14=R20
	.DEF R0X15=R21
	.DEF R0X16=R22
	.DEF R0X17=R23
	.DEF R0X18=R24
	.DEF R0X19=R25
	.DEF R0X1A=R26
	.DEF R0X1B=R27
	.DEF R0X1C=R28
	.DEF R0X1D=R29
	.DEF R0X1E=R30
	.DEF R0X1F=R31

	.EQU __SRAM_START=0x0100
	.EQU __SRAM_END=0x10FF
	.EQU __DSTACK_SIZE=0x0400
	.EQU __HEAP_SIZE=0x0000
	.EQU __CLEAR_SRAM_SIZE=__SRAM_END-__SRAM_START+1

	.MACRO __CPD1N
	CPI  R30,LOW(@0)
	LDI  R26,HIGH(@0)
	CPC  R31,R26
	LDI  R26,BYTE3(@0)
	CPC  R22,R26
	LDI  R26,BYTE4(@0)
	CPC  R23,R26
	.ENDM

	.MACRO __CPD2N
	CPI  R26,LOW(@0)
	LDI  R30,HIGH(@0)
	CPC  R27,R30
	LDI  R30,BYTE3(@0)
	CPC  R24,R30
	LDI  R30,BYTE4(@0)
	CPC  R25,R30
	.ENDM

	.MACRO __CPWRR
	CP   R@0,R@2
	CPC  R@1,R@3
	.ENDM

	.MACRO __CPWRN
	CPI  R@0,LOW(@2)
	LDI  R30,HIGH(@2)
	CPC  R@1,R30
	.ENDM

	.MACRO __ADDB1MN
	SUBI R30,LOW(-@0-(@1))
	.ENDM

	.MACRO __ADDB2MN
	SUBI R26,LOW(-@0-(@1))
	.ENDM

	.MACRO __ADDW1MN
	SUBI R30,LOW(-@0-(@1))
	SBCI R31,HIGH(-@0-(@1))
	.ENDM

	.MACRO __ADDW2MN
	SUBI R26,LOW(-@0-(@1))
	SBCI R27,HIGH(-@0-(@1))
	.ENDM

	.MACRO __ADDW1FN
	SUBI R30,LOW(-2*@0-(@1))
	SBCI R31,HIGH(-2*@0-(@1))
	.ENDM

	.MACRO __ADDD1FN
	SUBI R30,LOW(-2*@0-(@1))
	SBCI R31,HIGH(-2*@0-(@1))
	SBCI R22,BYTE3(-2*@0-(@1))
	.ENDM

	.MACRO __ADDD1N
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	SBCI R22,BYTE3(-@0)
	SBCI R23,BYTE4(-@0)
	.ENDM

	.MACRO __ADDD2N
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	SBCI R24,BYTE3(-@0)
	SBCI R25,BYTE4(-@0)
	.ENDM

	.MACRO __SUBD1N
	SUBI R30,LOW(@0)
	SBCI R31,HIGH(@0)
	SBCI R22,BYTE3(@0)
	SBCI R23,BYTE4(@0)
	.ENDM

	.MACRO __SUBD2N
	SUBI R26,LOW(@0)
	SBCI R27,HIGH(@0)
	SBCI R24,BYTE3(@0)
	SBCI R25,BYTE4(@0)
	.ENDM

	.MACRO __ANDBMNN
	LDS  R30,@0+(@1)
	ANDI R30,LOW(@2)
	STS  @0+(@1),R30
	.ENDM

	.MACRO __ANDWMNN
	LDS  R30,@0+(@1)
	ANDI R30,LOW(@2)
	STS  @0+(@1),R30
	LDS  R30,@0+(@1)+1
	ANDI R30,HIGH(@2)
	STS  @0+(@1)+1,R30
	.ENDM

	.MACRO __ANDD1N
	ANDI R30,LOW(@0)
	ANDI R31,HIGH(@0)
	ANDI R22,BYTE3(@0)
	ANDI R23,BYTE4(@0)
	.ENDM

	.MACRO __ANDD2N
	ANDI R26,LOW(@0)
	ANDI R27,HIGH(@0)
	ANDI R24,BYTE3(@0)
	ANDI R25,BYTE4(@0)
	.ENDM

	.MACRO __ORBMNN
	LDS  R30,@0+(@1)
	ORI  R30,LOW(@2)
	STS  @0+(@1),R30
	.ENDM

	.MACRO __ORWMNN
	LDS  R30,@0+(@1)
	ORI  R30,LOW(@2)
	STS  @0+(@1),R30
	LDS  R30,@0+(@1)+1
	ORI  R30,HIGH(@2)
	STS  @0+(@1)+1,R30
	.ENDM

	.MACRO __ORD1N
	ORI  R30,LOW(@0)
	ORI  R31,HIGH(@0)
	ORI  R22,BYTE3(@0)
	ORI  R23,BYTE4(@0)
	.ENDM

	.MACRO __ORD2N
	ORI  R26,LOW(@0)
	ORI  R27,HIGH(@0)
	ORI  R24,BYTE3(@0)
	ORI  R25,BYTE4(@0)
	.ENDM

	.MACRO __DELAY_USB
	LDI  R24,LOW(@0)
__DELAY_USB_LOOP:
	DEC  R24
	BRNE __DELAY_USB_LOOP
	.ENDM

	.MACRO __DELAY_USW
	LDI  R24,LOW(@0)
	LDI  R25,HIGH(@0)
__DELAY_USW_LOOP:
	SBIW R24,1
	BRNE __DELAY_USW_LOOP
	.ENDM

	.MACRO __GETD1S
	LDD  R30,Y+@0
	LDD  R31,Y+@0+1
	LDD  R22,Y+@0+2
	LDD  R23,Y+@0+3
	.ENDM

	.MACRO __GETD2S
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	LDD  R24,Y+@0+2
	LDD  R25,Y+@0+3
	.ENDM

	.MACRO __PUTD1S
	STD  Y+@0,R30
	STD  Y+@0+1,R31
	STD  Y+@0+2,R22
	STD  Y+@0+3,R23
	.ENDM

	.MACRO __PUTD2S
	STD  Y+@0,R26
	STD  Y+@0+1,R27
	STD  Y+@0+2,R24
	STD  Y+@0+3,R25
	.ENDM

	.MACRO __PUTDZ2
	STD  Z+@0,R26
	STD  Z+@0+1,R27
	STD  Z+@0+2,R24
	STD  Z+@0+3,R25
	.ENDM

	.MACRO __CLRD1S
	STD  Y+@0,R30
	STD  Y+@0+1,R30
	STD  Y+@0+2,R30
	STD  Y+@0+3,R30
	.ENDM

	.MACRO __POINTB1MN
	LDI  R30,LOW(@0+(@1))
	.ENDM

	.MACRO __POINTW1MN
	LDI  R30,LOW(@0+(@1))
	LDI  R31,HIGH(@0+(@1))
	.ENDM

	.MACRO __POINTD1M
	LDI  R30,LOW(@0)
	LDI  R31,HIGH(@0)
	LDI  R22,BYTE3(@0)
	LDI  R23,BYTE4(@0)
	.ENDM

	.MACRO __POINTW1FN
	LDI  R30,LOW(2*@0+(@1))
	LDI  R31,HIGH(2*@0+(@1))
	.ENDM

	.MACRO __POINTD1FN
	LDI  R30,LOW(2*@0+(@1))
	LDI  R31,HIGH(2*@0+(@1))
	LDI  R22,BYTE3(2*@0+(@1))
	LDI  R23,BYTE4(2*@0+(@1))
	.ENDM

	.MACRO __POINTB2MN
	LDI  R26,LOW(@0+(@1))
	.ENDM

	.MACRO __POINTW2MN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	.ENDM

	.MACRO __POINTBRM
	LDI  R@0,LOW(@1)
	.ENDM

	.MACRO __POINTWRM
	LDI  R@0,LOW(@2)
	LDI  R@1,HIGH(@2)
	.ENDM

	.MACRO __POINTBRMN
	LDI  R@0,LOW(@1+(@2))
	.ENDM

	.MACRO __POINTWRMN
	LDI  R@0,LOW(@2+(@3))
	LDI  R@1,HIGH(@2+(@3))
	.ENDM

	.MACRO __POINTWRFN
	LDI  R@0,LOW(@2*2+(@3))
	LDI  R@1,HIGH(@2*2+(@3))
	.ENDM

	.MACRO __GETD1N
	LDI  R30,LOW(@0)
	LDI  R31,HIGH(@0)
	LDI  R22,BYTE3(@0)
	LDI  R23,BYTE4(@0)
	.ENDM

	.MACRO __GETD2N
	LDI  R26,LOW(@0)
	LDI  R27,HIGH(@0)
	LDI  R24,BYTE3(@0)
	LDI  R25,BYTE4(@0)
	.ENDM

	.MACRO __GETB1MN
	LDS  R30,@0+(@1)
	.ENDM

	.MACRO __GETB1HMN
	LDS  R31,@0+(@1)
	.ENDM

	.MACRO __GETW1MN
	LDS  R30,@0+(@1)
	LDS  R31,@0+(@1)+1
	.ENDM

	.MACRO __GETD1MN
	LDS  R30,@0+(@1)
	LDS  R31,@0+(@1)+1
	LDS  R22,@0+(@1)+2
	LDS  R23,@0+(@1)+3
	.ENDM

	.MACRO __GETBRMN
	LDS  R@0,@1+(@2)
	.ENDM

	.MACRO __GETWRMN
	LDS  R@0,@2+(@3)
	LDS  R@1,@2+(@3)+1
	.ENDM

	.MACRO __GETWRZ
	LDD  R@0,Z+@2
	LDD  R@1,Z+@2+1
	.ENDM

	.MACRO __GETD2Z
	LDD  R26,Z+@0
	LDD  R27,Z+@0+1
	LDD  R24,Z+@0+2
	LDD  R25,Z+@0+3
	.ENDM

	.MACRO __GETB2MN
	LDS  R26,@0+(@1)
	.ENDM

	.MACRO __GETW2MN
	LDS  R26,@0+(@1)
	LDS  R27,@0+(@1)+1
	.ENDM

	.MACRO __GETD2MN
	LDS  R26,@0+(@1)
	LDS  R27,@0+(@1)+1
	LDS  R24,@0+(@1)+2
	LDS  R25,@0+(@1)+3
	.ENDM

	.MACRO __PUTB1MN
	STS  @0+(@1),R30
	.ENDM

	.MACRO __PUTW1MN
	STS  @0+(@1),R30
	STS  @0+(@1)+1,R31
	.ENDM

	.MACRO __PUTD1MN
	STS  @0+(@1),R30
	STS  @0+(@1)+1,R31
	STS  @0+(@1)+2,R22
	STS  @0+(@1)+3,R23
	.ENDM

	.MACRO __PUTB1EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMWRB
	.ENDM

	.MACRO __PUTW1EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMWRW
	.ENDM

	.MACRO __PUTD1EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMWRD
	.ENDM

	.MACRO __PUTBR0MN
	STS  @0+(@1),R0
	.ENDM

	.MACRO __PUTBMRN
	STS  @0+(@1),R@2
	.ENDM

	.MACRO __PUTWMRN
	STS  @0+(@1),R@2
	STS  @0+(@1)+1,R@3
	.ENDM

	.MACRO __PUTBZR
	STD  Z+@1,R@0
	.ENDM

	.MACRO __PUTWZR
	STD  Z+@2,R@0
	STD  Z+@2+1,R@1
	.ENDM

	.MACRO __GETW1R
	MOV  R30,R@0
	MOV  R31,R@1
	.ENDM

	.MACRO __GETW2R
	MOV  R26,R@0
	MOV  R27,R@1
	.ENDM

	.MACRO __GETWRN
	LDI  R@0,LOW(@2)
	LDI  R@1,HIGH(@2)
	.ENDM

	.MACRO __PUTW1R
	MOV  R@0,R30
	MOV  R@1,R31
	.ENDM

	.MACRO __PUTW2R
	MOV  R@0,R26
	MOV  R@1,R27
	.ENDM

	.MACRO __ADDWRN
	SUBI R@0,LOW(-@2)
	SBCI R@1,HIGH(-@2)
	.ENDM

	.MACRO __ADDWRR
	ADD  R@0,R@2
	ADC  R@1,R@3
	.ENDM

	.MACRO __SUBWRN
	SUBI R@0,LOW(@2)
	SBCI R@1,HIGH(@2)
	.ENDM

	.MACRO __SUBWRR
	SUB  R@0,R@2
	SBC  R@1,R@3
	.ENDM

	.MACRO __ANDWRN
	ANDI R@0,LOW(@2)
	ANDI R@1,HIGH(@2)
	.ENDM

	.MACRO __ANDWRR
	AND  R@0,R@2
	AND  R@1,R@3
	.ENDM

	.MACRO __ORWRN
	ORI  R@0,LOW(@2)
	ORI  R@1,HIGH(@2)
	.ENDM

	.MACRO __ORWRR
	OR   R@0,R@2
	OR   R@1,R@3
	.ENDM

	.MACRO __EORWRR
	EOR  R@0,R@2
	EOR  R@1,R@3
	.ENDM

	.MACRO __GETWRS
	LDD  R@0,Y+@2
	LDD  R@1,Y+@2+1
	.ENDM

	.MACRO __PUTBSR
	STD  Y+@1,R@0
	.ENDM

	.MACRO __PUTWSR
	STD  Y+@2,R@0
	STD  Y+@2+1,R@1
	.ENDM

	.MACRO __MOVEWRR
	MOV  R@0,R@2
	MOV  R@1,R@3
	.ENDM

	.MACRO __INWR
	IN   R@0,@2
	IN   R@1,@2+1
	.ENDM

	.MACRO __OUTWR
	OUT  @2+1,R@1
	OUT  @2,R@0
	.ENDM

	.MACRO __CALL1MN
	LDS  R30,@0+(@1)
	LDS  R31,@0+(@1)+1
	ICALL
	.ENDM

	.MACRO __CALL1FN
	LDI  R30,LOW(2*@0+(@1))
	LDI  R31,HIGH(2*@0+(@1))
	CALL __GETW1PF
	ICALL
	.ENDM

	.MACRO __CALL2EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMRDW
	ICALL
	.ENDM

	.MACRO __GETW1STACK
	IN   R26,SPL
	IN   R27,SPH
	ADIW R26,@0+1
	LD   R30,X+
	LD   R31,X
	.ENDM

	.MACRO __GETD1STACK
	IN   R26,SPL
	IN   R27,SPH
	ADIW R26,@0+1
	LD   R30,X+
	LD   R31,X+
	LD   R22,X
	.ENDM

	.MACRO __NBST
	BST  R@0,@1
	IN   R30,SREG
	LDI  R31,0x40
	EOR  R30,R31
	OUT  SREG,R30
	.ENDM


	.MACRO __PUTB1SN
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SN
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SN
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1SNS
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	ADIW R26,@1
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SNS
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	ADIW R26,@1
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SNS
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	ADIW R26,@1
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1PMN
	LDS  R26,@0
	LDS  R27,@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1PMN
	LDS  R26,@0
	LDS  R27,@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1PMN
	LDS  R26,@0
	LDS  R27,@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1PMNS
	LDS  R26,@0
	LDS  R27,@0+1
	ADIW R26,@1
	ST   X,R30
	.ENDM

	.MACRO __PUTW1PMNS
	LDS  R26,@0
	LDS  R27,@0+1
	ADIW R26,@1
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1PMNS
	LDS  R26,@0
	LDS  R27,@0+1
	ADIW R26,@1
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RN
	MOVW R26,R@0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RN
	MOVW R26,R@0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RN
	MOVW R26,R@0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RNS
	MOVW R26,R@0
	ADIW R26,@1
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RNS
	MOVW R26,R@0
	ADIW R26,@1
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RNS
	MOVW R26,R@0
	ADIW R26,@1
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RON
	MOV  R26,R@0
	MOV  R27,R@1
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RON
	MOV  R26,R@0
	MOV  R27,R@1
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RON
	MOV  R26,R@0
	MOV  R27,R@1
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RONS
	MOV  R26,R@0
	MOV  R27,R@1
	ADIW R26,@2
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RONS
	MOV  R26,R@0
	MOV  R27,R@1
	ADIW R26,@2
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RONS
	MOV  R26,R@0
	MOV  R27,R@1
	ADIW R26,@2
	CALL __PUTDP1
	.ENDM


	.MACRO __GETB1SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R30,Z
	.ENDM

	.MACRO __GETB1HSX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R31,Z
	.ENDM

	.MACRO __GETW1SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R0,Z+
	LD   R31,Z
	MOV  R30,R0
	.ENDM

	.MACRO __GETD1SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R0,Z+
	LD   R1,Z+
	LD   R22,Z+
	LD   R23,Z
	MOVW R30,R0
	.ENDM

	.MACRO __GETB2SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R26,X
	.ENDM

	.MACRO __GETW2SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	.ENDM

	.MACRO __GETD2SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R1,X+
	LD   R24,X+
	LD   R25,X
	MOVW R26,R0
	.ENDM

	.MACRO __GETBRSX
	MOVW R30,R28
	SUBI R30,LOW(-@1)
	SBCI R31,HIGH(-@1)
	LD   R@0,Z
	.ENDM

	.MACRO __GETWRSX
	MOVW R30,R28
	SUBI R30,LOW(-@2)
	SBCI R31,HIGH(-@2)
	LD   R@0,Z+
	LD   R@1,Z
	.ENDM

	.MACRO __GETBRSX2
	MOVW R26,R28
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	LD   R@0,X
	.ENDM

	.MACRO __GETWRSX2
	MOVW R26,R28
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	LD   R@0,X+
	LD   R@1,X
	.ENDM

	.MACRO __LSLW8SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R31,Z
	CLR  R30
	.ENDM

	.MACRO __PUTB1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X+,R31
	ST   X+,R22
	ST   X,R23
	.ENDM

	.MACRO __CLRW1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X,R30
	.ENDM

	.MACRO __CLRD1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X+,R30
	ST   X+,R30
	ST   X,R30
	.ENDM

	.MACRO __PUTB2SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	ST   Z,R26
	.ENDM

	.MACRO __PUTW2SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	ST   Z+,R26
	ST   Z,R27
	.ENDM

	.MACRO __PUTD2SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	ST   Z+,R26
	ST   Z+,R27
	ST   Z+,R24
	ST   Z,R25
	.ENDM

	.MACRO __PUTBSRX
	MOVW R30,R28
	SUBI R30,LOW(-@1)
	SBCI R31,HIGH(-@1)
	ST   Z,R@0
	.ENDM

	.MACRO __PUTWSRX
	MOVW R30,R28
	SUBI R30,LOW(-@2)
	SBCI R31,HIGH(-@2)
	ST   Z+,R@0
	ST   Z,R@1
	.ENDM

	.MACRO __PUTB1SNX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SNX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SNX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X+,R31
	ST   X+,R22
	ST   X,R23
	.ENDM

	.MACRO __MULBRR
	MULS R@0,R@1
	MOVW R30,R0
	.ENDM

	.MACRO __MULBRRU
	MUL  R@0,R@1
	MOVW R30,R0
	.ENDM

	.MACRO __MULBRR0
	MULS R@0,R@1
	.ENDM

	.MACRO __MULBRRU0
	MUL  R@0,R@1
	.ENDM

	.MACRO __MULBNWRU
	LDI  R26,@2
	MUL  R26,R@0
	MOVW R30,R0
	MUL  R26,R@1
	ADD  R31,R0
	.ENDM

;NAME DEFINITIONS FOR GLOBAL VARIABLES ALLOCATED TO REGISTERS
	.DEF _sound_speed=R4
	.DEF _temperature=R6
	.DEF _period_signal=R9
	.DEF _period_adc=R8
	.DEF _scale=R11
	.DEF _set_temp=R10

	.CSEG
	.ORG 0x00

;START OF CODE MARKER
__START_OF_CODE:

;INTERRUPT VECTORS
	JMP  __RESET
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00

_tbl10_G103:
	.DB  0x10,0x27,0xE8,0x3,0x64,0x0,0xA,0x0
	.DB  0x1,0x0
_tbl16_G103:
	.DB  0x0,0x10,0x0,0x1,0x10,0x0,0x1,0x0

_0x1E3:
	.DB  0x4,0x6,0x1,0xA
_0x0:
	.DB  0x56,0x79,0x73,0x6F,0x6B,0x0,0x20,0x75
	.DB  0x0,0x65,0x6E,0x0,0x20,0x74,0x65,0x63
	.DB  0x68,0x6E,0x69,0x63,0x6B,0x0,0x20,0x76
	.DB  0x20,0x42,0x72,0x6E,0x0,0x55,0x6C,0x74
	.DB  0x72,0x61,0x7A,0x76,0x75,0x6B,0x6F,0x76
	.DB  0x0,0x20,0x6D,0x0,0x76,0x7A,0x64,0x0
	.DB  0x6C,0x65,0x6E,0x6F,0x73,0x74,0x69,0x0
	.DB  0x4D,0x69,0x63,0x68,0x61,0x6C,0x20,0x47
	.DB  0x69,0x65,0x6D,0x7A,0x61,0x0,0x70,0x6F
	.DB  0x6B,0x72,0x61,0x0,0x75,0x6A,0x20,0x74
	.DB  0x6C,0x61,0x0,0x74,0x6B,0x65,0x6D,0x0
	.DB  0x4F,0x4B,0x0,0x53,0x74,0x69,0x73,0x6B
	.DB  0x6E,0x69,0x20,0x4F,0x4B,0x20,0x70,0x72
	.DB  0x6F,0x0,0x6F,0x64,0x65,0x73,0x6C,0x0
	.DB  0x20,0x64,0x61,0x74,0x20,0x64,0x6F,0x0
	.DB  0x70,0x6F,0x0,0x74,0x61,0x0,0x65,0x2E
	.DB  0x0,0x5A,0x6B,0x6F,0x6E,0x74,0x72,0x6F
	.DB  0x6C,0x75,0x6A,0x2C,0x20,0x6A,0x65,0x73
	.DB  0x74,0x6C,0x69,0x20,0x6A,0x65,0x0,0x69
	.DB  0x70,0x6F,0x6A,0x65,0x6E,0x20,0x55,0x53
	.DB  0x42,0x20,0x6B,0x61,0x62,0x65,0x6C,0x2C
	.DB  0x0,0x6A,0x65,0x73,0x74,0x6C,0x69,0x20
	.DB  0x6A,0x65,0x20,0x73,0x70,0x75,0x0,0x70
	.DB  0x72,0x6F,0x67,0x72,0x61,0x6D,0x20,0x61
	.DB  0x20,0x6A,0x65,0x20,0x6E,0x61,0x76,0x0
	.DB  0x6E,0x6F,0x0,0x73,0x70,0x6F,0x6A,0x65
	.DB  0x6E,0x0,0x20,0x73,0x20,0x6D,0x0,0x28
	.DB  0x73,0x74,0x69,0x73,0x6B,0x6E,0x75,0x74
	.DB  0x0,0x74,0x6B,0x6F,0x20,0x0,0x22,0x70
	.DB  0x0,0x69,0x70,0x6F,0x6A,0x20,0x70,0x0
	.DB  0x73,0x74,0x72,0x6F,0x6A,0x22,0x0,0x76
	.DB  0x20,0x70,0x72,0x6F,0x67,0x72,0x61,0x6D
	.DB  0x75,0x29,0x2E,0x0,0x20,0x2D,0x0,0x6D
	.DB  0x2F,0x73,0x0,0x31,0x30,0x20,0x20,0x75
	.DB  0x73,0x0,0x31,0x33,0x20,0x20,0x75,0x73
	.DB  0x0,0x32,0x31,0x20,0x20,0x75,0x73,0x0
	.DB  0x33,0x34,0x20,0x20,0x75,0x73,0x0,0x36
	.DB  0x30,0x20,0x20,0x75,0x73,0x0,0x31,0x31
	.DB  0x32,0x20,0x75,0x73,0x0,0x32,0x32,0x34
	.DB  0x20,0x75,0x73,0x0,0x65,0x6E,0x6F,0x73
	.DB  0x20,0x64,0x61,0x74,0x3A,0x0,0x31,0x30
	.DB  0x30,0x0,0x20,0x20,0x20,0x20,0x20,0x20
	.DB  0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20
	.DB  0x20,0x20,0x20,0x20,0x20,0x20,0x0,0x4E
	.DB  0x61,0x73,0x74,0x61,0x76,0x65,0x6E,0x0
	.DB  0x70,0x65,0x72,0x69,0x6F,0x64,0x61,0x20
	.DB  0x76,0x7A,0x6F,0x72,0x6B,0x6F,0x76,0x0
	.DB  0x65,0x74,0x20,0x6B,0x6D,0x69,0x74,0x75
	.DB  0x20,0x76,0x20,0x64,0x0,0x76,0x63,0x65
	.DB  0x3A,0x0,0x74,0x6B,0x6F,0x20,0x67,0x72
	.DB  0x61,0x66,0x75,0x3A,0x0,0x61,0x75,0x74
	.DB  0x6F,0x20,0x20,0x20,0x20,0x20,0x20,0x20
	.DB  0x0,0x20,0x78,0x20,0x64,0x0,0x6C,0x65
	.DB  0x6E,0x6F,0x0,0x72,0x79,0x63,0x68,0x6C
	.DB  0x6F,0x73,0x74,0x20,0x7A,0x76,0x75,0x6B
	.DB  0x75,0x20,0x3A,0x0,0x6B,0x6F,0x6E,0x73
	.DB  0x74,0x2E,0x20,0x33,0x34,0x37,0x6D,0x2F
	.DB  0x73,0x0,0x70,0x6F,0x64,0x6C,0x65,0x20
	.DB  0x74,0x65,0x70,0x6C,0x6F,0x74,0x79,0x0
	.DB  0x7A,0x70,0x0
_0x2040060:
	.DB  0x1
_0x2040000:
	.DB  0x2D,0x4E,0x41,0x4E,0x0,0x49,0x4E,0x46
	.DB  0x0

__GLOBAL_INI_TBL:
	.DW  0x06
	.DW  _0x6B
	.DW  _0x0*2

	.DW  0x03
	.DW  _0x6B+6
	.DW  _0x0*2+6

	.DW  0x03
	.DW  _0x6B+9
	.DW  _0x0*2+9

	.DW  0x0A
	.DW  _0x6B+12
	.DW  _0x0*2+12

	.DW  0x07
	.DW  _0x6B+22
	.DW  _0x0*2+22

	.DW  0x0C
	.DW  _0x6B+29
	.DW  _0x0*2+29

	.DW  0x03
	.DW  _0x6B+41
	.DW  _0x0*2+41

	.DW  0x03
	.DW  _0x6B+44
	.DW  _0x0*2+9

	.DW  0x04
	.DW  _0x6B+47
	.DW  _0x0*2+44

	.DW  0x08
	.DW  _0x6B+51
	.DW  _0x0*2+48

	.DW  0x0E
	.DW  _0x6B+59
	.DW  _0x0*2+56

	.DW  0x06
	.DW  _0x6B+73
	.DW  _0x0*2+70

	.DW  0x07
	.DW  _0x6B+79
	.DW  _0x0*2+76

	.DW  0x05
	.DW  _0x6B+86
	.DW  _0x0*2+83

	.DW  0x03
	.DW  _0x6C
	.DW  _0x0*2+88

	.DW  0x0F
	.DW  _0x6D
	.DW  _0x0*2+91

	.DW  0x06
	.DW  _0x6D+15
	.DW  _0x0*2+106

	.DW  0x08
	.DW  _0x6D+21
	.DW  _0x0*2+112

	.DW  0x03
	.DW  _0x6D+29
	.DW  _0x0*2+120

	.DW  0x03
	.DW  _0x6D+32
	.DW  _0x0*2+123

	.DW  0x03
	.DW  _0x6D+35
	.DW  _0x0*2+126

	.DW  0x16
	.DW  _0x6D+38
	.DW  _0x0*2+129

	.DW  0x12
	.DW  _0x6D+60
	.DW  _0x0*2+151

	.DW  0x0E
	.DW  _0x6D+78
	.DW  _0x0*2+169

	.DW  0x11
	.DW  _0x6D+92
	.DW  _0x0*2+183

	.DW  0x03
	.DW  _0x6D+109
	.DW  _0x0*2+200

	.DW  0x07
	.DW  _0x6D+112
	.DW  _0x0*2+203

	.DW  0x05
	.DW  _0x6D+119
	.DW  _0x0*2+210

	.DW  0x03
	.DW  _0x6D+124
	.DW  _0x0*2+85

	.DW  0x0A
	.DW  _0x6D+127
	.DW  _0x0*2+215

	.DW  0x05
	.DW  _0x6D+137
	.DW  _0x0*2+78

	.DW  0x05
	.DW  _0x6D+142
	.DW  _0x0*2+225

	.DW  0x03
	.DW  _0x6D+147
	.DW  _0x0*2+230

	.DW  0x07
	.DW  _0x6D+150
	.DW  _0x0*2+233

	.DW  0x07
	.DW  _0x6D+157
	.DW  _0x0*2+240

	.DW  0x0D
	.DW  _0x6D+164
	.DW  _0x0*2+247

	.DW  0x03
	.DW  _0x89
	.DW  _0x0*2+260

	.DW  0x04
	.DW  _0x91
	.DW  _0x0*2+263

	.DW  0x07
	.DW  _0x96
	.DW  _0x0*2+267

	.DW  0x07
	.DW  _0x96+7
	.DW  _0x0*2+274

	.DW  0x07
	.DW  _0x96+14
	.DW  _0x0*2+281

	.DW  0x07
	.DW  _0x96+21
	.DW  _0x0*2+288

	.DW  0x07
	.DW  _0x96+28
	.DW  _0x0*2+295

	.DW  0x07
	.DW  _0x96+35
	.DW  _0x0*2+302

	.DW  0x07
	.DW  _0x96+42
	.DW  _0x0*2+309

	.DW  0x0A
	.DW  _0xCE
	.DW  _0x0*2+316

	.DW  0x04
	.DW  _0xCE+10
	.DW  _0x0*2+326

	.DW  0x15
	.DW  _0x119
	.DW  _0x0*2+330

	.DW  0x09
	.DW  _0x119+21
	.DW  _0x0*2+351

	.DW  0x10
	.DW  _0x119+30
	.DW  _0x0*2+360

	.DW  0x03
	.DW  _0x119+46
	.DW  _0x0*2+120

	.DW  0x0D
	.DW  _0x119+49
	.DW  _0x0*2+376

	.DW  0x05
	.DW  _0x119+62
	.DW  _0x0*2+389

	.DW  0x0B
	.DW  _0x119+67
	.DW  _0x0*2+394

	.DW  0x0C
	.DW  _0x119+78
	.DW  _0x0*2+405

	.DW  0x05
	.DW  _0x119+90
	.DW  _0x0*2+417

	.DW  0x05
	.DW  _0x119+95
	.DW  _0x0*2+422

	.DW  0x11
	.DW  _0x119+100
	.DW  _0x0*2+427

	.DW  0x0E
	.DW  _0x119+117
	.DW  _0x0*2+444

	.DW  0x0E
	.DW  _0x119+131
	.DW  _0x0*2+458

	.DW  0x03
	.DW  _0x119+145
	.DW  _0x0*2+472

	.DW  0x0C
	.DW  _0x119+148
	.DW  _0x0*2+405

	.DW  0x05
	.DW  _0x119+160
	.DW  _0x0*2+417

	.DW  0x05
	.DW  _0x119+165
	.DW  _0x0*2+422

	.DW  0x0E
	.DW  _0x119+170
	.DW  _0x0*2+444

	.DW  0x0E
	.DW  _0x119+184
	.DW  _0x0*2+458

	.DW  0x15
	.DW  _0x119+198
	.DW  _0x0*2+330

	.DW  0x04
	.DW  0x08
	.DW  _0x1E3*2

	.DW  0x01
	.DW  __seed_G102
	.DW  _0x2040060*2

_0xFFFFFFFF:
	.DW  0

__RESET:
	CLI
	CLR  R30
	OUT  EECR,R30

;INTERRUPT VECTORS ARE PLACED
;AT THE START OF FLASH
	LDI  R31,1
	OUT  MCUCR,R31
	OUT  MCUCR,R30
	STS  XMCRB,R30

;DISABLE WATCHDOG
	LDI  R31,0x18
	OUT  WDTCR,R31
	OUT  WDTCR,R30

;CLEAR R2-R14
	LDI  R24,(14-2)+1
	LDI  R26,2
	CLR  R27
__CLEAR_REG:
	ST   X+,R30
	DEC  R24
	BRNE __CLEAR_REG

;CLEAR SRAM
	LDI  R24,LOW(__CLEAR_SRAM_SIZE)
	LDI  R25,HIGH(__CLEAR_SRAM_SIZE)
	LDI  R26,LOW(__SRAM_START)
	LDI  R27,HIGH(__SRAM_START)
__CLEAR_SRAM:
	ST   X+,R30
	SBIW R24,1
	BRNE __CLEAR_SRAM

;GLOBAL VARIABLES INITIALIZATION
	LDI  R30,LOW(__GLOBAL_INI_TBL*2)
	LDI  R31,HIGH(__GLOBAL_INI_TBL*2)
__GLOBAL_INI_NEXT:
	LPM  R24,Z+
	LPM  R25,Z+
	SBIW R24,0
	BREQ __GLOBAL_INI_END
	LPM  R26,Z+
	LPM  R27,Z+
	LPM  R0,Z+
	LPM  R1,Z+
	MOVW R22,R30
	MOVW R30,R0
__GLOBAL_INI_LOOP:
	LPM  R0,Z+
	ST   X+,R0
	SBIW R24,1
	BRNE __GLOBAL_INI_LOOP
	MOVW R30,R22
	RJMP __GLOBAL_INI_NEXT
__GLOBAL_INI_END:

;HARDWARE STACK POINTER INITIALIZATION
	LDI  R30,LOW(__SRAM_END-__HEAP_SIZE)
	OUT  SPL,R30
	LDI  R30,HIGH(__SRAM_END-__HEAP_SIZE)
	OUT  SPH,R30

;DATA STACK POINTER INITIALIZATION
	LDI  R28,LOW(__SRAM_START+__DSTACK_SIZE)
	LDI  R29,HIGH(__SRAM_START+__DSTACK_SIZE)

	JMP  _main

	.ESEG
	.ORG 0

	.DSEG
	.ORG 0x500

	.CSEG
;/*****************************************************
;Chip type               : ATmega64L
;Program type            : Application
;AVR Core Clock frequency: 8,000000 MHz
;Memory model            : Small
;External RAM size       : 0
;Data Stack size         : 1024
;*****************************************************/
;
;//#define SWITCH5 PINE.7                   // tlacitka - v klidu 1, stisknute 0
;//#define SWITCH4 PINE.6
;#define SWITCH1 PINE.5
;#define SWITCH2 PINE.4
;#define SWITCH3 PINE.3
;
;#include <mega64.h>
	#ifndef __SLEEP_DEFINED__
	#define __SLEEP_DEFINED__
	.EQU __se_bit=0x20
	.EQU __sm_mask=0x1C
	.EQU __sm_powerdown=0x10
	.EQU __sm_powersave=0x18
	.EQU __sm_standby=0x14
	.EQU __sm_ext_standby=0x1C
	.EQU __sm_adc_noise_red=0x08
	.SET power_ctrl_reg=mcucr
	#endif
;#include <delay.h>      // casove funkce
;#include <math.h>       // logaritmus
;
;#include "t6963c.h"

	.CSEG
_LCD_reset:
	CBI  0x12,6
	LDI  R30,LOW(1)
	LDI  R31,HIGH(1)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	SBI  0x12,6
	RET
_LCD_status:
	SBI  0x12,5
	SBI  0x12,2
	CBI  0x12,3
	CBI  0x12,4
	LDI  R30,LOW(0)
	OUT  0x14,R30
_0xF:
	SBIS 0x13,0
	RJMP _0x12
	SBIC 0x13,1
	RJMP _0x11
_0x12:
	RJMP _0xF
_0x11:
	IN   R30,0x13
	RET
_LCD_write_command:
;	a -> Y+0
	LDI  R30,LOW(255)
	OUT  0x14,R30
	LD   R30,Y
	OUT  0x15,R30
	SBI  0x12,5
	SBI  0x12,3
	CBI  0x12,2
	CBI  0x12,4
	SBI  0x12,4
	RJMP _0x20A000B
_LCD_write_data:
;	a -> Y+0
	LDI  R30,LOW(255)
	OUT  0x14,R30
	LD   R30,Y
	OUT  0x15,R30
	SBI  0x12,3
	CBI  0x12,5
	CBI  0x12,2
	CBI  0x12,4
	SBI  0x12,2
	SBI  0x12,4
	SBI  0x12,5
	RJMP _0x20A000B
_LCD_init:
	SBI  0x12,7
	SBI  0x12,3
	SBI  0x12,5
	SBI  0x12,2
	SBI  0x12,4
	LDI  R30,LOW(255)
	OUT  0x11,R30
	OUT  0x11,R30
	RCALL _LCD_reset
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(64)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(22)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(65)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(12)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(66)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(22)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(67)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(129)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(159)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(167)
	RJMP _0x20A0009
_LCD_mode_set:
;	mode -> Y+0
	SBI  0x12,7
	SBI  0x12,3
	SBI  0x12,5
	SBI  0x12,2
	SBI  0x12,4
	LDI  R30,LOW(255)
	OUT  0x11,R30
	OUT  0x11,R30
	RCALL _LCD_status
	LD   R30,Y
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	RJMP _0x20A000B
_LCD_display_mode:
;	cursor -> Y+2
;	display -> Y+1
;	line -> Y+0
	SBI  0x12,7
	SBI  0x12,3
	SBI  0x12,5
	SBI  0x12,2
	SBI  0x12,4
	LDI  R30,LOW(255)
	OUT  0x11,R30
	OUT  0x11,R30
	RCALL _LCD_status
	LDD  R26,Y+2
	SUBI R26,-LOW(145)
	LDD  R30,Y+1
	LSL  R30
	LSL  R30
	ADD  R30,R26
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LD   R30,Y
	SUBI R30,-LOW(159)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	RJMP _0x20A000D
_LCD_cursor_xy:
;	a -> Y+1
;	b -> Y+0
	RCALL _LCD_status
	LDD  R30,Y+1
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LD   R30,Y
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(33)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	ADIW R28,2
	RET
_LCD_text_xy:
	CALL __SAVELOCR4
;	a -> Y+5
;	b -> Y+4
;	x -> R16,R17
;	y -> R19
	LDD  R22,Y+5
	CLR  R23
	LDD  R26,Y+4
	LDI  R30,LOW(22)
	MUL  R30,R26
	MOVW R30,R0
	ADD  R30,R22
	ADC  R31,R23
	MOVW R16,R30
	__CPWRN 16,17,256
	BRLO _0x4A
	LDI  R19,LOW(1)
	RJMP _0x4B
_0x4A:
	LDI  R19,LOW(0)
_0x4B:
	RCALL _LCD_status
	ST   -Y,R16
	RCALL _LCD_write_data
	RCALL _LCD_status
	ST   -Y,R19
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(36)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	CALL __LOADLOCR4
	RJMP _0x20A000C
_LCD_char:
;	a -> Y+0
	LD   R30,Y
	LDI  R31,0
	SBIW R30,32
	RJMP _0x20A000A
_LCD_string:
	ST   -Y,R17
	ST   -Y,R16
;	*a -> Y+2
;	i -> R17
;	n -> R16
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	ST   -Y,R31
	ST   -Y,R30
	CALL _strlen
	MOV  R16,R30
	LDI  R17,LOW(0)
_0x4D:
	CP   R16,R17
	BREQ _0x4E
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	CLR  R30
	ADD  R26,R17
	ADC  R27,R30
	LD   R30,X
	ST   -Y,R30
	RCALL _LCD_char
	SUBI R17,-1
	RJMP _0x4D
_0x4E:
	LDD  R17,Y+1
	LDD  R16,Y+0
	ADIW R28,4
	RET
_LCD_clr_text:
	ST   -Y,R17
	ST   -Y,R16
;	i -> R16,R17
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(36)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	__GETWRN 16,17,0
_0x50:
	__CPWRN 16,17,352
	BRSH _0x51
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(192)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	__ADDWRN 16,17,1
	RJMP _0x50
_0x51:
	LD   R16,Y+
	LD   R17,Y+
	RET
_LCD_clr_gr:
	ST   -Y,R17
	ST   -Y,R16
;	a -> Y+2
;	i -> R16,R17
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(12)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(36)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	__GETWRN 16,17,0
_0x53:
	__CPWRN 16,17,2816
	BRSH _0x54
	LDD  R30,Y+2
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(192)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	__ADDWRN 16,17,1
	RJMP _0x53
_0x54:
	LDD  R17,Y+1
	LDD  R16,Y+0
_0x20A000D:
	ADIW R28,3
	RET
_LCD_set_pixel:
	CALL __SAVELOCR6
;	a -> Y+8
;	b -> Y+7
;	show -> Y+6
;	x -> R16,R17
;	y -> R18,R19
;	z -> R21
	__GETWRN 18,19,12
	LDD  R21,Y+8
	LDD  R26,Y+8
	LDI  R27,0
	LDI  R30,LOW(6)
	LDI  R31,HIGH(6)
	CALL __DIVW21
	STD  Y+8,R30
	MOV  R22,R21
	CLR  R23
	LDD  R26,Y+8
	LDI  R30,LOW(6)
	MUL  R30,R26
	MOVW R30,R0
	MOVW R26,R30
	MOVW R30,R22
	SUB  R30,R26
	SBC  R31,R27
	LDI  R26,LOW(5)
	LDI  R27,HIGH(5)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R21,R30
	LDD  R22,Y+8
	CLR  R23
	LDD  R26,Y+7
	LDI  R30,LOW(22)
	MUL  R30,R26
	MOVW R30,R0
	ADD  R30,R22
	ADC  R31,R23
	MOVW R16,R30
	MOV  R30,R17
	ANDI R31,HIGH(0x0)
	__ADDWRR 18,19,30,31
	ST   -Y,R16
	RCALL _LCD_write_data
	RCALL _LCD_status
	ST   -Y,R18
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(36)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDD  R30,Y+6
	LSL  R30
	LSL  R30
	LSL  R30
	SUBI R30,-LOW(240)
	ADD  R30,R21
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	CALL __LOADLOCR6
	ADIW R28,9
	RET
_LCD_line:
	SBIW R28,4
	CALL __SAVELOCR6
;	x1 -> Y+14
;	y1 -> Y+13
;	x2 -> Y+12
;	y2 -> Y+11
;	show -> Y+10
;	dy -> R16,R17
;	dx -> R18,R19
;	stepx -> R20,R21
;	stepy -> Y+8
;	fraction -> Y+6
	LDD  R26,Y+11
	CLR  R27
	LDD  R30,Y+13
	LDI  R31,0
	SUB  R26,R30
	SBC  R27,R31
	MOVW R16,R26
	LDD  R26,Y+12
	CLR  R27
	LDD  R30,Y+14
	LDI  R31,0
	SUB  R26,R30
	SBC  R27,R31
	MOVW R18,R26
	TST  R17
	BRPL _0x55
	MOVW R30,R16
	CALL __ANEGW1
	MOVW R16,R30
	LDI  R30,LOW(65535)
	LDI  R31,HIGH(65535)
	RJMP _0x1D5
_0x55:
	LDI  R30,LOW(1)
	LDI  R31,HIGH(1)
_0x1D5:
	STD  Y+8,R30
	STD  Y+8+1,R31
	TST  R19
	BRPL _0x57
	MOVW R30,R18
	CALL __ANEGW1
	MOVW R18,R30
	__GETWRN 20,21,-1
	RJMP _0x58
_0x57:
	__GETWRN 20,21,1
_0x58:
	LSL  R16
	ROL  R17
	LSL  R18
	ROL  R19
	LDD  R30,Y+14
	ST   -Y,R30
	LDD  R30,Y+14
	ST   -Y,R30
	LDD  R30,Y+12
	ST   -Y,R30
	RCALL _LCD_set_pixel
	__CPWRR 16,17,18,19
	BRGE _0x59
	MOVW R30,R18
	ASR  R31
	ROR  R30
	MOVW R26,R30
	MOVW R30,R16
	SUB  R30,R26
	SBC  R31,R27
	STD  Y+6,R30
	STD  Y+6+1,R31
_0x5A:
	LDD  R30,Y+12
	LDD  R26,Y+14
	CP   R30,R26
	BREQ _0x5C
	LDD  R26,Y+7
	TST  R26
	BRMI _0x5D
	LDD  R30,Y+8
	LDD  R26,Y+13
	ADD  R30,R26
	STD  Y+13,R30
	LDD  R30,Y+6
	LDD  R31,Y+6+1
	SUB  R30,R18
	SBC  R31,R19
	STD  Y+6,R30
	STD  Y+6+1,R31
_0x5D:
	MOV  R30,R20
	LDD  R26,Y+14
	ADD  R30,R26
	STD  Y+14,R30
	MOVW R30,R16
	LDD  R26,Y+6
	LDD  R27,Y+6+1
	ADD  R30,R26
	ADC  R31,R27
	STD  Y+6,R30
	STD  Y+6+1,R31
	LDD  R30,Y+14
	ST   -Y,R30
	LDD  R30,Y+14
	ST   -Y,R30
	LDD  R30,Y+12
	ST   -Y,R30
	RCALL _LCD_set_pixel
	RJMP _0x5A
_0x5C:
	RJMP _0x5E
_0x59:
	MOVW R30,R16
	ASR  R31
	ROR  R30
	MOVW R26,R30
	MOVW R30,R18
	SUB  R30,R26
	SBC  R31,R27
	STD  Y+6,R30
	STD  Y+6+1,R31
_0x5F:
	LDD  R30,Y+11
	LDD  R26,Y+13
	CP   R30,R26
	BREQ _0x61
	LDD  R26,Y+7
	TST  R26
	BRMI _0x62
	MOV  R30,R20
	LDD  R26,Y+14
	ADD  R30,R26
	STD  Y+14,R30
	LDD  R30,Y+6
	LDD  R31,Y+6+1
	SUB  R30,R16
	SBC  R31,R17
	STD  Y+6,R30
	STD  Y+6+1,R31
_0x62:
	LDD  R30,Y+8
	LDD  R26,Y+13
	ADD  R30,R26
	STD  Y+13,R30
	MOVW R30,R18
	LDD  R26,Y+6
	LDD  R27,Y+6+1
	ADD  R30,R26
	ADC  R31,R27
	STD  Y+6,R30
	STD  Y+6+1,R31
	LDD  R30,Y+14
	ST   -Y,R30
	LDD  R30,Y+14
	ST   -Y,R30
	LDD  R30,Y+12
	ST   -Y,R30
	RCALL _LCD_set_pixel
	RJMP _0x5F
_0x61:
_0x5E:
	CALL __LOADLOCR6
	ADIW R28,15
	RET
;	x -> Y+9
;	y -> Y+8
;	radius -> Y+7
;	show -> Y+6
;	xc -> R16,R17
;	yc -> R18,R19
;	p -> R20,R21
;	x1 -> Y+4
;	y1 -> Y+3
;	x2 -> Y+2
;	y2 -> Y+1
;	show -> Y+0
_LCD_box_fill:
	ST   -Y,R17
;	x1 -> Y+5
;	y1 -> Y+4
;	x2 -> Y+3
;	y2 -> Y+2
;	show -> Y+1
;	i -> R17
	LDI  R17,LOW(0)
_0x69:
	LDD  R26,Y+2
	CLR  R27
	LDD  R30,Y+4
	LDI  R31,0
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R17
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0x6A
	LDD  R30,Y+5
	ST   -Y,R30
	MOV  R30,R17
	LDD  R26,Y+5
	ADD  R30,R26
	ST   -Y,R30
	LDD  R30,Y+5
	ST   -Y,R30
	MOV  R30,R17
	LDD  R26,Y+7
	ADD  R30,R26
	ST   -Y,R30
	LDD  R30,Y+5
	ST   -Y,R30
	RCALL _LCD_line
	SUBI R17,-1
	RJMP _0x69
_0x6A:
	LDD  R17,Y+0
_0x20A000C:
	ADIW R28,6
	RET
_LCD_char_diacritic:
;	a -> Y+0
	LD   R30,Y
_0x20A000A:
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(192)
	ST   -Y,R30
	RCALL _LCD_write_command
_0x20A000B:
	ADIW R28,1
	RET
_data_auto_inc:
	RCALL _LCD_status
	LDI  R30,LOW(192)
	RJMP _0x20A0009
_wr_comm:
	RCALL _LCD_status
	LDI  R30,LOW(36)
_0x20A0009:
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	RET
_LCD_diacritics_generate:
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(34)
	ST   -Y,R30
	RCALL _LCD_write_command
	RCALL _LCD_status
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(10)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(17)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(31)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(8)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(15)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(17)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(15)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(10)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(22)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(25)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(24)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(12)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(32)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(21)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(40)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(21)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(48)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(63)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(56)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(8)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(63)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(8)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(64)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(17)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(31)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(14)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(72)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(10)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(15)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(16)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(15)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(80)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _LCD_status
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _wr_comm
	LDI  R30,LOW(12)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(18)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(18)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(12)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_write_data
	RCALL _data_auto_inc
	RET
;#include "graphic.h"    // kresleni ikon, text
_intro:
	LDI  R30,LOW(4)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6B,0
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(136)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,6
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,9
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6B,12
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(136)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,22
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(128)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(5)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6B,29
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(136)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,41
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(128)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(130)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,44
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(5)
	ST   -Y,R30
	LDI  R30,LOW(6)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6B,47
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(129)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,51
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(4)
	ST   -Y,R30
	LDI  R30,LOW(9)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6B,59
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(2)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6B,73
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,79
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6B,86
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(23)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(108)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(116)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(21)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(63)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(67)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(110)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(114)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(126)
	RJMP _0x20A0008

	.DSEG
_0x6B:
	.BYTE 0x5B

	.CSEG
_icon_1:
	LDI  R30,LOW(14)
	ST   -Y,R30
	LDI  R30,LOW(117)
	ST   -Y,R30
	LDI  R30,LOW(24)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(20)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(21)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(23)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(21)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(20)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(60)
	ST   -Y,R30
	LDI  R30,LOW(117)
	ST   -Y,R30
	LDI  R30,LOW(70)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(63)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(68)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(67)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(67)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(107)
	ST   -Y,R30
	LDI  R30,LOW(117)
	ST   -Y,R30
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_box_fill
	RET
_icon_2:
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(23)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(108)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(116)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(63)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(67)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(65)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(110)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(114)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(119)
	RJMP _0x20A0008
_icon_3:
	LDI  R30,LOW(14)
	ST   -Y,R30
	LDI  R30,LOW(117)
	ST   -Y,R30
	LDI  R30,LOW(24)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(20)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(21)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(19)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(21)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(60)
	ST   -Y,R30
	LDI  R30,LOW(117)
	ST   -Y,R30
	LDI  R30,LOW(70)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(63)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(68)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(67)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(67)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(126)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(107)
	ST   -Y,R30
	LDI  R30,LOW(117)
	ST   -Y,R30
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(108)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(116)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(108)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(109)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(108)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(109)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(111)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(112)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(114)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(115)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(115)
	ST   -Y,R30
	LDI  R30,LOW(122)
	RJMP _0x20A0008
_icon_4:
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(23)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(61)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(108)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(116)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(62)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(68)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(63)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(63)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(64)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(64)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(109)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(115)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(120)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(114)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(114)
	ST   -Y,R30
	LDI  R30,LOW(123)
_0x20A0008:
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	RET
_icon_5:
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(23)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(60)
	ST   -Y,R30
	LDI  R30,LOW(118)
	ST   -Y,R30
	LDI  R30,LOW(72)
	ST   -Y,R30
	LDI  R30,LOW(128)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_box_fill
	LDI  R30,LOW(16)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(123)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(17)
	ST   -Y,R30
	LDI  R30,LOW(124)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(121)
	ST   -Y,R30
	LDI  R30,LOW(18)
	ST   -Y,R30
	LDI  R30,LOW(125)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(119)
	ST   -Y,R30
	LDI  R30,LOW(22)
	ST   -Y,R30
	LDI  R30,LOW(122)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_line
	LDI  R30,LOW(10)
	ST   -Y,R30
	LDI  R30,LOW(15)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6C,0
	RJMP _0x20A0007

	.DSEG
_0x6C:
	.BYTE 0x3

	.CSEG
_textUSB:
	LDI  R30,LOW(3)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6D,0
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(3)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6D,15
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(129)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(110)
	ST   -Y,R30
	RCALL _LCD_char
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,21
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(6)
	ST   -Y,R30
	LDI  R30,LOW(2)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6D,29
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,32
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,35
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6D,38
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(5)
	ST   -Y,R30
	RCALL _LCD_text_xy
	LDI  R30,LOW(112)
	ST   -Y,R30
	RCALL _LCD_char
	LDI  R30,LOW(130)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,60
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(2)
	ST   -Y,R30
	LDI  R30,LOW(6)
	ST   -Y,R30
	RCALL _LCD_text_xy
	__POINTW1MN _0x6D,78
	ST   -Y,R31
	ST   -Y,R30
	RCALL _LCD_string
	LDI  R30,LOW(92)
	ST   -Y,R30
	LDI  R30,LOW(48)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(94)
	ST   -Y,R30
	LDI  R30,LOW(48)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(93)
	ST   -Y,R30
	LDI  R30,LOW(49)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	RCALL _LCD_set_pixel
	LDI  R30,LOW(15)
	ST   -Y,R30
	LDI  R30,LOW(6)
	ST   -Y,R30
	CALL _LCD_text_xy
	LDI  R30,LOW(115)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(116)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(128)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(110)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(7)
	ST   -Y,R30
	CALL _LCD_text_xy
	__POINTW1MN _0x6D,92
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(129)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(122)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(129)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,109
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(2)
	ST   -Y,R30
	LDI  R30,LOW(8)
	ST   -Y,R30
	CALL _LCD_text_xy
	__POINTW1MN _0x6D,112
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,119
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(128)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(130)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(105)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,124
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(10)
	ST   -Y,R30
	CALL _LCD_text_xy
	__POINTW1MN _0x6D,127
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(136)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,137
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(137)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,142
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(2)
	ST   -Y,R30
	LDI  R30,LOW(11)
	ST   -Y,R30
	CALL _LCD_text_xy
	__POINTW1MN _0x6D,147
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(130)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,150
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(130)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	LDI  R30,LOW(131)
	ST   -Y,R30
	RCALL _LCD_char_diacritic
	__POINTW1MN _0x6D,157
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(4)
	ST   -Y,R30
	LDI  R30,LOW(12)
	ST   -Y,R30
	CALL _LCD_text_xy
	__POINTW1MN _0x6D,164
_0x20A0007:
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	RET

	.DSEG
_0x6D:
	.BYTE 0xB1
;#include "functions.h"  // funkce - prevod dat, zobrazovani int, char, ...

	.CSEG
_read_adc_usonic:
	LDI  R30,LOW(0)
	OUT  0x7,R30
	SBI  0x6,6
_0x6E:
	SBIS 0x6,4
	RJMP _0x6E
	RJMP _0x20A0006
_read_adc_temperature:
	LDI  R30,LOW(3)
	OUT  0x7,R30
	__DELAY_USW 400
	SBI  0x6,6
_0x71:
	SBIS 0x6,4
	RJMP _0x71
_0x20A0006:
	SBI  0x6,4
	IN   R30,0x4
	IN   R31,0x4+1
	RET
;	temp -> Y+4
;	a -> R16,R17
;	b -> R19
_show_distance:
	CALL __SAVELOCR4
;	temp -> Y+4
;	a -> R16,R17
;	b -> R19
;	x -> R18
	LDI  R18,0
	__GETWRS 16,17,4
	LDI  R18,LOW(0)
	MOVW R26,R16
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x74
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	RJMP _0x75
_0x74:
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R18,LOW(1)
_0x75:
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x77
	CPI  R18,0
	BREQ _0x78
_0x77:
	RJMP _0x76
_0x78:
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	RJMP _0x79
_0x76:
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R18,LOW(1)
_0x79:
	LDI  R30,LOW(100)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x7B
	CPI  R18,0
	BREQ _0x7C
_0x7B:
	RJMP _0x7A
_0x7C:
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	RJMP _0x7D
_0x7A:
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R18,LOW(1)
_0x7D:
	LDI  R30,LOW(10)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOV  R19,R16
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(109)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(109)
	RJMP _0x20A0005
_show_voltage:
	CALL __SAVELOCR4
;	temp -> Y+4
;	a -> R16,R17
;	b -> R19
;	x -> R18
	LDI  R18,0
	__GETWRS 16,17,4
	LDI  R18,LOW(0)
	MOVW R26,R16
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x7E
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	RJMP _0x7F
_0x7E:
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R18,LOW(1)
_0x7F:
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x81
	CPI  R18,0
	BREQ _0x82
_0x81:
	RJMP _0x80
_0x82:
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	RJMP _0x83
_0x80:
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R18,LOW(1)
_0x83:
	LDI  R30,LOW(100)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x85
	CPI  R18,0
	BREQ _0x86
_0x85:
	RJMP _0x84
_0x86:
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	RJMP _0x87
_0x84:
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R18,LOW(1)
_0x87:
	LDI  R30,LOW(10)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOV  R19,R16
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(109)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(86)
	RJMP _0x20A0005
_show_sens:
	CALL __SAVELOCR4
;	temp -> Y+4
;	a -> R16,R17
;	b -> R19
	__GETWRS 16,17,4
	MOVW R26,R16
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R19,R30
	CPI  R19,0
	BRNE _0x88
	__POINTW1MN _0x89,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	RJMP _0x8A
_0x88:
	LDI  R30,LOW(45)
	ST   -Y,R30
	CALL _LCD_char
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
_0x8A:
	LDI  R30,LOW(100)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(10)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOV  R19,R16
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(100)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(66)
	RJMP _0x20A0005

	.DSEG
_0x89:
	.BYTE 0x3

	.CSEG
_show_char:
	CALL __SAVELOCR4
;	temp -> Y+4
;	a -> R16,R17
;	b -> R19
	__GETWRS 16,17,4
	MOVW R26,R16
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R26,R19
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R19,R30
	LDI  R30,LOW(100)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOVW R26,R16
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R19,R30
	MOV  R30,R19
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(10)
	MUL  R30,R19
	MOVW R30,R0
	__SUBWRR 16,17,30,31
	MOV  R19,R16
	MOV  R30,R19
	SUBI R30,-LOW(48)
_0x20A0005:
	ST   -Y,R30
	CALL _LCD_char
	CALL __LOADLOCR4
	ADIW R28,6
	RET
_compute_temperature:
	ST   -Y,R17
;	n -> R17
	CLR  R6
	CLR  R7
	LDI  R17,LOW(0)
_0x8C:
	CPI  R17,4
	BRSH _0x8D
	RCALL _read_adc_temperature
	__ADDWRR 6,7,30,31
	SUBI R17,-1
	RJMP _0x8C
_0x8D:
	MOVW R30,R6
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x3F200000
	CALL __MULF12
	CALL __CFD1U
	MOVW R6,R30
	MOVW R26,R6
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x3F1C28F6
	CALL __MULF12
	__GETD2N 0x43A5CCCD
	CALL __ADDF12
	CALL __CFD1U
	MOVW R4,R30
	RJMP _0x20A0004
_generate_usonic:
	ST   -Y,R17
;	m -> Y+1
;	a -> R17
	LDI  R30,LOW(25)
	OUT  0x33,R30
	LDI  R17,LOW(0)
_0x8F:
	LDD  R30,Y+1
	CP   R17,R30
	BRSH _0x90
	__DELAY_USB 67
	SUBI R17,-1
	RJMP _0x8F
_0x90:
	LDI  R30,LOW(24)
	OUT  0x33,R30
	LDD  R17,Y+0
	ADIW R28,2
	RET
_init_mcu:
	LDI  R30,LOW(0)
	OUT  0x1B,R30
	LDI  R30,LOW(255)
	OUT  0x1A,R30
	LDI  R30,LOW(0)
	OUT  0x18,R30
	LDI  R30,LOW(16)
	OUT  0x17,R30
	LDI  R30,LOW(0)
	OUT  0x15,R30
	OUT  0x14,R30
	OUT  0x12,R30
	OUT  0x11,R30
	OUT  0x3,R30
	LDI  R30,LOW(2)
	OUT  0x2,R30
	LDI  R30,LOW(0)
	STS  98,R30
	STS  97,R30
	STS  101,R30
	STS  100,R30
	OUT  0x30,R30
	LDI  R30,LOW(24)
	OUT  0x33,R30
	LDI  R30,LOW(0)
	OUT  0x32,R30
	LDI  R30,LOW(99)
	OUT  0x31,R30
	LDI  R30,LOW(0)
	OUT  0x2F,R30
	OUT  0x2E,R30
	OUT  0x2D,R30
	OUT  0x2C,R30
	OUT  0x27,R30
	OUT  0x26,R30
	OUT  0x2B,R30
	OUT  0x2A,R30
	OUT  0x29,R30
	OUT  0x28,R30
	STS  121,R30
	STS  120,R30
	OUT  0x25,R30
	OUT  0x24,R30
	OUT  0x23,R30
	STS  139,R30
	STS  138,R30
	STS  137,R30
	STS  136,R30
	STS  129,R30
	STS  128,R30
	STS  135,R30
	STS  134,R30
	STS  133,R30
	STS  132,R30
	STS  131,R30
	STS  130,R30
	STS  106,R30
	OUT  0x3A,R30
	OUT  0x39,R30
	OUT  0x37,R30
	STS  125,R30
	OUT  0xB,R30
	LDI  R30,LOW(152)
	OUT  0xA,R30
	LDI  R30,LOW(6)
	STS  149,R30
	LDI  R30,LOW(0)
	STS  144,R30
	LDI  R30,LOW(51)
	OUT  0x9,R30
	LDI  R30,LOW(0)
	STS  154,R30
	LDI  R30,LOW(128)
	OUT  0x8,R30
	LDI  R30,LOW(0)
	OUT  0x20,R30
	LDI  R30,LOW(195)
	OUT  0x7,R30
	LDI  R30,LOW(130)
	OUT  0x6,R30
	LDI  R30,LOW(0)
	OUT  0xD,R30
	STS  116,R30
	RET
_show_temperature:
	CALL __SAVELOCR4
;	b -> R17
;	a -> R18,R19
	LDI  R30,LOW(5)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_text_xy
	MOVW R18,R6
	MOVW R26,R18
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(100)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(46)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(10)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOV  R17,R18
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(138)
	ST   -Y,R30
	CALL _LCD_char_diacritic
	LDI  R30,LOW(67)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
	MOVW R18,R4
	MOVW R26,R18
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(100)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(10)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOV  R17,R18
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _LCD_char
	__POINTW1MN _0x91,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	RJMP _0x20A0003

	.DSEG
_0x91:
	.BYTE 0x4

	.CSEG
_show_period_adc:
	MOV  R30,R8
	LDI  R31,0
	CPI  R30,LOW(0x1)
	LDI  R26,HIGH(0x1)
	CPC  R31,R26
	BRNE _0x95
	__POINTW1MN _0x96,0
	RJMP _0x1D7
_0x95:
	CPI  R30,LOW(0x2)
	LDI  R26,HIGH(0x2)
	CPC  R31,R26
	BRNE _0x97
	__POINTW1MN _0x96,7
	RJMP _0x1D7
_0x97:
	CPI  R30,LOW(0x3)
	LDI  R26,HIGH(0x3)
	CPC  R31,R26
	BRNE _0x98
	__POINTW1MN _0x96,14
	RJMP _0x1D7
_0x98:
	CPI  R30,LOW(0x4)
	LDI  R26,HIGH(0x4)
	CPC  R31,R26
	BRNE _0x99
	__POINTW1MN _0x96,21
	RJMP _0x1D7
_0x99:
	CPI  R30,LOW(0x5)
	LDI  R26,HIGH(0x5)
	CPC  R31,R26
	BRNE _0x9A
	__POINTW1MN _0x96,28
	RJMP _0x1D7
_0x9A:
	CPI  R30,LOW(0x6)
	LDI  R26,HIGH(0x6)
	CPC  R31,R26
	BRNE _0x9B
	__POINTW1MN _0x96,35
	RJMP _0x1D7
_0x9B:
	CPI  R30,LOW(0x7)
	LDI  R26,HIGH(0x7)
	CPC  R31,R26
	BRNE _0x94
	__POINTW1MN _0x96,42
_0x1D7:
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
_0x94:
	RET

	.DSEG
_0x96:
	.BYTE 0x31

	.CSEG
_compute_scale:
	CALL __SAVELOCR4
;	max -> R16,R17
;	scale_auto -> R19
;	n -> R18
	LDI  R19,LOW(1)
	TST  R11
	BREQ PC+3
	JMP _0x9D
	__GETWRMN 16,17,0,_array
	LDI  R18,LOW(0)
_0x9F:
	CPI  R18,100
	BRSH _0xA0
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	CP   R16,R30
	CPC  R17,R31
	BRSH _0xA1
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	LD   R16,X+
	LD   R17,X
_0xA1:
	SUBI R18,-1
	RJMP _0x9F
_0xA0:
	__CPWRN 16,17,919
	BRLO _0xA2
	LDI  R19,LOW(10)
_0xA2:
	__CPWRN 16,17,817
	BRLO _0xA4
	__CPWRN 16,17,919
	BRLO _0xA5
_0xA4:
	RJMP _0xA3
_0xA5:
	LDI  R19,LOW(9)
_0xA3:
	__CPWRN 16,17,715
	BRLO _0xA7
	__CPWRN 16,17,817
	BRLO _0xA8
_0xA7:
	RJMP _0xA6
_0xA8:
	LDI  R19,LOW(8)
_0xA6:
	__CPWRN 16,17,613
	BRLO _0xAA
	__CPWRN 16,17,715
	BRLO _0xAB
_0xAA:
	RJMP _0xA9
_0xAB:
	LDI  R19,LOW(7)
_0xA9:
	__CPWRN 16,17,511
	BRLO _0xAD
	__CPWRN 16,17,613
	BRLO _0xAE
_0xAD:
	RJMP _0xAC
_0xAE:
	LDI  R19,LOW(6)
_0xAC:
	__CPWRN 16,17,409
	BRLO _0xB0
	__CPWRN 16,17,511
	BRLO _0xB1
_0xB0:
	RJMP _0xAF
_0xB1:
	LDI  R19,LOW(5)
_0xAF:
	__CPWRN 16,17,307
	BRLO _0xB3
	__CPWRN 16,17,409
	BRLO _0xB4
_0xB3:
	RJMP _0xB2
_0xB4:
	LDI  R19,LOW(4)
_0xB2:
	__CPWRN 16,17,205
	BRLO _0xB6
	__CPWRN 16,17,307
	BRLO _0xB7
_0xB6:
	RJMP _0xB5
_0xB7:
	LDI  R19,LOW(3)
_0xB5:
	__CPWRN 16,17,103
	BRLO _0xB9
	__CPWRN 16,17,205
	BRLO _0xBA
_0xB9:
	RJMP _0xB8
_0xBA:
	LDI  R19,LOW(2)
_0xB8:
	__CPWRN 16,17,103
	BRSH _0xBB
	LDI  R19,LOW(1)
_0xBB:
	LDI  R18,LOW(0)
_0xBD:
	CPI  R18,100
	BRLO PC+3
	JMP _0xBE
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R30,R26
	ADC  R31,R27
	MOVW R22,R30
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	MOVW R26,R30
	MOV  R30,R19
	LDI  R31,0
	CALL __DIVW21
	MOVW R26,R22
	ST   X+,R30
	ST   X,R31
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	CPI  R30,LOW(0x65)
	LDI  R26,HIGH(0x65)
	CPC  R31,R26
	BRLT _0xBF
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	ST   X+,R30
	ST   X,R31
_0xBF:
	SUBI R18,-1
	RJMP _0xBD
_0xBE:
_0x9D:
	TST  R11
	BRNE PC+3
	JMP _0xC0
	LDI  R18,LOW(0)
_0xC2:
	CPI  R18,100
	BRLO PC+3
	JMP _0xC3
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R30,R26
	ADC  R31,R27
	MOVW R22,R30
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	MOVW R26,R30
	MOV  R30,R11
	LDI  R31,0
	CALL __DIVW21
	MOVW R26,R22
	ST   X+,R30
	ST   X,R31
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	CPI  R30,LOW(0x65)
	LDI  R26,HIGH(0x65)
	CPC  R31,R26
	BRLT _0xC4
	MOV  R30,R18
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	ST   X+,R30
	ST   X,R31
_0xC4:
	SUBI R18,-1
	RJMP _0xC2
_0xC3:
_0xC0:
	RJMP _0x20A0003
_show_graph:
	ST   -Y,R17
	ST   -Y,R16
;	n -> R16,R17
	__GETWRN 16,17,0
_0xC6:
	__CPWRN 16,17,99
	BRSH _0xC7
	MOV  R30,R16
	SUBI R30,-LOW(13)
	ST   -Y,R30
	MOVW R30,R16
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(113)
	LDI  R27,HIGH(113)
	SUB  R26,R30
	SBC  R27,R31
	ST   -Y,R26
	MOV  R30,R16
	SUBI R30,-LOW(14)
	ST   -Y,R30
	MOVW R26,R16
	LSL  R26
	ROL  R27
	__ADDW2MN _array,2
	CALL __GETW1P
	LDI  R26,LOW(113)
	LDI  R27,HIGH(113)
	SUB  R26,R30
	SBC  R27,R31
	ST   -Y,R26
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_line
	__ADDWRN 16,17,1
	RJMP _0xC6
_0xC7:
	__GETWRN 16,17,0
_0xC9:
	__CPWRN 16,17,53
	BRSH _0xCA
	MOV  R30,R16
	LSL  R30
	SUBI R30,-LOW(12)
	ST   -Y,R30
	LDI  R30,LOW(114)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_set_pixel
	LDI  R30,LOW(12)
	ST   -Y,R30
	__MULBNWRU 16,17,2
	LDI  R26,LOW(114)
	LDI  R27,HIGH(114)
	SUB  R26,R30
	SBC  R27,R31
	ST   -Y,R26
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_set_pixel
	__ADDWRN 16,17,1
	RJMP _0xC9
_0xCA:
	LDI  R30,LOW(20)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	CALL _LCD_text_xy
	LDI  R30,LOW(116)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_text_xy
	LDI  R30,LOW(85)
	ST   -Y,R30
	CALL _LCD_char
	LD   R16,Y+
	LD   R17,Y+
	RET
_clear_graph:
	ST   -Y,R17
;	n -> R17
	LDI  R17,LOW(0)
_0xCC:
	CPI  R17,99
	BRSH _0xCD
	MOV  R30,R17
	SUBI R30,-LOW(13)
	ST   -Y,R30
	MOV  R30,R17
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(113)
	LDI  R27,HIGH(113)
	SUB  R26,R30
	SBC  R27,R31
	ST   -Y,R26
	MOV  R30,R17
	SUBI R30,-LOW(14)
	ST   -Y,R30
	MOV  R26,R17
	CLR  R27
	LSL  R26
	ROL  R27
	__ADDW2MN _array,2
	CALL __GETW1P
	LDI  R26,LOW(113)
	LDI  R27,HIGH(113)
	SUB  R26,R30
	SBC  R27,R31
	ST   -Y,R26
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_line
	SUBI R17,-1
	RJMP _0xCC
_0xCD:
_0x20A0004:
	LD   R17,Y+
	RET
_dataUSB:
	CALL __SAVELOCR4
;	b -> R17
;	n -> R16
;	a -> R18,R19
	LDI  R16,0
	LDI  R30,LOW(5)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
	LDI  R30,LOW(112)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(130)
	ST   -Y,R30
	CALL _LCD_char_diacritic
	__POINTW1MN _0xCE,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(11)
	ST   -Y,R30
	LDI  R30,LOW(8)
	ST   -Y,R30
	CALL _LCD_text_xy
	LDI  R30,LOW(37)
	ST   -Y,R30
	CALL _LCD_char
	LDI  R30,LOW(8)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
	MOV  R30,R16
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	RCALL _show_char
	MOV  R30,R8
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	MOVW R18,R6
	MOVW R26,R18
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	LDI  R30,LOW(100)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	LDI  R30,LOW(10)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOV  R17,R18
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	LDI  R16,LOW(0)
_0xD0:
	CPI  R16,100
	BRLO PC+3
	JMP _0xD1
	LDI  R30,LOW(8)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
	MOV  R30,R16
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	RCALL _show_char
	MOV  R30,R16
	LDI  R26,LOW(_voltage)
	LDI  R27,HIGH(_voltage)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	LD   R18,X+
	LD   R19,X
	MOVW R26,R18
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(10000)
	LDI  R31,HIGH(10000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	MOV  R26,R17
	LDI  R27,0
	LDI  R30,LOW(1000)
	LDI  R31,HIGH(1000)
	CALL __MULW12
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(100)
	LDI  R31,HIGH(100)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	LDI  R30,LOW(100)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOVW R26,R18
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	CALL __DIVW21U
	MOV  R17,R30
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	LDI  R30,LOW(10)
	MUL  R30,R17
	MOVW R30,R0
	__SUBWRR 18,19,30,31
	MOV  R17,R18
	MOV  R30,R17
	SUBI R30,-LOW(48)
	ST   -Y,R30
	CALL _putchar
	LDI  R30,LOW(40)
	LDI  R31,HIGH(40)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	SUBI R16,-1
	RJMP _0xD0
_0xD1:
	LDI  R30,LOW(7)
	ST   -Y,R30
	LDI  R30,LOW(8)
	ST   -Y,R30
	CALL _LCD_text_xy
	__POINTW1MN _0xCE,10
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
	LDI  R30,LOW(200)
	LDI  R31,HIGH(200)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
_0x20A0003:
	CALL __LOADLOCR4
	ADIW R28,4
	RET

	.DSEG
_0xCE:
	.BYTE 0xE
;
;#include <stdio.h>      // Standard Input/Output functions
;#include <stdlib.h>
;
;    int array[100];     // pole hodnot z AD prevodniku (1023 max)
;    int voltage[100];   // prepocitane hodnoty na napeti v mV
;
;    unsigned int sound_speed;           // rychlost zvuku v m/s
;    unsigned int temperature;           // teplota - v desetinach stupne (23,4C = 234)
;    unsigned char period_signal=6;      // pocet period ve vyslanem ultrazvukovem signalu - davce
;    unsigned char period_adc=4;         // perida prevodu adc - merici rozsah
;    unsigned char scale=10;             // meritko grafu - 0=automaticke
;    unsigned char set_temp=1;           // merit teplotu (1) nebo nemerit (0)
;
;    eeprom char e_period_signal;        // promenne pro ukladani nastaveni do EEPROM
;    eeprom char e_period_adc;
;    eeprom char e_scale;
;    eeprom char e_set_temp;
;
;void main(void)
; 0000 002B {

	.CSEG
_main:
; 0000 002C     unsigned int m;
; 0000 002D     unsigned int distance;
; 0000 002E     float time;
; 0000 002F     unsigned char sensitivity;
; 0000 0030     float voltage_x;
; 0000 0031     unsigned char n;
; 0000 0032     unsigned int x;
; 0000 0033     unsigned char status=1;  // stav ve kterem je program -> 1-mereni, 0-pauza, 2-nastaveni, 3-prohlizeni prubehu
; 0000 0034     unsigned char setting=1;
; 0000 0035 
; 0000 0036 //***************************************************************************************************************
; 0000 0037 
; 0000 0038     init_mcu();             // inicializace mikrokontroleru - nastaveni bran, AD prevodnik, UART, timer0
	SBIW R28,12
	LDI  R30,LOW(1)
	ST   Y,R30
	STD  Y+1,R30
;	m -> R16,R17
;	distance -> R18,R19
;	time -> Y+8
;	sensitivity -> R21
;	voltage_x -> Y+4
;	n -> R20
;	x -> Y+2
;	status -> Y+1
;	setting -> Y+0
	RCALL _init_mcu
; 0000 0039 
; 0000 003A     LCD_init();             // inicializace displeje
	CALL _LCD_init
; 0000 003B     LCD_clr_text();         // smazani displeje - text
	CALL _LCD_clr_text
; 0000 003C     LCD_clr_gr(0x00);       // smazani displeje - grafika
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 003D 
; 0000 003E     LCD_mode_set(LCD_MODE_EXOR);                            // nastaveni displeje - rezim zobrazeni textu a grafiky
	LDI  R30,LOW(129)
	ST   -Y,R30
	CALL _LCD_mode_set
; 0000 003F     LCD_display_mode(LCD_CURS_OFF,LCD_TEXT_ON_GRAPH_ON,1);  // text zapnuty, grafika zapnuta, kurzor vypnuty
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(3)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_display_mode
; 0000 0040     LCD_diacritics_generate();                              // vygenerovani znaku diakritiky
	CALL _LCD_diacritics_generate
; 0000 0041 
; 0000 0042     if(e_period_signal>10) period_signal = 6;          // nahrani z eeprom (pokud je vymazana, tak defaultni hodnoty)
	LDI  R26,LOW(_e_period_signal)
	LDI  R27,HIGH(_e_period_signal)
	CALL __EEPROMRDB
	CPI  R30,LOW(0xB)
	BRLO _0xD2
	LDI  R30,LOW(6)
	RJMP _0x1D8
; 0000 0043     else period_signal = e_period_signal;
_0xD2:
	LDI  R26,LOW(_e_period_signal)
	LDI  R27,HIGH(_e_period_signal)
	CALL __EEPROMRDB
_0x1D8:
	MOV  R9,R30
; 0000 0044     if(e_period_adc>7) period_adc = 4;
	LDI  R26,LOW(_e_period_adc)
	LDI  R27,HIGH(_e_period_adc)
	CALL __EEPROMRDB
	CPI  R30,LOW(0x8)
	BRLO _0xD4
	LDI  R30,LOW(4)
	RJMP _0x1D9
; 0000 0045     else period_adc = e_period_adc;
_0xD4:
	LDI  R26,LOW(_e_period_adc)
	LDI  R27,HIGH(_e_period_adc)
	CALL __EEPROMRDB
_0x1D9:
	MOV  R8,R30
; 0000 0046     if(e_scale>10) scale = 10;
	LDI  R26,LOW(_e_scale)
	LDI  R27,HIGH(_e_scale)
	CALL __EEPROMRDB
	CPI  R30,LOW(0xB)
	BRLO _0xD6
	LDI  R30,LOW(10)
	RJMP _0x1DA
; 0000 0047     else scale = e_scale;
_0xD6:
	LDI  R26,LOW(_e_scale)
	LDI  R27,HIGH(_e_scale)
	CALL __EEPROMRDB
_0x1DA:
	MOV  R11,R30
; 0000 0048     if(e_set_temp>1) set_temp = 1;
	LDI  R26,LOW(_e_set_temp)
	LDI  R27,HIGH(_e_set_temp)
	CALL __EEPROMRDB
	CPI  R30,LOW(0x2)
	BRLO _0xD8
	LDI  R30,LOW(1)
	RJMP _0x1DB
; 0000 0049     else set_temp = e_set_temp;
_0xD8:
	LDI  R26,LOW(_e_set_temp)
	LDI  R27,HIGH(_e_set_temp)
	CALL __EEPROMRDB
_0x1DB:
	MOV  R10,R30
; 0000 004A 
; 0000 004B     ADCSRA=0x80+period_adc;                             // perioda prevodu adc
	MOV  R30,R8
	SUBI R30,-LOW(128)
	OUT  0x6,R30
; 0000 004C 
; 0000 004D 
; 0000 004E     intro();                                            // text - intro
	CALL _intro
; 0000 004F     while((SWITCH1&&SWITCH2&&SWITCH3));                 // cokoliv stiskni
_0xDA:
	SBIS 0x1,5
	RJMP _0xDD
	SBIS 0x1,4
	RJMP _0xDD
	SBIC 0x1,3
	RJMP _0xDE
_0xDD:
	RJMP _0xDC
_0xDE:
	RJMP _0xDA
_0xDC:
; 0000 0050     while(!(SWITCH1&&SWITCH2&&SWITCH3));
_0xDF:
	SBIS 0x1,5
	RJMP _0xE2
	SBIS 0x1,4
	RJMP _0xE2
	SBIC 0x1,3
	RJMP _0xE1
_0xE2:
	RJMP _0xDF
_0xE1:
; 0000 0051     LCD_clr_text();                                     // smazani displeje
	CALL _LCD_clr_text
; 0000 0052     LCD_clr_gr(0x00);
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 0053 
; 0000 0054 //*************************************************************************************************************
; 0000 0055 // hlavni programova smycka - prepinani mezi stavy mereni, pauza, nastaveni a prohlizeni prubehu
; 0000 0056 //*************************************************************************************************************
; 0000 0057 while (1)
_0xE4:
; 0000 0058 {
; 0000 0059 //******************************** mereni *********************************************************************
; 0000 005A       if(status==1)
	LDD  R26,Y+1
	CPI  R26,LOW(0x1)
	BREQ PC+3
	JMP _0xE7
; 0000 005B       {
; 0000 005C       icon_1();                  // spodni ikony
	CALL _icon_1
; 0000 005D 
; 0000 005E       if(set_temp==1) compute_temperature();  // jestli se ma merit teplota a pocitat rychlost zvuku nebo hodnoty pro pokojovou teplotu
	LDI  R30,LOW(1)
	CP   R30,R10
	BRNE _0xE8
	RCALL _compute_temperature
; 0000 005F       if(set_temp==0) { temperature=250;
_0xE8:
	TST  R10
	BRNE _0xE9
	LDI  R30,LOW(250)
	LDI  R31,HIGH(250)
	MOVW R6,R30
; 0000 0060                         sound_speed=347; }
	LDI  R30,LOW(347)
	LDI  R31,HIGH(347)
	MOVW R4,R30
; 0000 0061       show_temperature();
_0xE9:
	RCALL _show_temperature
; 0000 0062 
; 0000 0063       ADCSRA=0x80+period_adc;    // perioda prevodu adc
	MOV  R30,R8
	SUBI R30,-LOW(128)
	OUT  0x6,R30
; 0000 0064 
; 0000 0065       clear_graph();             // smazani prodchoziho prubehu
	RCALL _clear_graph
; 0000 0066 
; 0000 0067       generate_usonic(period_signal);   // vygeneruj davku ultrazvukoveho signalu (pocet kmitu = period_signal)
	ST   -Y,R9
	RCALL _generate_usonic
; 0000 0068 
; 0000 0069       if (period_adc==7) {  delay_us(200);                                      // korekce podle poctu kmitu v davce - prevod zacne pozdeji
	LDI  R30,LOW(7)
	CP   R30,R8
	BRNE _0xEA
	__DELAY_USW 400
; 0000 006A                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0xEC:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0xED
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0xEC
_0xED:
; 0000 006B       if (period_adc==6) {  delay_us(200);
_0xEA:
	LDI  R30,LOW(6)
	CP   R30,R8
	BRNE _0xEE
	__DELAY_USW 400
; 0000 006C                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0xF0:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0xF1
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0xF0
_0xF1:
; 0000 006D       if (period_adc==5) {  delay_us(200);
_0xEE:
	LDI  R30,LOW(5)
	CP   R30,R8
	BRNE _0xF2
	__DELAY_USW 400
; 0000 006E                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0xF4:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0xF5
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0xF4
_0xF5:
; 0000 006F       if (period_adc==4) {  delay_us(200);
_0xF2:
	LDI  R30,LOW(4)
	CP   R30,R8
	BRNE _0xF6
	__DELAY_USW 400
; 0000 0070                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0xF8:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0xF9
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0xF8
_0xF9:
; 0000 0071       if (period_adc==3) {  delay_us(200);
_0xF6:
	LDI  R30,LOW(3)
	CP   R30,R8
	BRNE _0xFA
	__DELAY_USW 400
; 0000 0072                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0xFC:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0xFD
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0xFC
_0xFD:
; 0000 0073       if (period_adc==2) {  delay_us(180);
_0xFA:
	LDI  R30,LOW(2)
	CP   R30,R8
	BRNE _0xFE
	__DELAY_USW 360
; 0000 0074                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0x100:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0x101
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0x100
_0x101:
; 0000 0075       if (period_adc==1) {  delay_us(200);
_0xFE:
	LDI  R30,LOW(1)
	CP   R30,R8
	BRNE _0x102
	__DELAY_USW 400
; 0000 0076                             for(n=0;n<(10-period_signal);n++) delay_us(10); }
	LDI  R20,LOW(0)
_0x104:
	MOV  R30,R9
	LDI  R31,0
	LDI  R26,LOW(10)
	LDI  R27,HIGH(10)
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOV  R26,R20
	LDI  R27,0
	CP   R26,R30
	CPC  R27,R31
	BRGE _0x105
	__DELAY_USB 27
	SUBI R20,-1
	RJMP _0x104
_0x105:
; 0000 0077 
; 0000 0078 
; 0000 0079       for(n=0;n<100;n++)                    // prevod ADC, 100 vzorku
_0x102:
	LDI  R20,LOW(0)
_0x107:
	CPI  R20,100
	BRSH _0x108
; 0000 007A       {
; 0000 007B       array[n]=read_adc_usonic();
	MOV  R30,R20
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R30,R26
	ADC  R31,R27
	PUSH R31
	PUSH R30
	RCALL _read_adc_usonic
	POP  R26
	POP  R27
	ST   X+,R30
	ST   X,R31
; 0000 007C       }
	SUBI R20,-1
	RJMP _0x107
_0x108:
; 0000 007D 
; 0000 007E       for(n=0;n<100;n++)                    // prepocet na napeti
	LDI  R20,LOW(0)
_0x10A:
	CPI  R20,100
	BRSH _0x10B
; 0000 007F       {
; 0000 0080       voltage[n]=array[n]*2.443;
	MOV  R30,R20
	LDI  R26,LOW(_voltage)
	LDI  R27,HIGH(_voltage)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R30,R26
	ADC  R31,R27
	PUSH R31
	PUSH R30
	MOV  R30,R20
	LDI  R26,LOW(_array)
	LDI  R27,HIGH(_array)
	LDI  R31,0
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	CALL __CWD1
	CALL __CDF1
	__GETD2N 0x401C5A1D
	CALL __MULF12
	POP  R26
	POP  R27
	CALL __CFD1
	ST   X+,R30
	ST   X,R31
; 0000 0081       }
	SUBI R20,-1
	RJMP _0x10A
_0x10B:
; 0000 0082 
; 0000 0083       compute_scale();                      // vypocet meritka pro zobrazeni
	RCALL _compute_scale
; 0000 0084       show_graph();                         // zobrazeni prubehu na displeji
	RCALL _show_graph
; 0000 0085 
; 0000 0086 
; 0000 0087      for(m=0;m<500;m++)                     // osetreni stisku tlacitek
	__GETWRN 16,17,0
_0x10D:
	__CPWRN 16,17,500
	BRSH _0x10E
; 0000 0088       {
; 0000 0089       if(SWITCH1==0)                        // prvni tlacitko
	SBIC 0x1,5
	RJMP _0x10F
; 0000 008A                 {
; 0000 008B                    status=2;                // jdi na nastaveni
	LDI  R30,LOW(2)
	STD  Y+1,R30
; 0000 008C 
; 0000 008D                     while(SWITCH1==0);
_0x110:
	SBIS 0x1,5
	RJMP _0x110
; 0000 008E                 }
; 0000 008F       if(SWITCH2==0)                        // druhe tlacitko
_0x10F:
	SBIC 0x1,4
	RJMP _0x113
; 0000 0090                 {
; 0000 0091                     status=0;               // jdi na pauzu
	LDI  R30,LOW(0)
	STD  Y+1,R30
; 0000 0092 
; 0000 0093                     while(SWITCH2==0);
_0x114:
	SBIS 0x1,4
	RJMP _0x114
; 0000 0094                 }
; 0000 0095       if(status!=1) break;
_0x113:
	LDD  R26,Y+1
	CPI  R26,LOW(0x1)
	BRNE _0x10E
; 0000 0096       delay_ms(1);
	LDI  R30,LOW(1)
	LDI  R31,HIGH(1)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
; 0000 0097       }
	__ADDWRN 16,17,1
	RJMP _0x10D
_0x10E:
; 0000 0098 }
; 0000 0099 //******************************** pauza *********************************************************************
; 0000 009A       if(status==0)
_0xE7:
	LDD  R30,Y+1
	CPI  R30,0
	BREQ PC+3
	JMP _0x118
; 0000 009B       {
; 0000 009C       icon_3();                              // ikony dole
	CALL _icon_3
; 0000 009D 
; 0000 009E       LCD_text_xy(0,0);                      // nastaveni pozice na disp.
	LDI  R30,LOW(0)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 009F       LCD_string("                    ");    // smazani predchoziho textu
	__POINTW1MN _0x119,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00A0       show_temperature();                    // zobrazeni teploty
	RCALL _show_temperature
; 0000 00A1 
; 0000 00A2       show_graph();                          // vykresleni prubehu
	RCALL _show_graph
; 0000 00A3 
; 0000 00A4       while(status==0)
_0x11A:
	LDD  R30,Y+1
	CPI  R30,0
	BREQ PC+3
	JMP _0x11C
; 0000 00A5       {
; 0000 00A6       if(SWITCH1==0)
	SBIC 0x1,5
	RJMP _0x11D
; 0000 00A7                 {
; 0000 00A8                     status=3;                // jdi na prohlizeni prubehu
	LDI  R30,LOW(3)
	STD  Y+1,R30
; 0000 00A9 
; 0000 00AA                     while(SWITCH1==0);
_0x11E:
	SBIS 0x1,5
	RJMP _0x11E
; 0000 00AB                 }
; 0000 00AC       if(SWITCH2==0)
_0x11D:
	SBIC 0x1,4
	RJMP _0x121
; 0000 00AD                 {
; 0000 00AE                     status=1;                // jdi na mereni
	LDI  R30,LOW(1)
	STD  Y+1,R30
; 0000 00AF 
; 0000 00B0                     while(SWITCH2==0);
_0x122:
	SBIS 0x1,4
	RJMP _0x122
; 0000 00B1                 }
; 0000 00B2       if(SWITCH3==0)                         // poslani dat po USB do pocitace
_0x121:
	SBIC 0x1,3
	RJMP _0x125
; 0000 00B3                 {
; 0000 00B4                     LCD_clr_gr(0x00);        // smazani disp.
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 00B5                     LCD_clr_text();
	CALL _LCD_clr_text
; 0000 00B6 
; 0000 00B7                     icon_5();                // ikony dole
	CALL _icon_5
; 0000 00B8                     textUSB();               // text - informace
	CALL _textUSB
; 0000 00B9 
; 0000 00BA                     while((SWITCH1==1)&&(SWITCH2==1));     // tlacitko zpet a nebo OK = posli data
_0x126:
	SBIS 0x1,5
	RJMP _0x129
	SBIC 0x1,4
	RJMP _0x12A
_0x129:
	RJMP _0x128
_0x12A:
	RJMP _0x126
_0x128:
; 0000 00BB                     if(SWITCH1==0) status=0;
	SBIC 0x1,5
	RJMP _0x12B
	LDI  R30,LOW(0)
	STD  Y+1,R30
; 0000 00BC                     if(SWITCH2==0) {LCD_clr_gr(0x00);
_0x12B:
	SBIC 0x1,4
	RJMP _0x12C
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 00BD                                     LCD_clr_text();
	CALL _LCD_clr_text
; 0000 00BE                                     dataUSB();            // posli data
	RCALL _dataUSB
; 0000 00BF                                     status=0; }
	LDI  R30,LOW(0)
	STD  Y+1,R30
; 0000 00C0 
; 0000 00C1                     LCD_clr_gr(0x00);                    // smaz dip.
_0x12C:
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 00C2                     LCD_clr_text();
	CALL _LCD_clr_text
; 0000 00C3 
; 0000 00C4                     icon_3();                            // ikony dole
	CALL _icon_3
; 0000 00C5 
; 0000 00C6                     LCD_text_xy(0,0);
	LDI  R30,LOW(0)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00C7                     show_temperature();                  // zobrazeni teploty
	RCALL _show_temperature
; 0000 00C8 
; 0000 00C9                     show_graph();                        // zobraz prubeh
	RCALL _show_graph
; 0000 00CA 
; 0000 00CB                     while(SWITCH2==0);
_0x12D:
	SBIS 0x1,4
	RJMP _0x12D
; 0000 00CC                     while(SWITCH1==0);
_0x130:
	SBIS 0x1,5
	RJMP _0x130
; 0000 00CD                 }
; 0000 00CE       }
_0x125:
	RJMP _0x11A
_0x11C:
; 0000 00CF       }
; 0000 00D0 
; 0000 00D1 //******************************** nastaveni *********************************************************************
; 0000 00D2       if(status==2)
_0x118:
	LDD  R26,Y+1
	CPI  R26,LOW(0x2)
	BREQ PC+3
	JMP _0x133
; 0000 00D3       {
; 0000 00D4             LCD_clr_text();           // smazani disp.
	CALL _LCD_clr_text
; 0000 00D5             LCD_clr_gr(0x00);
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 00D6             setting=1;
	LDI  R30,LOW(1)
	ST   Y,R30
; 0000 00D7 
; 0000 00D8             icon_2();                // ikony dole
	CALL _icon_2
; 0000 00D9 
; 0000 00DA             LCD_text_xy(0,0);                     // text na dane pozici na displeji + diakritika
	LDI  R30,LOW(0)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00DB             LCD_string("Nastaven");
	__POINTW1MN _0x119,21
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00DC             LCD_char_diacritic(I_DLOUHE_M);
	LDI  R30,LOW(131)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00DD             LCD_char(':');
	LDI  R30,LOW(58)
	ST   -Y,R30
	CALL _LCD_char
; 0000 00DE 
; 0000 00DF             LCD_text_xy(1,2);
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(2)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00E0             LCD_string("perioda vzorkov");
	__POINTW1MN _0x119,30
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00E1             LCD_char_diacritic(A_DLOUHE_M);
	LDI  R30,LOW(129)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00E2             LCD_char('n');
	LDI  R30,LOW(110)
	ST   -Y,R30
	CALL _LCD_char
; 0000 00E3             LCD_char_diacritic(I_DLOUHE_M);
	LDI  R30,LOW(131)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00E4             LCD_char(':');
	LDI  R30,LOW(58)
	ST   -Y,R30
	CALL _LCD_char
; 0000 00E5 
; 0000 00E6             LCD_text_xy(8,3);
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(3)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00E7             show_period_adc();                    // perioda prevodu - zobrazeni hodnoty
	RCALL _show_period_adc
; 0000 00E8 
; 0000 00E9             LCD_set_pixel(69,39,1);
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(39)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_set_pixel
; 0000 00EA             LCD_set_pixel(70,40,1);
	LDI  R30,LOW(70)
	ST   -Y,R30
	LDI  R30,LOW(40)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_set_pixel
; 0000 00EB             LCD_set_pixel(68,40,1);
	LDI  R30,LOW(68)
	ST   -Y,R30
	LDI  R30,LOW(40)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_set_pixel
; 0000 00EC             LCD_set_pixel(69,41,1);
	LDI  R30,LOW(69)
	ST   -Y,R30
	LDI  R30,LOW(41)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_set_pixel
; 0000 00ED             LCD_text_xy(1,5);
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(5)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00EE             LCD_string("po");
	__POINTW1MN _0x119,46
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00EF             LCD_char_diacritic(C_HACEK_M);
	LDI  R30,LOW(137)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00F0             LCD_string("et kmitu v d");
	__POINTW1MN _0x119,49
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00F1             LCD_char_diacritic(A_DLOUHE_M);
	LDI  R30,LOW(129)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00F2             LCD_string("vce:");
	__POINTW1MN _0x119,62
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00F3 
; 0000 00F4             LCD_text_xy(8,6);
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(6)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00F5             show_char(period_signal);            // pocet period v davce - zobrazeni hodnoty
	MOV  R30,R9
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	RCALL _show_char
; 0000 00F6 
; 0000 00F7             LCD_text_xy(1,8);
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(8)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00F8             LCD_char('m');
	LDI  R30,LOW(109)
	ST   -Y,R30
	CALL _LCD_char
; 0000 00F9             LCD_char_diacritic(E_HACEK_M);
	LDI  R30,LOW(128)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00FA             LCD_char_diacritic(R_HACEK_M);
	LDI  R30,LOW(130)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00FB             LCD_char_diacritic(I_DLOUHE_M);
	LDI  R30,LOW(131)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 00FC             LCD_string("tko grafu:");
	__POINTW1MN _0x119,67
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 00FD 
; 0000 00FE             LCD_text_xy(8,9);                         // meritko zobrazeni na displeji
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(9)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 00FF             if (scale==0) LCD_string("auto       ");
	TST  R11
	BRNE _0x134
	__POINTW1MN _0x119,78
	RJMP _0x1DC
; 0000 0100             else {
_0x134:
; 0000 0101                     show_char(scale);
	MOV  R30,R11
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	RCALL _show_char
; 0000 0102 
; 0000 0103                     LCD_text_xy(10,9);
	LDI  R30,LOW(10)
	ST   -Y,R30
	LDI  R30,LOW(9)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 0104                     LCD_string(" x d");
	__POINTW1MN _0x119,90
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 0105                     LCD_char_diacritic(E_HACEK_M);
	LDI  R30,LOW(128)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 0106                     LCD_string("leno");
	__POINTW1MN _0x119,95
_0x1DC:
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 0107                 }
; 0000 0108 
; 0000 0109             LCD_text_xy(1,11);                          // nastaveni jestli merit teplotu
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(11)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 010A             LCD_string("rychlost zvuku :");
	__POINTW1MN _0x119,100
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 010B             LCD_text_xy(7,12);
	LDI  R30,LOW(7)
	ST   -Y,R30
	LDI  R30,LOW(12)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 010C             if(set_temp==0) LCD_string("konst. 347m/s");
	TST  R10
	BRNE _0x136
	__POINTW1MN _0x119,117
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 010D             if(set_temp==1) LCD_string("podle teploty");
_0x136:
	LDI  R30,LOW(1)
	CP   R30,R10
	BRNE _0x137
	__POINTW1MN _0x119,131
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 010E 
; 0000 010F             LCD_text_xy(1,13);                         // navrat zpet z nastaveni
_0x137:
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 0110             LCD_string("zp");
	__POINTW1MN _0x119,145
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 0111             LCD_char_diacritic(E_HACEK_M);
	LDI  R30,LOW(128)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 0112             LCD_char('t');
	LDI  R30,LOW(116)
	ST   -Y,R30
	CALL _LCD_char
; 0000 0113 
; 0000 0114 
; 0000 0115 
; 0000 0116             LCD_display_mode(LCD_CURS_ON_BLINK_ON,LCD_TEXT_ON_GRAPH_ON,1);    //zapnuti blikani kurzoru
	LDI  R30,LOW(2)
	ST   -Y,R30
	LDI  R30,LOW(3)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_display_mode
; 0000 0117             LCD_cursor_xy(1,2);
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(2)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0118 
; 0000 0119             while(setting!=55)                           // prepinani mezi jednotlivymi volbami v menu
_0x138:
	LD   R26,Y
	CPI  R26,LOW(0x37)
	BRNE PC+3
	JMP _0x13A
; 0000 011A             {
; 0000 011B             if(SWITCH1==0)
	SBIC 0x1,5
	RJMP _0x13B
; 0000 011C                 {
; 0000 011D                     if(setting==1)setting=11;            // zpet
	LD   R26,Y
	CPI  R26,LOW(0x1)
	BRNE _0x13C
	LDI  R30,LOW(11)
	ST   Y,R30
; 0000 011E                     if(setting==2)setting=22;
_0x13C:
	LD   R26,Y
	CPI  R26,LOW(0x2)
	BRNE _0x13D
	LDI  R30,LOW(22)
	ST   Y,R30
; 0000 011F                     if(setting==3)setting=33;
_0x13D:
	LD   R26,Y
	CPI  R26,LOW(0x3)
	BRNE _0x13E
	LDI  R30,LOW(33)
	ST   Y,R30
; 0000 0120                     if(setting==4)setting=44;
_0x13E:
	LD   R26,Y
	CPI  R26,LOW(0x4)
	BRNE _0x13F
	LDI  R30,LOW(44)
	ST   Y,R30
; 0000 0121                     if(setting==5)setting=55;
_0x13F:
	LD   R26,Y
	CPI  R26,LOW(0x5)
	BRNE _0x140
	LDI  R30,LOW(55)
	ST   Y,R30
; 0000 0122                     while(SWITCH1==0);
_0x140:
_0x141:
	SBIS 0x1,5
	RJMP _0x141
; 0000 0123                 }
; 0000 0124             if(SWITCH2==0)
_0x13B:
	SBIC 0x1,4
	RJMP _0x144
; 0000 0125                 {
; 0000 0126                     setting=setting+1;                 // nahoru
	LD   R30,Y
	SUBI R30,-LOW(1)
	ST   Y,R30
; 0000 0127                     if(setting==6) setting=1;
	LD   R26,Y
	CPI  R26,LOW(0x6)
	BRNE _0x145
	LDI  R30,LOW(1)
	ST   Y,R30
; 0000 0128                     while(SWITCH2==0);
_0x145:
_0x146:
	SBIS 0x1,4
	RJMP _0x146
; 0000 0129                 }
; 0000 012A             if(SWITCH3==0)
_0x144:
	SBIC 0x1,3
	RJMP _0x149
; 0000 012B                 {
; 0000 012C                     setting=setting-1;                 // dolu
	LD   R30,Y
	LDI  R31,0
	SBIW R30,1
	ST   Y,R30
; 0000 012D                     if(setting==0) setting=5;
	CPI  R30,0
	BRNE _0x14A
	LDI  R30,LOW(5)
	ST   Y,R30
; 0000 012E                     while(SWITCH3==0);
_0x14A:
_0x14B:
	SBIS 0x1,3
	RJMP _0x14B
; 0000 012F                 }
; 0000 0130 
; 0000 0131             if(setting==1) LCD_cursor_xy(1,2);
_0x149:
	LD   R26,Y
	CPI  R26,LOW(0x1)
	BRNE _0x14E
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(2)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0132             if(setting==2) LCD_cursor_xy(1,5);
_0x14E:
	LD   R26,Y
	CPI  R26,LOW(0x2)
	BRNE _0x14F
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(5)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0133             if(setting==3) LCD_cursor_xy(1,8);
_0x14F:
	LD   R26,Y
	CPI  R26,LOW(0x3)
	BRNE _0x150
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(8)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0134             if(setting==4) LCD_cursor_xy(1,11);
_0x150:
	LD   R26,Y
	CPI  R26,LOW(0x4)
	BRNE _0x151
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(11)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0135             if(setting==5) LCD_cursor_xy(1,13);
_0x151:
	LD   R26,Y
	CPI  R26,LOW(0x5)
	BRNE _0x152
	LDI  R30,LOW(1)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0136 
; 0000 0137             if(setting==11) {                       // nastaveni periody prevodu
_0x152:
	LD   R26,Y
	CPI  R26,LOW(0xB)
	BRNE _0x153
; 0000 0138                             LCD_cursor_xy(8,3);
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(3)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0139                             while(setting!=1)
_0x154:
	LD   R26,Y
	CPI  R26,LOW(0x1)
	BREQ _0x156
; 0000 013A                             {
; 0000 013B                                 if(SWITCH2==0)
	SBIC 0x1,4
	RJMP _0x157
; 0000 013C                                 {
; 0000 013D                                 if(period_adc==1) period_adc=1;    // dolu
	LDI  R30,LOW(1)
	CP   R30,R8
	BRNE _0x158
	RJMP _0x1DD
; 0000 013E                                 else period_adc=period_adc-1;
_0x158:
	MOV  R30,R8
	LDI  R31,0
	SBIW R30,1
_0x1DD:
	MOV  R8,R30
; 0000 013F                                 while(SWITCH2==0);
_0x15A:
	SBIS 0x1,4
	RJMP _0x15A
; 0000 0140                                 }
; 0000 0141                                 if(SWITCH3==0)
_0x157:
	SBIC 0x1,3
	RJMP _0x15D
; 0000 0142                                 {
; 0000 0143                                 if(period_adc==7) period_adc=7;    //nahoru
	LDI  R30,LOW(7)
	CP   R30,R8
	BRNE _0x15E
	MOV  R8,R30
; 0000 0144                                 else period_adc=period_adc+1;
	RJMP _0x15F
_0x15E:
	INC  R8
; 0000 0145                                 while(SWITCH3==0);
_0x15F:
_0x160:
	SBIS 0x1,3
	RJMP _0x160
; 0000 0146                                 }
; 0000 0147                                 if(SWITCH1==0)
_0x15D:
	SBIC 0x1,5
	RJMP _0x163
; 0000 0148                                 {
; 0000 0149                                 setting=1;                         // zpet
	LDI  R30,LOW(1)
	ST   Y,R30
; 0000 014A                                 while(SWITCH1==0);
_0x164:
	SBIS 0x1,5
	RJMP _0x164
; 0000 014B                                 }
; 0000 014C                             LCD_text_xy(8,3);
_0x163:
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(3)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 014D                             show_period_adc();
	RCALL _show_period_adc
; 0000 014E                             }
	RJMP _0x154
_0x156:
; 0000 014F                             }
; 0000 0150 
; 0000 0151             if(setting==22) {                       // nastaveni poctu kmitu v davce
_0x153:
	LD   R26,Y
	CPI  R26,LOW(0x16)
	BRNE _0x167
; 0000 0152                             LCD_cursor_xy(8,6);
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(6)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 0153                             while(setting!=2)
_0x168:
	LD   R26,Y
	CPI  R26,LOW(0x2)
	BREQ _0x16A
; 0000 0154                             {
; 0000 0155                                 if(SWITCH2==0)
	SBIC 0x1,4
	RJMP _0x16B
; 0000 0156                                 {
; 0000 0157                                 if(period_signal==1) period_signal=1;   // dolu
	LDI  R30,LOW(1)
	CP   R30,R9
	BRNE _0x16C
	RJMP _0x1DE
; 0000 0158                                 else period_signal=period_signal-1;
_0x16C:
	MOV  R30,R9
	LDI  R31,0
	SBIW R30,1
_0x1DE:
	MOV  R9,R30
; 0000 0159                                 while(SWITCH2==0);
_0x16E:
	SBIS 0x1,4
	RJMP _0x16E
; 0000 015A                                 }
; 0000 015B                                 if(SWITCH3==0)
_0x16B:
	SBIC 0x1,3
	RJMP _0x171
; 0000 015C                                 {
; 0000 015D                                 if(period_signal==10) period_signal=10; // nahoru
	LDI  R30,LOW(10)
	CP   R30,R9
	BRNE _0x172
	MOV  R9,R30
; 0000 015E                                 else period_signal=period_signal+1;
	RJMP _0x173
_0x172:
	INC  R9
; 0000 015F                                 while(SWITCH3==0);
_0x173:
_0x174:
	SBIS 0x1,3
	RJMP _0x174
; 0000 0160                                 }
; 0000 0161                                 if(SWITCH1==0)
_0x171:
	SBIC 0x1,5
	RJMP _0x177
; 0000 0162                                 {
; 0000 0163                                 setting=2;                              // zpet
	LDI  R30,LOW(2)
	ST   Y,R30
; 0000 0164                                 while(SWITCH1==0);
_0x178:
	SBIS 0x1,5
	RJMP _0x178
; 0000 0165                                 }
; 0000 0166                             LCD_text_xy(8,6);
_0x177:
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(6)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 0167                             show_char(period_signal);
	MOV  R30,R9
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _show_char
; 0000 0168                             }
	RJMP _0x168
_0x16A:
; 0000 0169                             }
; 0000 016A 
; 0000 016B             if(setting==33) {                       // nastaveni meritka
_0x167:
	LD   R26,Y
	CPI  R26,LOW(0x21)
	BREQ PC+3
	JMP _0x17B
; 0000 016C                             LCD_cursor_xy(8,9);
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(9)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 016D                             while(setting!=3)
_0x17C:
	LD   R26,Y
	CPI  R26,LOW(0x3)
	BRNE PC+3
	JMP _0x17E
; 0000 016E                             {
; 0000 016F                                 if(SWITCH2==0)
	SBIC 0x1,4
	RJMP _0x17F
; 0000 0170                                 {
; 0000 0171                                 while(SWITCH2==0);      // dolu
_0x180:
	SBIS 0x1,4
	RJMP _0x180
; 0000 0172                                 switch(scale)
	MOV  R30,R11
	LDI  R31,0
; 0000 0173                                 {
; 0000 0174                                 case 0: scale=10;
	SBIW R30,0
	BRNE _0x186
	LDI  R30,LOW(10)
	RJMP _0x1DF
; 0000 0175                                         break;
; 0000 0176                                 case 1: scale=0;
_0x186:
	CPI  R30,LOW(0x1)
	LDI  R26,HIGH(0x1)
	CPC  R31,R26
	BRNE _0x187
	CLR  R11
; 0000 0177                                         break;
	RJMP _0x185
; 0000 0178                                 case 2: scale=1;
_0x187:
	CPI  R30,LOW(0x2)
	LDI  R26,HIGH(0x2)
	CPC  R31,R26
	BRNE _0x188
	LDI  R30,LOW(1)
	RJMP _0x1DF
; 0000 0179                                         break;
; 0000 017A                                 case 5: scale=2;
_0x188:
	CPI  R30,LOW(0x5)
	LDI  R26,HIGH(0x5)
	CPC  R31,R26
	BRNE _0x189
	LDI  R30,LOW(2)
	RJMP _0x1DF
; 0000 017B                                         break;
; 0000 017C                                 case 10:scale=5;
_0x189:
	CPI  R30,LOW(0xA)
	LDI  R26,HIGH(0xA)
	CPC  R31,R26
	BRNE _0x185
	LDI  R30,LOW(5)
_0x1DF:
	MOV  R11,R30
; 0000 017D                                         break;
; 0000 017E                                 }
_0x185:
; 0000 017F 
; 0000 0180                                 }
; 0000 0181                                 if(SWITCH3==0)             // nahoru
_0x17F:
	SBIC 0x1,3
	RJMP _0x18B
; 0000 0182                                 {
; 0000 0183                                 while(SWITCH3==0);
_0x18C:
	SBIS 0x1,3
	RJMP _0x18C
; 0000 0184                                 switch(scale)
	MOV  R30,R11
	LDI  R31,0
; 0000 0185                                 {
; 0000 0186                                 case 0: scale=1;
	SBIW R30,0
	BRNE _0x192
	LDI  R30,LOW(1)
	MOV  R11,R30
; 0000 0187                                         break;
	RJMP _0x191
; 0000 0188                                 case 1: scale=2;
_0x192:
	CPI  R30,LOW(0x1)
	LDI  R26,HIGH(0x1)
	CPC  R31,R26
	BRNE _0x193
	LDI  R30,LOW(2)
	MOV  R11,R30
; 0000 0189                                         break;
	RJMP _0x191
; 0000 018A                                 case 2: scale=5;
_0x193:
	CPI  R30,LOW(0x2)
	LDI  R26,HIGH(0x2)
	CPC  R31,R26
	BRNE _0x194
	LDI  R30,LOW(5)
	MOV  R11,R30
; 0000 018B                                         break;
	RJMP _0x191
; 0000 018C                                 case 5: scale=10;
_0x194:
	CPI  R30,LOW(0x5)
	LDI  R26,HIGH(0x5)
	CPC  R31,R26
	BRNE _0x195
	LDI  R30,LOW(10)
	MOV  R11,R30
; 0000 018D                                         break;
	RJMP _0x191
; 0000 018E                                 case 10:scale=0;
_0x195:
	CPI  R30,LOW(0xA)
	LDI  R26,HIGH(0xA)
	CPC  R31,R26
	BRNE _0x191
	CLR  R11
; 0000 018F                                         break;
; 0000 0190                                 }
_0x191:
; 0000 0191 
; 0000 0192                                 }
; 0000 0193                                 if(SWITCH1==0)              // zpet
_0x18B:
	SBIC 0x1,5
	RJMP _0x197
; 0000 0194                                 {
; 0000 0195                                 setting=3;
	LDI  R30,LOW(3)
	ST   Y,R30
; 0000 0196                                 while(SWITCH1==0);
_0x198:
	SBIS 0x1,5
	RJMP _0x198
; 0000 0197                                 }
; 0000 0198 
; 0000 0199                             LCD_text_xy(8,9);                             // zobrazeni vybrane hodnoty meritka - cislo nebo napis auto
_0x197:
	LDI  R30,LOW(8)
	ST   -Y,R30
	LDI  R30,LOW(9)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 019A                             if (scale==0) LCD_string("auto       ");
	TST  R11
	BRNE _0x19B
	__POINTW1MN _0x119,148
	RJMP _0x1E0
; 0000 019B                             else {
_0x19B:
; 0000 019C                                     show_char(scale);
	MOV  R30,R11
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _show_char
; 0000 019D 
; 0000 019E                                     LCD_text_xy(10,9);
	LDI  R30,LOW(10)
	ST   -Y,R30
	LDI  R30,LOW(9)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 019F                                     LCD_string(" x d");
	__POINTW1MN _0x119,160
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 01A0                                     LCD_char_diacritic(E_HACEK_M);
	LDI  R30,LOW(128)
	ST   -Y,R30
	CALL _LCD_char_diacritic
; 0000 01A1                                     LCD_string("leno");
	__POINTW1MN _0x119,165
_0x1E0:
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 01A2                                 }
; 0000 01A3                             }
	RJMP _0x17C
_0x17E:
; 0000 01A4                             }
; 0000 01A5 
; 0000 01A6             if(setting==44) {                       // nastaveni mereni telpoty - merit/nemerit
_0x17B:
	LD   R26,Y
	CPI  R26,LOW(0x2C)
	BRNE _0x19D
; 0000 01A7                             LCD_cursor_xy(7,12);
	LDI  R30,LOW(7)
	ST   -Y,R30
	LDI  R30,LOW(12)
	ST   -Y,R30
	CALL _LCD_cursor_xy
; 0000 01A8                             while(setting!=4)
_0x19E:
	LD   R26,Y
	CPI  R26,LOW(0x4)
	BREQ _0x1A0
; 0000 01A9                             {
; 0000 01AA                                 if(SWITCH2==0)
	SBIC 0x1,4
	RJMP _0x1A1
; 0000 01AB                                 {
; 0000 01AC                                 while(SWITCH2==0);
_0x1A2:
	SBIS 0x1,4
	RJMP _0x1A2
; 0000 01AD                                 if(set_temp==0) set_temp=1;
	TST  R10
	BRNE _0x1A5
	LDI  R30,LOW(1)
	MOV  R10,R30
; 0000 01AE                                 else set_temp=0;
	RJMP _0x1A6
_0x1A5:
	CLR  R10
; 0000 01AF                                 }
_0x1A6:
; 0000 01B0 
; 0000 01B1                                 if(SWITCH3==0)
_0x1A1:
	SBIC 0x1,3
	RJMP _0x1A7
; 0000 01B2                                 {
; 0000 01B3                                 while(SWITCH3==0);
_0x1A8:
	SBIS 0x1,3
	RJMP _0x1A8
; 0000 01B4                                 if(set_temp==0) set_temp=1;
	TST  R10
	BRNE _0x1AB
	LDI  R30,LOW(1)
	MOV  R10,R30
; 0000 01B5                                 else set_temp=0;
	RJMP _0x1AC
_0x1AB:
	CLR  R10
; 0000 01B6                                 }
_0x1AC:
; 0000 01B7 
; 0000 01B8                                 if(SWITCH1==0)
_0x1A7:
	SBIC 0x1,5
	RJMP _0x1AD
; 0000 01B9                                 {
; 0000 01BA                                 setting=4;                     // zpet
	LDI  R30,LOW(4)
	ST   Y,R30
; 0000 01BB                                 while(SWITCH1==0);
_0x1AE:
	SBIS 0x1,5
	RJMP _0x1AE
; 0000 01BC                                 }
; 0000 01BD                             LCD_text_xy(7,12);
_0x1AD:
	LDI  R30,LOW(7)
	ST   -Y,R30
	LDI  R30,LOW(12)
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 01BE                             if(set_temp==0) LCD_string("konst. 347m/s");
	TST  R10
	BRNE _0x1B1
	__POINTW1MN _0x119,170
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 01BF                             if(set_temp==1) LCD_string("podle teploty");
_0x1B1:
	LDI  R30,LOW(1)
	CP   R30,R10
	BRNE _0x1B2
	__POINTW1MN _0x119,184
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 01C0                             }
_0x1B2:
	RJMP _0x19E
_0x1A0:
; 0000 01C1                             }
; 0000 01C2             }
_0x19D:
	RJMP _0x138
_0x13A:
; 0000 01C3             status=1;
	LDI  R30,LOW(1)
	STD  Y+1,R30
; 0000 01C4 
; 0000 01C5             e_scale = scale;                    // ulozeni do eeprom pameti
	MOV  R30,R11
	LDI  R26,LOW(_e_scale)
	LDI  R27,HIGH(_e_scale)
	CALL __EEPROMWRB
; 0000 01C6             e_period_adc = period_adc;
	MOV  R30,R8
	LDI  R26,LOW(_e_period_adc)
	LDI  R27,HIGH(_e_period_adc)
	CALL __EEPROMWRB
; 0000 01C7             e_period_signal = period_signal;
	MOV  R30,R9
	LDI  R26,LOW(_e_period_signal)
	LDI  R27,HIGH(_e_period_signal)
	CALL __EEPROMWRB
; 0000 01C8             e_set_temp = set_temp;
	MOV  R30,R10
	LDI  R26,LOW(_e_set_temp)
	LDI  R27,HIGH(_e_set_temp)
	CALL __EEPROMWRB
; 0000 01C9 
; 0000 01CA             LCD_display_mode(LCD_CURS_OFF,LCD_TEXT_ON_GRAPH_ON,1);  // vypnuti blikani kurzoru
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(3)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_display_mode
; 0000 01CB             LCD_clr_text();
	CALL _LCD_clr_text
; 0000 01CC             LCD_clr_gr(0x00);
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_clr_gr
; 0000 01CD       }
; 0000 01CE 
; 0000 01CF //******************************** prohlizeni proubehu **************************************************************
; 0000 01D0       if(status==3)
_0x133:
	LDD  R26,Y+1
	CPI  R26,LOW(0x3)
	BREQ PC+3
	JMP _0x1B3
; 0000 01D1       {
; 0000 01D2       icon_4();                             // ikony dole
	CALL _icon_4
; 0000 01D3 
; 0000 01D4       LCD_text_xy(0,0);                     // nastaveni pozice textu
	LDI  R30,LOW(0)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 01D5       LCD_string("                    ");   // smazani predchozi hodnoty
	__POINTW1MN _0x119,198
	ST   -Y,R31
	ST   -Y,R30
	CALL _LCD_string
; 0000 01D6 
; 0000 01D7       x=0;                                  // pozice v poli, pozice na grafu +13
	LDI  R30,LOW(0)
	STD  Y+2,R30
	STD  Y+2+1,R30
; 0000 01D8 
; 0000 01D9       show_graph();                         // zobrazeni prubehu
	RCALL _show_graph
; 0000 01DA       LCD_line(13+x,13,13+x,113,1);         // oprava prubehu, pokud prejede po nem kurzor zustal by zhasnuty bod
	LDD  R30,Y+2
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01DB 
; 0000 01DC       while(status==3)
_0x1B4:
	LDD  R26,Y+1
	CPI  R26,LOW(0x3)
	BREQ PC+3
	JMP _0x1B6
; 0000 01DD       {
; 0000 01DE       if(SWITCH1==0)
	SBIC 0x1,5
	RJMP _0x1B7
; 0000 01DF                 {
; 0000 01E0                     status=0;               // konec prohlizeni, navrat zpet na pauzu
	LDI  R30,LOW(0)
	STD  Y+1,R30
; 0000 01E1 
; 0000 01E2                     while(SWITCH1==0);
_0x1B8:
	SBIS 0x1,5
	RJMP _0x1B8
; 0000 01E3                 }
; 0000 01E4       if(SWITCH3==0)                                            //posun vpravo
_0x1B7:
	SBIC 0x1,3
	RJMP _0x1BB
; 0000 01E5                 {
; 0000 01E6                     if(x<99) x++;   // maximum vpravo
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	CPI  R26,LOW(0x63)
	LDI  R30,HIGH(0x63)
	CPC  R27,R30
	BRSH _0x1BC
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	ADIW R30,1
	RJMP _0x1E1
; 0000 01E7                     else x=99;
_0x1BC:
	LDI  R30,LOW(99)
	LDI  R31,HIGH(99)
_0x1E1:
	STD  Y+2,R30
	STD  Y+2+1,R31
; 0000 01E8                     LCD_line(13+x,13,13+x,113,1);         // kurzor
	LDD  R30,Y+2
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01E9                     LCD_line(13+x-1,13,13+x-1,113,0);     // oprava na predchozi pozici
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	ADIW R26,13
	SBIW R26,1
	ST   -Y,R26
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R26,Y+4
	LDD  R27,Y+4+1
	ADIW R26,13
	SBIW R26,1
	ST   -Y,R26
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01EA                     show_graph();                         // zobraz prubeh
	RCALL _show_graph
; 0000 01EB                     delay_ms(150);
	LDI  R30,LOW(150)
	LDI  R31,HIGH(150)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
; 0000 01EC 
; 0000 01ED                     while(SWITCH3==0) { if(x<99) x++;           //pokud je tlacitko stisknute dlouho tak rychly posun
_0x1BE:
	SBIC 0x1,3
	RJMP _0x1C0
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	CPI  R26,LOW(0x63)
	LDI  R30,HIGH(0x63)
	CPC  R27,R30
	BRSH _0x1C1
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	ADIW R30,1
	RJMP _0x1E2
; 0000 01EE                                         else x=99;
_0x1C1:
	LDI  R30,LOW(99)
	LDI  R31,HIGH(99)
_0x1E2:
	STD  Y+2,R30
	STD  Y+2+1,R31
; 0000 01EF                                         delay_ms(15);
	LDI  R30,LOW(15)
	LDI  R31,HIGH(15)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
; 0000 01F0                                         LCD_line(13+x,13,13+x,113,1);        // kurzor
	LDD  R30,Y+2
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01F1                                         LCD_line(13+x-1,13,13+x-1,113,0);    // oprava na predchozi pozici
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	ADIW R26,13
	SBIW R26,1
	ST   -Y,R26
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R26,Y+4
	LDD  R27,Y+4+1
	ADIW R26,13
	SBIW R26,1
	ST   -Y,R26
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01F2                                         show_graph(); }                      // zobraz prubeh
	RCALL _show_graph
	RJMP _0x1BE
_0x1C0:
; 0000 01F3                 }
; 0000 01F4 
; 0000 01F5       if(SWITCH2==0)                                            //posun vlevo
_0x1BB:
	SBIC 0x1,4
	RJMP _0x1C3
; 0000 01F6                 {
; 0000 01F7                     if(x>0) x--;
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	CALL __CPW02
	BRSH _0x1C4
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	SBIW R30,1
	STD  Y+2,R30
	STD  Y+2+1,R31
; 0000 01F8                     else x=0;
	RJMP _0x1C5
_0x1C4:
	LDI  R30,LOW(0)
	STD  Y+2,R30
	STD  Y+2+1,R30
; 0000 01F9                     LCD_line(13+x,13,13+x,113,1);           // kurzor
_0x1C5:
	LDD  R30,Y+2
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01FA                     LCD_line(13+x+1,13,13+x+1,113,0);       // oprava na predchozi pozici
	LDD  R30,Y+2
	SUBI R30,-LOW(14)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(14)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_line
; 0000 01FB                     show_graph();                           // zobraz prubeh
	RCALL _show_graph
; 0000 01FC                     delay_ms(150);
	LDI  R30,LOW(150)
	LDI  R31,HIGH(150)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
; 0000 01FD 
; 0000 01FE                     while(SWITCH2==0) { if(x>0) x--;                  //pokud je tlacitko stisknute dlouho tak rychly posun
_0x1C6:
	SBIC 0x1,4
	RJMP _0x1C8
	LDD  R26,Y+2
	LDD  R27,Y+2+1
	CALL __CPW02
	BRSH _0x1C9
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	SBIW R30,1
	STD  Y+2,R30
	STD  Y+2+1,R31
; 0000 01FF                                         else x=0;
	RJMP _0x1CA
_0x1C9:
	LDI  R30,LOW(0)
	STD  Y+2,R30
	STD  Y+2+1,R30
; 0000 0200                                         delay_ms(15);
_0x1CA:
	LDI  R30,LOW(15)
	LDI  R31,HIGH(15)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
; 0000 0201                                         LCD_line(13+x,13,13+x,113,1);      // kurzor
	LDD  R30,Y+2
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _LCD_line
; 0000 0202                                         LCD_line(13+x+1,13,13+x+1,113,0);  // oprava na predchozi pozici
	LDD  R30,Y+2
	SUBI R30,-LOW(14)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(14)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_line
; 0000 0203                                         show_graph(); }                    // zobraz prubeh
	RCALL _show_graph
	RJMP _0x1C6
_0x1C8:
; 0000 0204                 }
; 0000 0205 
; 0000 0206                                                 // vypocet napeti, casu, citlivosti a vydalenosti na grafu
; 0000 0207       LCD_text_xy(0,0);
_0x1C3:
	LDI  R30,LOW(0)
	ST   -Y,R30
	ST   -Y,R30
	CALL _LCD_text_xy
; 0000 0208       show_voltage(voltage[x]);                 // zobraz napeti
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	LDI  R26,LOW(_voltage)
	LDI  R27,HIGH(_voltage)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	ST   -Y,R31
	ST   -Y,R30
	CALL _show_voltage
; 0000 0209       if (voltage[x]==0) sensitivity=145;       // vypocet citlivosti v dB
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	LDI  R26,LOW(_voltage)
	LDI  R27,HIGH(_voltage)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	SBIW R30,0
	BRNE _0x1CB
	LDI  R21,LOW(145)
; 0000 020A       else {
	RJMP _0x1CC
_0x1CB:
; 0000 020B       voltage_x=voltage[x]*0.000033;             // napeti - float
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	LDI  R26,LOW(_voltage)
	LDI  R27,HIGH(_voltage)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	CALL __CWD1
	CALL __CDF1
	__GETD2N 0x380A697B
	CALL __MULF12
	__PUTD1S 4
; 0000 020C       voltage_x=voltage_x/561;
	__GETD2S 4
	__GETD1N 0x440C4000
	CALL __DIVF21
	__PUTD1S 4
; 0000 020D       sensitivity=-20*log10(voltage_x);         // citlivost v dB
	CALL __PUTPARD1
	CALL _log10
	__GETD2N 0xC1A00000
	CALL __MULF12
	CALL __CFD1U
	MOV  R21,R30
; 0000 020E       }
_0x1CC:
; 0000 020F       LCD_char(' ');
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
; 0000 0210       show_sens(sensitivity);                   // zobrazeni citlivosti
	MOV  R30,R21
	LDI  R31,0
	ST   -Y,R31
	ST   -Y,R30
	CALL _show_sens
; 0000 0211 
; 0000 0212       if (period_adc==7) time=x*0.000224;       // vypocet casu - podle periody prevodu konkretni hodnota
	LDI  R30,LOW(7)
	CP   R30,R8
	BRNE _0x1CD
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x396AE18B
	CALL __MULF12
	__PUTD1S 8
; 0000 0213       if (period_adc==6) time=x*0.000112;
_0x1CD:
	LDI  R30,LOW(6)
	CP   R30,R8
	BRNE _0x1CE
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x38EAE18B
	CALL __MULF12
	__PUTD1S 8
; 0000 0214       if (period_adc==5) time=x*0.00006;
_0x1CE:
	LDI  R30,LOW(5)
	CP   R30,R8
	BRNE _0x1CF
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x387BA882
	CALL __MULF12
	__PUTD1S 8
; 0000 0215       if (period_adc==4) time=x*0.0000336;
_0x1CF:
	LDI  R30,LOW(4)
	CP   R30,R8
	BRNE _0x1D0
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x380CEDBA
	CALL __MULF12
	__PUTD1S 8
; 0000 0216       if (period_adc==3) time=x*0.0000203;
_0x1D0:
	LDI  R30,LOW(3)
	CP   R30,R8
	BRNE _0x1D1
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x37AA49EB
	CALL __MULF12
	__PUTD1S 8
; 0000 0217       if (period_adc==2) time=x*0.0000129;   //14
_0x1D1:
	LDI  R30,LOW(2)
	CP   R30,R8
	BRNE _0x1D2
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x37586D14
	CALL __MULF12
	__PUTD1S 8
; 0000 0218       if (period_adc==1) time=x*0.000010;
_0x1D2:
	LDI  R30,LOW(1)
	CP   R30,R8
	BRNE _0x1D3
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	CLR  R22
	CLR  R23
	CALL __CDF1
	__GETD2N 0x3727C5AC
	CALL __MULF12
	__PUTD1S 8
; 0000 0219       distance=((time*sound_speed)/0.002);      // vzdalenost
_0x1D3:
	MOVW R30,R4
	__GETD2S 8
	CLR  R22
	CLR  R23
	CALL __CDF1
	CALL __MULF12
	MOVW R26,R30
	MOVW R24,R22
	__GETD1N 0x3B03126F
	CALL __DIVF21
	CALL __CFD1U
	MOVW R18,R30
; 0000 021A       LCD_char(' ');
	LDI  R30,LOW(32)
	ST   -Y,R30
	CALL _LCD_char
; 0000 021B       show_distance(distance);                  // zobrazeni vzdalnosti
	ST   -Y,R19
	ST   -Y,R18
	CALL _show_distance
; 0000 021C       }
	RJMP _0x1B4
_0x1B6:
; 0000 021D 
; 0000 021E       LCD_line(13+x,13,13+x,113,0);            // oprava grafu po odjeti kurzoru
	LDD  R30,Y+2
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(13)
	ST   -Y,R30
	LDD  R30,Y+4
	SUBI R30,-LOW(13)
	ST   -Y,R30
	LDI  R30,LOW(113)
	ST   -Y,R30
	LDI  R30,LOW(0)
	ST   -Y,R30
	CALL _LCD_line
; 0000 021F       show_graph();
	CALL _show_graph
; 0000 0220       status=0;
	LDI  R30,LOW(0)
	STD  Y+1,R30
; 0000 0221       }
; 0000 0222 
; 0000 0223       }
_0x1B3:
	RJMP _0xE4
; 0000 0224 }
_0x1D4:
	RJMP _0x1D4

	.DSEG
_0x119:
	.BYTE 0xDB

	.CSEG
_log:
	SBIW R28,4
	ST   -Y,R17
	ST   -Y,R16
	__GETD2S 6
	CALL __CPD02
	BRLT _0x200000C
	__GETD1N 0xFF7FFFFF
	RJMP _0x20A0002
_0x200000C:
	__GETD1S 6
	CALL __PUTPARD1
	IN   R30,SPL
	IN   R31,SPH
	SBIW R30,1
	ST   -Y,R31
	ST   -Y,R30
	PUSH R17
	PUSH R16
	CALL _frexp
	POP  R16
	POP  R17
	__PUTD1S 6
	__GETD2S 6
	__GETD1N 0x3F3504F3
	CALL __CMPF12
	BRSH _0x200000D
	__GETD1S 6
	CALL __ADDF12
	__PUTD1S 6
	__SUBWRN 16,17,1
_0x200000D:
	__GETD1S 6
	__GETD2N 0x3F800000
	CALL __SUBF12
	PUSH R23
	PUSH R22
	PUSH R31
	PUSH R30
	__GETD1S 6
	__GETD2N 0x3F800000
	CALL __ADDF12
	POP  R26
	POP  R27
	POP  R24
	POP  R25
	CALL __DIVF21
	__PUTD1S 6
	__GETD2S 6
	CALL __MULF12
	__PUTD1S 2
	__GETD2N 0x3F654226
	CALL __MULF12
	MOVW R26,R30
	MOVW R24,R22
	__GETD1N 0x4054114E
	CALL __SWAPD12
	CALL __SUBF12
	__GETD2S 6
	CALL __MULF12
	PUSH R23
	PUSH R22
	PUSH R31
	PUSH R30
	__GETD1S 2
	__GETD2N 0x3FD4114D
	CALL __SUBF12
	POP  R26
	POP  R27
	POP  R24
	POP  R25
	CALL __DIVF21
	PUSH R23
	PUSH R22
	PUSH R31
	PUSH R30
	MOVW R30,R16
	CALL __CWD1
	CALL __CDF1
	__GETD2N 0x3F317218
	CALL __MULF12
	POP  R26
	POP  R27
	POP  R24
	POP  R25
	CALL __ADDF12
_0x20A0002:
	LDD  R17,Y+1
	LDD  R16,Y+0
	ADIW R28,10
	RET
_log10:
	CALL __GETD2S0
	CALL __CPD02
	BRLT _0x200000E
	__GETD1N 0xFF7FFFFF
	RJMP _0x20A0001
_0x200000E:
	CALL __GETD1S0
	CALL __PUTPARD1
	RCALL _log
	__GETD2N 0x3EDE5BD9
	CALL __MULF12
_0x20A0001:
	ADIW R28,4
	RET

	.CSEG
_strlen:
    ld   r26,y+
    ld   r27,y+
    clr  r30
    clr  r31
strlen0:
    ld   r22,x+
    tst  r22
    breq strlen1
    adiw r30,1
    rjmp strlen0
strlen1:
    ret

	.CSEG

	.DSEG

	.CSEG
	#ifndef __SLEEP_DEFINED__
	#define __SLEEP_DEFINED__
	.EQU __se_bit=0x20
	.EQU __sm_mask=0x1C
	.EQU __sm_powerdown=0x10
	.EQU __sm_powersave=0x18
	.EQU __sm_standby=0x14
	.EQU __sm_ext_standby=0x1C
	.EQU __sm_adc_noise_red=0x08
	.SET power_ctrl_reg=mcucr
	#endif

	.CSEG
_putchar:
putchar0:
     sbis usr,udre
     rjmp putchar0
     ld   r30,y
     out  udr,r30
	ADIW R28,1
	RET

	.CSEG

	.DSEG
_array:
	.BYTE 0xC8
_voltage:
	.BYTE 0xC8

	.ESEG
_e_period_signal:
	.BYTE 0x1
_e_period_adc:
	.BYTE 0x1
_e_scale:
	.BYTE 0x1
_e_set_temp:
	.BYTE 0x1

	.DSEG
__seed_G102:
	.BYTE 0x4

	.CSEG

	.CSEG
_delay_ms:
	ld   r30,y+
	ld   r31,y+
	adiw r30,0
	breq __delay_ms1
__delay_ms0:
	__DELAY_USW 0x7D0
	wdr
	sbiw r30,1
	brne __delay_ms0
__delay_ms1:
	ret

_frexp:
	LD   R26,Y+
	LD   R27,Y+
	LD   R30,Y+
	LD   R31,Y+
	LD   R22,Y+
	LD   R23,Y+
	BST  R23,7
	LSL  R22
	ROL  R23
	CLR  R24
	SUBI R23,0x7E
	SBC  R24,R24
	ST   X+,R23
	ST   X,R24
	LDI  R23,0x7E
	LSR  R23
	ROR  R22
	BRTS __ANEGF1
	RET

__ANEGF1:
	SBIW R30,0
	SBCI R22,0
	SBCI R23,0
	BREQ __ANEGF10
	SUBI R23,0x80
__ANEGF10:
	RET

__ROUND_REPACK:
	TST  R21
	BRPL __REPACK
	CPI  R21,0x80
	BRNE __ROUND_REPACK0
	SBRS R30,0
	RJMP __REPACK
__ROUND_REPACK0:
	ADIW R30,1
	ADC  R22,R25
	ADC  R23,R25
	BRVS __REPACK1

__REPACK:
	LDI  R21,0x80
	EOR  R21,R23
	BRNE __REPACK0
	PUSH R21
	RJMP __ZERORES
__REPACK0:
	CPI  R21,0xFF
	BREQ __REPACK1
	LSL  R22
	LSL  R0
	ROR  R21
	ROR  R22
	MOV  R23,R21
	RET
__REPACK1:
	PUSH R21
	TST  R0
	BRMI __REPACK2
	RJMP __MAXRES
__REPACK2:
	RJMP __MINRES

__UNPACK:
	LDI  R21,0x80
	MOV  R1,R25
	AND  R1,R21
	LSL  R24
	ROL  R25
	EOR  R25,R21
	LSL  R21
	ROR  R24

__UNPACK1:
	LDI  R21,0x80
	MOV  R0,R23
	AND  R0,R21
	LSL  R22
	ROL  R23
	EOR  R23,R21
	LSL  R21
	ROR  R22
	RET

__CFD1U:
	SET
	RJMP __CFD1U0
__CFD1:
	CLT
__CFD1U0:
	PUSH R21
	RCALL __UNPACK1
	CPI  R23,0x80
	BRLO __CFD10
	CPI  R23,0xFF
	BRCC __CFD10
	RJMP __ZERORES
__CFD10:
	LDI  R21,22
	SUB  R21,R23
	BRPL __CFD11
	NEG  R21
	CPI  R21,8
	BRTC __CFD19
	CPI  R21,9
__CFD19:
	BRLO __CFD17
	SER  R30
	SER  R31
	SER  R22
	LDI  R23,0x7F
	BLD  R23,7
	RJMP __CFD15
__CFD17:
	CLR  R23
	TST  R21
	BREQ __CFD15
__CFD18:
	LSL  R30
	ROL  R31
	ROL  R22
	ROL  R23
	DEC  R21
	BRNE __CFD18
	RJMP __CFD15
__CFD11:
	CLR  R23
__CFD12:
	CPI  R21,8
	BRLO __CFD13
	MOV  R30,R31
	MOV  R31,R22
	MOV  R22,R23
	SUBI R21,8
	RJMP __CFD12
__CFD13:
	TST  R21
	BREQ __CFD15
__CFD14:
	LSR  R23
	ROR  R22
	ROR  R31
	ROR  R30
	DEC  R21
	BRNE __CFD14
__CFD15:
	TST  R0
	BRPL __CFD16
	RCALL __ANEGD1
__CFD16:
	POP  R21
	RET

__CDF1U:
	SET
	RJMP __CDF1U0
__CDF1:
	CLT
__CDF1U0:
	SBIW R30,0
	SBCI R22,0
	SBCI R23,0
	BREQ __CDF10
	CLR  R0
	BRTS __CDF11
	TST  R23
	BRPL __CDF11
	COM  R0
	RCALL __ANEGD1
__CDF11:
	MOV  R1,R23
	LDI  R23,30
	TST  R1
__CDF12:
	BRMI __CDF13
	DEC  R23
	LSL  R30
	ROL  R31
	ROL  R22
	ROL  R1
	RJMP __CDF12
__CDF13:
	MOV  R30,R31
	MOV  R31,R22
	MOV  R22,R1
	PUSH R21
	RCALL __REPACK
	POP  R21
__CDF10:
	RET

__SWAPACC:
	PUSH R20
	MOVW R20,R30
	MOVW R30,R26
	MOVW R26,R20
	MOVW R20,R22
	MOVW R22,R24
	MOVW R24,R20
	MOV  R20,R0
	MOV  R0,R1
	MOV  R1,R20
	POP  R20
	RET

__UADD12:
	ADD  R30,R26
	ADC  R31,R27
	ADC  R22,R24
	RET

__NEGMAN1:
	COM  R30
	COM  R31
	COM  R22
	SUBI R30,-1
	SBCI R31,-1
	SBCI R22,-1
	RET

__SUBF12:
	PUSH R21
	RCALL __UNPACK
	CPI  R25,0x80
	BREQ __ADDF129
	LDI  R21,0x80
	EOR  R1,R21

	RJMP __ADDF120

__ADDF12:
	PUSH R21
	RCALL __UNPACK
	CPI  R25,0x80
	BREQ __ADDF129

__ADDF120:
	CPI  R23,0x80
	BREQ __ADDF128
__ADDF121:
	MOV  R21,R23
	SUB  R21,R25
	BRVS __ADDF1211
	BRPL __ADDF122
	RCALL __SWAPACC
	RJMP __ADDF121
__ADDF122:
	CPI  R21,24
	BRLO __ADDF123
	CLR  R26
	CLR  R27
	CLR  R24
__ADDF123:
	CPI  R21,8
	BRLO __ADDF124
	MOV  R26,R27
	MOV  R27,R24
	CLR  R24
	SUBI R21,8
	RJMP __ADDF123
__ADDF124:
	TST  R21
	BREQ __ADDF126
__ADDF125:
	LSR  R24
	ROR  R27
	ROR  R26
	DEC  R21
	BRNE __ADDF125
__ADDF126:
	MOV  R21,R0
	EOR  R21,R1
	BRMI __ADDF127
	RCALL __UADD12
	BRCC __ADDF129
	ROR  R22
	ROR  R31
	ROR  R30
	INC  R23
	BRVC __ADDF129
	RJMP __MAXRES
__ADDF128:
	RCALL __SWAPACC
__ADDF129:
	RCALL __REPACK
	POP  R21
	RET
__ADDF1211:
	BRCC __ADDF128
	RJMP __ADDF129
__ADDF127:
	SUB  R30,R26
	SBC  R31,R27
	SBC  R22,R24
	BREQ __ZERORES
	BRCC __ADDF1210
	COM  R0
	RCALL __NEGMAN1
__ADDF1210:
	TST  R22
	BRMI __ADDF129
	LSL  R30
	ROL  R31
	ROL  R22
	DEC  R23
	BRVC __ADDF1210

__ZERORES:
	CLR  R30
	CLR  R31
	CLR  R22
	CLR  R23
	POP  R21
	RET

__MINRES:
	SER  R30
	SER  R31
	LDI  R22,0x7F
	SER  R23
	POP  R21
	RET

__MAXRES:
	SER  R30
	SER  R31
	LDI  R22,0x7F
	LDI  R23,0x7F
	POP  R21
	RET

__MULF12:
	PUSH R21
	RCALL __UNPACK
	CPI  R23,0x80
	BREQ __ZERORES
	CPI  R25,0x80
	BREQ __ZERORES
	EOR  R0,R1
	SEC
	ADC  R23,R25
	BRVC __MULF124
	BRLT __ZERORES
__MULF125:
	TST  R0
	BRMI __MINRES
	RJMP __MAXRES
__MULF124:
	PUSH R0
	PUSH R17
	PUSH R18
	PUSH R19
	PUSH R20
	CLR  R17
	CLR  R18
	CLR  R25
	MUL  R22,R24
	MOVW R20,R0
	MUL  R24,R31
	MOV  R19,R0
	ADD  R20,R1
	ADC  R21,R25
	MUL  R22,R27
	ADD  R19,R0
	ADC  R20,R1
	ADC  R21,R25
	MUL  R24,R30
	RCALL __MULF126
	MUL  R27,R31
	RCALL __MULF126
	MUL  R22,R26
	RCALL __MULF126
	MUL  R27,R30
	RCALL __MULF127
	MUL  R26,R31
	RCALL __MULF127
	MUL  R26,R30
	ADD  R17,R1
	ADC  R18,R25
	ADC  R19,R25
	ADC  R20,R25
	ADC  R21,R25
	MOV  R30,R19
	MOV  R31,R20
	MOV  R22,R21
	MOV  R21,R18
	POP  R20
	POP  R19
	POP  R18
	POP  R17
	POP  R0
	TST  R22
	BRMI __MULF122
	LSL  R21
	ROL  R30
	ROL  R31
	ROL  R22
	RJMP __MULF123
__MULF122:
	INC  R23
	BRVS __MULF125
__MULF123:
	RCALL __ROUND_REPACK
	POP  R21
	RET

__MULF127:
	ADD  R17,R0
	ADC  R18,R1
	ADC  R19,R25
	RJMP __MULF128
__MULF126:
	ADD  R18,R0
	ADC  R19,R1
__MULF128:
	ADC  R20,R25
	ADC  R21,R25
	RET

__DIVF21:
	PUSH R21
	RCALL __UNPACK
	CPI  R23,0x80
	BRNE __DIVF210
	TST  R1
__DIVF211:
	BRPL __DIVF219
	RJMP __MINRES
__DIVF219:
	RJMP __MAXRES
__DIVF210:
	CPI  R25,0x80
	BRNE __DIVF218
__DIVF217:
	RJMP __ZERORES
__DIVF218:
	EOR  R0,R1
	SEC
	SBC  R25,R23
	BRVC __DIVF216
	BRLT __DIVF217
	TST  R0
	RJMP __DIVF211
__DIVF216:
	MOV  R23,R25
	PUSH R17
	PUSH R18
	PUSH R19
	PUSH R20
	CLR  R1
	CLR  R17
	CLR  R18
	CLR  R19
	CLR  R20
	CLR  R21
	LDI  R25,32
__DIVF212:
	CP   R26,R30
	CPC  R27,R31
	CPC  R24,R22
	CPC  R20,R17
	BRLO __DIVF213
	SUB  R26,R30
	SBC  R27,R31
	SBC  R24,R22
	SBC  R20,R17
	SEC
	RJMP __DIVF214
__DIVF213:
	CLC
__DIVF214:
	ROL  R21
	ROL  R18
	ROL  R19
	ROL  R1
	ROL  R26
	ROL  R27
	ROL  R24
	ROL  R20
	DEC  R25
	BRNE __DIVF212
	MOVW R30,R18
	MOV  R22,R1
	POP  R20
	POP  R19
	POP  R18
	POP  R17
	TST  R22
	BRMI __DIVF215
	LSL  R21
	ROL  R30
	ROL  R31
	ROL  R22
	DEC  R23
	BRVS __DIVF217
__DIVF215:
	RCALL __ROUND_REPACK
	POP  R21
	RET

__CMPF12:
	TST  R25
	BRMI __CMPF120
	TST  R23
	BRMI __CMPF121
	CP   R25,R23
	BRLO __CMPF122
	BRNE __CMPF121
	CP   R26,R30
	CPC  R27,R31
	CPC  R24,R22
	BRLO __CMPF122
	BREQ __CMPF123
__CMPF121:
	CLZ
	CLC
	RET
__CMPF122:
	CLZ
	SEC
	RET
__CMPF123:
	SEZ
	CLC
	RET
__CMPF120:
	TST  R23
	BRPL __CMPF122
	CP   R25,R23
	BRLO __CMPF121
	BRNE __CMPF122
	CP   R30,R26
	CPC  R31,R27
	CPC  R22,R24
	BRLO __CMPF122
	BREQ __CMPF123
	RJMP __CMPF121

__ANEGW1:
	NEG  R31
	NEG  R30
	SBCI R31,0
	RET

__ANEGD1:
	COM  R31
	COM  R22
	COM  R23
	NEG  R30
	SBCI R31,-1
	SBCI R22,-1
	SBCI R23,-1
	RET

__CWD1:
	MOV  R22,R31
	ADD  R22,R22
	SBC  R22,R22
	MOV  R23,R22
	RET

__MULW12U:
	MUL  R31,R26
	MOV  R31,R0
	MUL  R30,R27
	ADD  R31,R0
	MUL  R30,R26
	MOV  R30,R0
	ADD  R31,R1
	RET

__MULW12:
	RCALL __CHKSIGNW
	RCALL __MULW12U
	BRTC __MULW121
	RCALL __ANEGW1
__MULW121:
	RET

__DIVW21U:
	CLR  R0
	CLR  R1
	LDI  R25,16
__DIVW21U1:
	LSL  R26
	ROL  R27
	ROL  R0
	ROL  R1
	SUB  R0,R30
	SBC  R1,R31
	BRCC __DIVW21U2
	ADD  R0,R30
	ADC  R1,R31
	RJMP __DIVW21U3
__DIVW21U2:
	SBR  R26,1
__DIVW21U3:
	DEC  R25
	BRNE __DIVW21U1
	MOVW R30,R26
	MOVW R26,R0
	RET

__DIVW21:
	RCALL __CHKSIGNW
	RCALL __DIVW21U
	BRTC __DIVW211
	RCALL __ANEGW1
__DIVW211:
	RET

__CHKSIGNW:
	CLT
	SBRS R31,7
	RJMP __CHKSW1
	RCALL __ANEGW1
	SET
__CHKSW1:
	SBRS R27,7
	RJMP __CHKSW2
	COM  R26
	COM  R27
	ADIW R26,1
	BLD  R0,0
	INC  R0
	BST  R0,0
__CHKSW2:
	RET

__GETW1P:
	LD   R30,X+
	LD   R31,X
	SBIW R26,1
	RET

__GETD1S0:
	LD   R30,Y
	LDD  R31,Y+1
	LDD  R22,Y+2
	LDD  R23,Y+3
	RET

__GETD2S0:
	LD   R26,Y
	LDD  R27,Y+1
	LDD  R24,Y+2
	LDD  R25,Y+3
	RET

__PUTPARD1:
	ST   -Y,R23
	ST   -Y,R22
	ST   -Y,R31
	ST   -Y,R30
	RET

__SWAPD12:
	MOV  R1,R24
	MOV  R24,R22
	MOV  R22,R1
	MOV  R1,R25
	MOV  R25,R23
	MOV  R23,R1

__SWAPW12:
	MOV  R1,R27
	MOV  R27,R31
	MOV  R31,R1

__SWAPB12:
	MOV  R1,R26
	MOV  R26,R30
	MOV  R30,R1
	RET

__EEPROMRDB:
	SBIC EECR,EEWE
	RJMP __EEPROMRDB
	PUSH R31
	IN   R31,SREG
	CLI
	OUT  EEARL,R26
	OUT  EEARH,R27
	SBI  EECR,EERE
	IN   R30,EEDR
	OUT  SREG,R31
	POP  R31
	RET

__EEPROMWRB:
	SBIS EECR,EEWE
	RJMP __EEPROMWRB1
	WDR
	RJMP __EEPROMWRB
__EEPROMWRB1:
	IN   R25,SREG
	CLI
	OUT  EEARL,R26
	OUT  EEARH,R27
	SBI  EECR,EERE
	IN   R24,EEDR
	CP   R30,R24
	BREQ __EEPROMWRB0
	OUT  EEDR,R30
	SBI  EECR,EEMWE
	SBI  EECR,EEWE
__EEPROMWRB0:
	OUT  SREG,R25
	RET

__CPW02:
	CLR  R0
	CP   R0,R26
	CPC  R0,R27
	RET

__CPD02:
	CLR  R0
	CP   R0,R26
	CPC  R0,R27
	CPC  R0,R24
	CPC  R0,R25
	RET

__SAVELOCR6:
	ST   -Y,R21
__SAVELOCR5:
	ST   -Y,R20
__SAVELOCR4:
	ST   -Y,R19
__SAVELOCR3:
	ST   -Y,R18
__SAVELOCR2:
	ST   -Y,R17
	ST   -Y,R16
	RET

__LOADLOCR6:
	LDD  R21,Y+5
__LOADLOCR5:
	LDD  R20,Y+4
__LOADLOCR4:
	LDD  R19,Y+3
__LOADLOCR3:
	LDD  R18,Y+2
__LOADLOCR2:
	LDD  R17,Y+1
	LD   R16,Y
	RET

;END OF CODE MARKER
__END_OF_CODE:
