⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.lss

📁 Mega16 + MCP3208 12bit A/D >> C-source code >> AVRSTUDIO project >> WinAVR
💻 LSS
📖 第 1 页 / 共 5 页
字号:
     4f2:	f9 01       	movw	r30, r18
     4f4:	f4 90       	lpm	r15, Z
	B3 =  usarthexDigits((hexIn & 0x00F0) >> 4);
     4f6:	9c 01       	movw	r18, r24
     4f8:	20 7f       	andi	r18, 0xF0	; 240
     4fa:	30 70       	andi	r19, 0x00	; 0
     4fc:	74 e0       	ldi	r23, 0x04	; 4
     4fe:	36 95       	lsr	r19
     500:	27 95       	ror	r18
     502:	7a 95       	dec	r23
     504:	e1 f7       	brne	.-8      	; 0x4fe <usart_16bitHex+0x34>
     506:	24 0f       	add	r18, r20
     508:	35 1f       	adc	r19, r21
     50a:	f9 01       	movw	r30, r18
     50c:	04 91       	lpm	r16, Z
	B4 =  usarthexDigits((hexIn & 0x000F)); 
     50e:	8f 70       	andi	r24, 0x0F	; 15
     510:	90 70       	andi	r25, 0x00	; 0
     512:	48 0f       	add	r20, r24
     514:	59 1f       	adc	r21, r25
     516:	fa 01       	movw	r30, r20
     518:	14 91       	lpm	r17, Z

	usart_putc(B1);	
     51a:	86 2f       	mov	r24, r22
     51c:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
	usart_putc(B2);	   
     520:	8f 2d       	mov	r24, r15
     522:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
	usart_putc(B3);	
     526:	80 2f       	mov	r24, r16
     528:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
	usart_putc(B4);	  
     52c:	81 2f       	mov	r24, r17
     52e:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
     532:	1f 91       	pop	r17
     534:	0f 91       	pop	r16
     536:	ff 90       	pop	r15
     538:	08 95       	ret

0000053a <usart_SendBin>:
}

void usart_SendBin(unsigned char x)
{
     53a:	0f 93       	push	r16
     53c:	1f 93       	push	r17
     53e:	cf 93       	push	r28
     540:	df 93       	push	r29
     542:	08 2f       	mov	r16, r24
     544:	10 e8       	ldi	r17, 0x80	; 128
     546:	c0 e0       	ldi	r28, 0x00	; 0
     548:	d0 e0       	ldi	r29, 0x00	; 0
	unsigned char i;
	for (i=128;i>0;i>>=1)
	{
		if ((x&i)==0) usart_puts("0");
     54a:	80 2f       	mov	r24, r16
     54c:	81 23       	and	r24, r17
     54e:	19 f4       	brne	.+6      	; 0x556 <usart_SendBin+0x1c>
     550:	8e e6       	ldi	r24, 0x6E	; 110
     552:	90 e0       	ldi	r25, 0x00	; 0
     554:	02 c0       	rjmp	.+4      	; 0x55a <usart_SendBin+0x20>
		else usart_puts("1");
     556:	80 e7       	ldi	r24, 0x70	; 112
     558:	90 e0       	ldi	r25, 0x00	; 0
     55a:	0e 94 f3 01 	call	0x3e6	; 0x3e6 <usart_puts>
     55e:	16 95       	lsr	r17
     560:	21 96       	adiw	r28, 0x01	; 1
     562:	c8 30       	cpi	r28, 0x08	; 8
     564:	d1 05       	cpc	r29, r1
     566:	89 f7       	brne	.-30     	; 0x54a <usart_SendBin+0x10>
     568:	df 91       	pop	r29
     56a:	cf 91       	pop	r28
     56c:	1f 91       	pop	r17
     56e:	0f 91       	pop	r16
     570:	08 95       	ret

00000572 <usart_SendDec>:
	}
}

void usart_SendFloat( float usart_value,unsigned char usart_digit ,unsigned char usart_precision)
{
	char usart_temp[15];
	unsigned char i;

	dtostrf(usart_value,usart_digit,usart_precision,usart_temp);
	
    i=0;
	
	while(usart_temp[i] != 0)
	{
		usart_putc(usart_temp[i]);
		i++;
	}		

}

void usart_SendDec(unsigned int x, unsigned char n, unsigned char fillch)
{
     572:	cf 92       	push	r12
     574:	df 92       	push	r13
     576:	ef 92       	push	r14
     578:	ff 92       	push	r15
     57a:	0f 93       	push	r16
     57c:	1f 93       	push	r17
     57e:	cf 93       	push	r28
     580:	df 93       	push	r29
     582:	cd b7       	in	r28, 0x3d	; 61
     584:	de b7       	in	r29, 0x3e	; 62
     586:	2a 97       	sbiw	r28, 0x0a	; 10
     588:	0f b6       	in	r0, 0x3f	; 63
     58a:	f8 94       	cli
     58c:	de bf       	out	0x3e, r29	; 62
     58e:	0f be       	out	0x3f, r0	; 63
     590:	cd bf       	out	0x3d, r28	; 61
     592:	9c 01       	movw	r18, r24
     594:	06 2f       	mov	r16, r22
     596:	10 e0       	ldi	r17, 0x00	; 0
     598:	e6 2e       	mov	r14, r22
     59a:	ff 24       	eor	r15, r15
     59c:	6e 01       	movw	r12, r28
     59e:	08 94       	sec
     5a0:	c1 1c       	adc	r12, r1
     5a2:	d1 1c       	adc	r13, r1
     5a4:	14 c0       	rjmp	.+40     	; 0x5ce <usart_SendDec+0x5c>
    unsigned char i;
    unsigned char s[10];
    for (i = 0; i < n; i++) {
        s[n - i - 1] = '0' + (x % 10);
     5a6:	f7 01       	movw	r30, r14
     5a8:	e1 1b       	sub	r30, r17
     5aa:	f1 09       	sbc	r31, r1
     5ac:	ec 0d       	add	r30, r12
     5ae:	fd 1d       	adc	r31, r13
     5b0:	31 97       	sbiw	r30, 0x01	; 1
     5b2:	c9 01       	movw	r24, r18
     5b4:	6a e0       	ldi	r22, 0x0A	; 10
     5b6:	70 e0       	ldi	r23, 0x00	; 0
     5b8:	0e 94 b8 04 	call	0x970	; 0x970 <__udivmodhi4>
     5bc:	80 5d       	subi	r24, 0xD0	; 208
     5be:	80 83       	st	Z, r24
        x /= 10;
     5c0:	c9 01       	movw	r24, r18
     5c2:	6a e0       	ldi	r22, 0x0A	; 10
     5c4:	70 e0       	ldi	r23, 0x00	; 0
     5c6:	0e 94 b8 04 	call	0x970	; 0x970 <__udivmodhi4>
     5ca:	9b 01       	movw	r18, r22
     5cc:	1f 5f       	subi	r17, 0xFF	; 255
     5ce:	10 17       	cp	r17, r16
     5d0:	51 f7       	brne	.-44     	; 0x5a6 <usart_SendDec+0x34>
     5d2:	60 e0       	ldi	r22, 0x00	; 0
     5d4:	70 e0       	ldi	r23, 0x00	; 0
     5d6:	20 2f       	mov	r18, r16
     5d8:	33 27       	eor	r19, r19
     5da:	21 50       	subi	r18, 0x01	; 1
     5dc:	30 40       	sbci	r19, 0x00	; 0
     5de:	de 01       	movw	r26, r28
     5e0:	11 96       	adiw	r26, 0x01	; 1
     5e2:	09 c0       	rjmp	.+18     	; 0x5f6 <usart_SendDec+0x84>
     5e4:	6f 5f       	subi	r22, 0xFF	; 255
     5e6:	7f 4f       	sbci	r23, 0xFF	; 255
    }
    for (i=0; i<(n - 1); i++) {
        if (s[i] == '0') s[i] = fillch; else break;
     5e8:	fd 01       	movw	r30, r26
     5ea:	e8 0f       	add	r30, r24
     5ec:	f9 1f       	adc	r31, r25
     5ee:	80 81       	ld	r24, Z
     5f0:	80 33       	cpi	r24, 0x30	; 48
     5f2:	79 f4       	brne	.+30     	; 0x612 <usart_SendDec+0xa0>
     5f4:	40 83       	st	Z, r20
     5f6:	86 2f       	mov	r24, r22
     5f8:	99 27       	eor	r25, r25
     5fa:	82 17       	cp	r24, r18
     5fc:	93 07       	cpc	r25, r19
     5fe:	94 f3       	brlt	.-28     	; 0x5e4 <usart_SendDec+0x72>
     600:	08 c0       	rjmp	.+16     	; 0x612 <usart_SendDec+0xa0>
    }
    for (i=0; i<n; i++) usart_putc(s[i]);
     602:	fe 01       	movw	r30, r28
     604:	e1 0f       	add	r30, r17
     606:	f1 1d       	adc	r31, r1
     608:	81 81       	ldd	r24, Z+1	; 0x01
     60a:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
     60e:	1f 5f       	subi	r17, 0xFF	; 255
     610:	01 c0       	rjmp	.+2      	; 0x614 <usart_SendDec+0xa2>
     612:	10 e0       	ldi	r17, 0x00	; 0
     614:	10 17       	cp	r17, r16
     616:	a9 f7       	brne	.-22     	; 0x602 <usart_SendDec+0x90>
     618:	2a 96       	adiw	r28, 0x0a	; 10
     61a:	0f b6       	in	r0, 0x3f	; 63
     61c:	f8 94       	cli
     61e:	de bf       	out	0x3e, r29	; 62
     620:	0f be       	out	0x3f, r0	; 63
     622:	cd bf       	out	0x3d, r28	; 61
     624:	df 91       	pop	r29
     626:	cf 91       	pop	r28
     628:	1f 91       	pop	r17
     62a:	0f 91       	pop	r16
     62c:	ff 90       	pop	r15
     62e:	ef 90       	pop	r14
     630:	df 90       	pop	r13
     632:	cf 90       	pop	r12
     634:	08 95       	ret

00000636 <usart_SendDecDigit>:
}

void usart_SendDecDigit(unsigned long x)
{
     636:	af 92       	push	r10
     638:	bf 92       	push	r11
     63a:	cf 92       	push	r12
     63c:	df 92       	push	r13
     63e:	ef 92       	push	r14
     640:	ff 92       	push	r15
     642:	0f 93       	push	r16
     644:	1f 93       	push	r17
     646:	5b 01       	movw	r10, r22
     648:	6c 01       	movw	r12, r24
	unsigned int y;
	if (x<65535)
     64a:	6f 3f       	cpi	r22, 0xFF	; 255
     64c:	2f ef       	ldi	r18, 0xFF	; 255
     64e:	72 07       	cpc	r23, r18
     650:	20 e0       	ldi	r18, 0x00	; 0
     652:	82 07       	cpc	r24, r18
     654:	20 e0       	ldi	r18, 0x00	; 0
     656:	92 07       	cpc	r25, r18
     658:	08 f0       	brcs	.+2      	; 0x65c <usart_SendDecDigit+0x26>
     65a:	58 c0       	rjmp	.+176    	; 0x70c <usart_SendDecDigit+0xd6>
	{
		y=x/1000;usart_putc(y+0x30);x-=(y*1000);
     65c:	28 ee       	ldi	r18, 0xE8	; 232
     65e:	33 e0       	ldi	r19, 0x03	; 3
     660:	40 e0       	ldi	r20, 0x00	; 0
     662:	50 e0       	ldi	r21, 0x00	; 0
     664:	0e 94 cc 04 	call	0x998	; 0x998 <__udivmodsi4>
     668:	79 01       	movw	r14, r18
     66a:	8a 01       	movw	r16, r20
     66c:	82 2f       	mov	r24, r18
     66e:	80 5d       	subi	r24, 0xD0	; 208
     670:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
     674:	88 ee       	ldi	r24, 0xE8	; 232
     676:	93 e0       	ldi	r25, 0x03	; 3
     678:	9c 01       	movw	r18, r24
     67a:	e2 9e       	mul	r14, r18
     67c:	c0 01       	movw	r24, r0
     67e:	e3 9e       	mul	r14, r19
     680:	90 0d       	add	r25, r0
     682:	f2 9e       	mul	r15, r18
     684:	90 0d       	add	r25, r0
     686:	11 24       	eor	r1, r1
     688:	aa 27       	eor	r26, r26
     68a:	bb 27       	eor	r27, r27
     68c:	a8 1a       	sub	r10, r24
     68e:	b9 0a       	sbc	r11, r25
     690:	ca 0a       	sbc	r12, r26
     692:	db 0a       	sbc	r13, r27
		y=x/100;usart_putc(y+0x30);x-=(y*100);
     694:	c6 01       	movw	r24, r12
     696:	b5 01       	movw	r22, r10
     698:	24 e6       	ldi	r18, 0x64	; 100
     69a:	30 e0       	ldi	r19, 0x00	; 0
     69c:	40 e0       	ldi	r20, 0x00	; 0
     69e:	50 e0       	ldi	r21, 0x00	; 0
     6a0:	0e 94 cc 04 	call	0x998	; 0x998 <__udivmodsi4>
     6a4:	79 01       	movw	r14, r18
     6a6:	8a 01       	movw	r16, r20
     6a8:	82 2f       	mov	r24, r18
     6aa:	80 5d       	subi	r24, 0xD0	; 208
     6ac:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
     6b0:	84 e6       	ldi	r24, 0x64	; 100
     6b2:	90 e0       	ldi	r25, 0x00	; 0
     6b4:	9c 01       	movw	r18, r24
     6b6:	e2 9e       	mul	r14, r18
     6b8:	c0 01       	movw	r24, r0
     6ba:	e3 9e       	mul	r14, r19
     6bc:	90 0d       	add	r25, r0
     6be:	f2 9e       	mul	r15, r18
     6c0:	90 0d       	add	r25, r0
     6c2:	11 24       	eor	r1, r1
     6c4:	aa 27       	eor	r26, r26
     6c6:	bb 27       	eor	r27, r27
     6c8:	a8 1a       	sub	r10, r24
     6ca:	b9 0a       	sbc	r11, r25
     6cc:	ca 0a       	sbc	r12, r26
     6ce:	db 0a       	sbc	r13, r27
		y=x/10;usart_putc(y+0x30);x-=(y*10);
     6d0:	c6 01       	movw	r24, r12
     6d2:	b5 01       	movw	r22, r10
     6d4:	2a e0       	ldi	r18, 0x0A	; 10
     6d6:	30 e0       	ldi	r19, 0x00	; 0
     6d8:	40 e0       	ldi	r20, 0x00	; 0
     6da:	50 e0       	ldi	r21, 0x00	; 0
     6dc:	0e 94 cc 04 	call	0x998	; 0x998 <__udivmodsi4>
     6e0:	79 01       	movw	r14, r18
     6e2:	8a 01       	movw	r16, r20
     6e4:	82 2f       	mov	r24, r18
     6e6:	80 5d       	subi	r24, 0xD0	; 208
     6e8:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
		usart_putc(x+0x30);
     6ec:	c7 01       	movw	r24, r14
     6ee:	13 e0       	ldi	r17, 0x03	; 3
     6f0:	88 0f       	add	r24, r24
     6f2:	99 1f       	adc	r25, r25
     6f4:	1a 95       	dec	r17
     6f6:	e1 f7       	brne	.-8      	; 0x6f0 <usart_SendDecDigit+0xba>
     6f8:	ee 0c       	add	r14, r14
     6fa:	ff 1c       	adc	r15, r15
     6fc:	e8 0e       	add	r14, r24
     6fe:	f9 1e       	adc	r15, r25
     700:	ae 18       	sub	r10, r14
     702:	8a 2d       	mov	r24, r10
     704:	80 5d       	subi	r24, 0xD0	; 208
     706:	0e 94 15 02 	call	0x42a	; 0x42a <usart_putc>
     70a:	04 c0       	rjmp	.+8      	; 0x714 <usart_SendDecDigit+0xde>
	}
	else usart_puts("Err");
     70c:	82 e7       	ldi	r24, 0x72	; 114
     70e:	90 e0       	ldi	r25, 0x00	; 0
     710:	0e 94 f3 01 	call	0x3e6	; 0x3e6 <usart_puts>
     714:	1f 91       	pop	r17
     716:	0f 91       	pop	r16
     718:	ff 90       	pop	r15
     71a:	ef 90       	pop	r14
     71c:	df 90       	pop	r13
     71e:	cf 90       	pop	r12
     720:	bf 90       	pop	r11
     722:	af 90       	pop	r10
     724:	08 95       	ret

00000726 <usart_SendInt>:
}
  
void usart_SendInt(unsigned int number )
{
     726:	0f 93       	push	r16
     728:	1f 93       	push	r17
     72a:	cf 93       	push	r28
     72c:	df 93       	push	r29
     72e:	cd b7       	in	r28, 0x3d	; 61
     730:	de b7       	in	r29, 0x3e	; 62
     732:	2f 97       	sbiw	r28, 0x0f	; 15
     734:	0f b6       	in	r0, 0x3f	; 63
     736:	f8 94       	cli
     738:	de bf       	out	0x3e, r29	; 62
     73a:	0f be       	out	0x3f, r0	; 63
     73c:	cd bf       	out	0x3d, r28	; 61
    char temp[15];
    itoa(number,temp,10);
     73e:	4a e0       	ldi	r20, 0x0A	; 10
     740:	50 e0       	ldi	r21, 0x00	; 0
     742:	8e 01       	movw	r16, r28
     744:	0f 5f       	subi	r16, 0xFF	; 255
     746:	1f 4f       	sbci	r17, 0xFF	; 255
     748:	b8 01       	movw	r22, r16
     74a:	0e 94 68 04 	call	0x8d0	; 0x8d0 <itoa>
    usart_puts(temp);
     74e:	c8 01       	movw	r24, r16

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -