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

📄 main.lss

📁 测试LCM模块AVR应用
💻 LSS
📖 第 1 页 / 共 2 页
字号:

main.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000003f0  00000000  00000000  00000074  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000096  00800060  000003f0  00000464  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .stab         00000378  00000000  00000000  000004fc  2**2
                  CONTENTS, READONLY, DEBUGGING
  3 .stabstr      00000071  00000000  00000000  00000874  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_aranges 00000020  00000000  00000000  000008e5  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_pubnames 00000125  00000000  00000000  00000905  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_info   00000385  00000000  00000000  00000a2a  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_abbrev 00000102  00000000  00000000  00000daf  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_line   000005cd  00000000  00000000  00000eb1  2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_frame  00000160  00000000  00000000  00001480  2**2
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_str    00000162  00000000  00000000  000015e0  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_loc    0000012a  00000000  00000000  00001742  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <__vectors>:
   0:	0c 94 2a 00 	jmp	0x54	; 0x54 <__ctors_end>
   4:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
   8:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
   c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  10:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  14:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  18:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  1c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  20:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  24:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  28:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  2c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  30:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  34:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  38:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  3c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  40:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  44:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  48:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  4c:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>
  50:	0c 94 47 00 	jmp	0x8e	; 0x8e <__bad_interrupt>

00000054 <__ctors_end>:
  54:	11 24       	eor	r1, r1
  56:	1f be       	out	0x3f, r1	; 63
  58:	cf e5       	ldi	r28, 0x5F	; 95
  5a:	d4 e0       	ldi	r29, 0x04	; 4
  5c:	de bf       	out	0x3e, r29	; 62
  5e:	cd bf       	out	0x3d, r28	; 61

00000060 <__do_copy_data>:
  60:	10 e0       	ldi	r17, 0x00	; 0
  62:	a0 e6       	ldi	r26, 0x60	; 96
  64:	b0 e0       	ldi	r27, 0x00	; 0
  66:	e0 ef       	ldi	r30, 0xF0	; 240
  68:	f3 e0       	ldi	r31, 0x03	; 3
  6a:	02 c0       	rjmp	.+4      	; 0x70 <.do_copy_data_start>

0000006c <.do_copy_data_loop>:
  6c:	05 90       	lpm	r0, Z+
  6e:	0d 92       	st	X+, r0

00000070 <.do_copy_data_start>:
  70:	a6 3f       	cpi	r26, 0xF6	; 246
  72:	b1 07       	cpc	r27, r17
  74:	d9 f7       	brne	.-10     	; 0x6c <.do_copy_data_loop>

00000076 <__do_clear_bss>:
  76:	10 e0       	ldi	r17, 0x00	; 0
  78:	a6 ef       	ldi	r26, 0xF6	; 246
  7a:	b0 e0       	ldi	r27, 0x00	; 0
  7c:	01 c0       	rjmp	.+2      	; 0x80 <.do_clear_bss_start>

0000007e <.do_clear_bss_loop>:
  7e:	1d 92       	st	X+, r1

00000080 <.do_clear_bss_start>:
  80:	a6 3f       	cpi	r26, 0xF6	; 246
  82:	b1 07       	cpc	r27, r17
  84:	e1 f7       	brne	.-8      	; 0x7e <.do_clear_bss_loop>
  86:	0e 94 f2 01 	call	0x3e4	; 0x3e4 <main>
  8a:	0c 94 f7 01 	jmp	0x3ee	; 0x3ee <_exit>

0000008e <__bad_interrupt>:
  8e:	0c 94 00 00 	jmp	0	; 0x0 <__heap_end>

00000092 <DelayUs>:
// Delay function for 8051 system (Fosc = 8MHz)

// Delay microsecond less than 255us
void DelayUs(uint8 Tus)
{
  92:	08 95       	ret

00000094 <DelayMs>:
	// If Tus >= 18, the delay is precise, otherwise not!
	if (Tus > 17)
	{
		Tus = Tus/2 - 9;
		if (Tus != 0)
			while(--Tus != 0);
	}
}

// Delay Tms ms
void DelayMs(uint16 Tms)
{
  94:	1f 93       	push	r17
  96:	cf 93       	push	r28
  98:	df 93       	push	r29
  9a:	ec 01       	movw	r28, r24
  9c:	06 c0       	rjmp	.+12     	; 0xaa <DelayMs+0x16>
	uint8 i;
	while(Tms-- != 0)
  9e:	13 e0       	ldi	r17, 0x03	; 3
	{
		i = 4;
		while(i-- != 0)
		DelayUs(250);
  a0:	8a ef       	ldi	r24, 0xFA	; 250
  a2:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
  a6:	11 50       	subi	r17, 0x01	; 1
  a8:	d8 f7       	brcc	.-10     	; 0xa0 <DelayMs+0xc>
  aa:	21 97       	sbiw	r28, 0x01	; 1
  ac:	8f ef       	ldi	r24, 0xFF	; 255
  ae:	cf 3f       	cpi	r28, 0xFF	; 255
  b0:	d8 07       	cpc	r29, r24
  b2:	a9 f7       	brne	.-22     	; 0x9e <DelayMs+0xa>
  b4:	df 91       	pop	r29
  b6:	cf 91       	pop	r28
  b8:	1f 91       	pop	r17
  ba:	08 95       	ret

000000bc <delay4us>:
	}
}

// Delay 4us
void delay4us(void)
{
  bc:	08 95       	ret

000000be <delay100ms>:
 	// 4us delay
}

// Delay 100ms
void delay100ms(void)
{
  be:	84 e6       	ldi	r24, 0x64	; 100
  c0:	90 e0       	ldi	r25, 0x00	; 0
  c2:	0e 94 4a 00 	call	0x94	; 0x94 <DelayMs>
  c6:	08 95       	ret

000000c8 <delay500ms>:
	DelayMs(100);
}

// Delay 500ms
void delay500ms(void)
{
  c8:	84 ef       	ldi	r24, 0xF4	; 244
  ca:	91 e0       	ldi	r25, 0x01	; 1
  cc:	0e 94 4a 00 	call	0x94	; 0x94 <DelayMs>
  d0:	08 95       	ret

000000d2 <delay1s>:
	DelayMs(500);
}

// Delay 1s
void delay1s(void)
{
  d2:	88 ee       	ldi	r24, 0xE8	; 232
  d4:	93 e0       	ldi	r25, 0x03	; 3
  d6:	0e 94 4a 00 	call	0x94	; 0x94 <DelayMs>
  da:	08 95       	ret

000000dc <Lcd_Busy>:
//=======================================================
//读取lcd是否内部操作(忙碌)状态
char Lcd_Busy()
{
  dc:	17 ba       	out	0x17, r1	; 23
    char r;
    DDRB = 0x00;       //端口B设为输入方式
    E_L;RS_L;RW_H;     //E=0(致能),RS=0(命令),RW=1(读)
  de:	97 98       	cbi	0x12, 7	; 18
  e0:	95 98       	cbi	0x12, 5	; 18
  e2:	96 9a       	sbi	0x12, 6	; 18
    DelayUs(2);       //液晶延时子程序
  e4:	82 e0       	ldi	r24, 0x02	; 2
  e6:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
    E_H;
  ea:	97 9a       	sbi	0x12, 7	; 18
    DelayUs(2);       //液晶延时子程序
  ec:	82 e0       	ldi	r24, 0x02	; 2
  ee:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
    r = PINB & 0x80;   //读取lcd_data第八位
  f2:	86 b3       	in	r24, 0x16	; 22
    E_L;
  f4:	97 98       	cbi	0x12, 7	; 18
    DDRB=0xff;         //端口B设为输出方式
  f6:	9f ef       	ldi	r25, 0xFF	; 255
  f8:	97 bb       	out	0x17, r25	; 23
  fa:	80 78       	andi	r24, 0x80	; 128
    return r;          //读取结果返回
}
  fc:	99 27       	eor	r25, r25
  fe:	08 95       	ret

00000100 <Lcd_Command>:

//=======================================================
//向Lcd发送命令程序
void Lcd_Command(unsigned char Command)
{
 100:	1f 93       	push	r17
 102:	18 2f       	mov	r17, r24
    while(Lcd_Busy()); //判断lcd是否内部操作状态
 104:	0e 94 6e 00 	call	0xdc	; 0xdc <Lcd_Busy>
 108:	88 23       	and	r24, r24
 10a:	e1 f7       	brne	.-8      	; 0x104 <Lcd_Command+0x4>
    E_L;RS_L;RW_L;     //E=0(致能),RS=0(命令),RW=0(写)
 10c:	97 98       	cbi	0x12, 7	; 18
 10e:	95 98       	cbi	0x12, 5	; 18
 110:	96 98       	cbi	0x12, 6	; 18
    DelayUs(2);       //液晶延时子程序
 112:	82 e0       	ldi	r24, 0x02	; 2
 114:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
    E_H;
 118:	97 9a       	sbi	0x12, 7	; 18
    PORTB = Command;   //向Lcd发送命令
 11a:	18 bb       	out	0x18, r17	; 24
    DelayUs(2);       //液晶延时子程序
 11c:	82 e0       	ldi	r24, 0x02	; 2
 11e:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
    E_L;
 122:	97 98       	cbi	0x12, 7	; 18
 124:	1f 91       	pop	r17
 126:	08 95       	ret

00000128 <Lcd_Write>:
}

//=======================================================
//向lcd写入一个字符程序
void Lcd_Write(unsigned char Data)
{
 128:	1f 93       	push	r17
 12a:	18 2f       	mov	r17, r24
    while(Lcd_Busy()); //判断lcd是否内部操作状态
 12c:	0e 94 6e 00 	call	0xdc	; 0xdc <Lcd_Busy>
 130:	88 23       	and	r24, r24
 132:	e1 f7       	brne	.-8      	; 0x12c <Lcd_Write+0x4>
    E_L;RS_H;RW_L;     //E=0(致能),RS=1(数据),RW=0(写)
 134:	97 98       	cbi	0x12, 7	; 18
 136:	95 9a       	sbi	0x12, 5	; 18
 138:	96 98       	cbi	0x12, 6	; 18
    DelayUs(2);       //液晶延时子程序
 13a:	82 e0       	ldi	r24, 0x02	; 2
 13c:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
    E_H;
 140:	97 9a       	sbi	0x12, 7	; 18
    PORTB = Data;      //向lcd写入一个字符
 142:	18 bb       	out	0x18, r17	; 24
    DelayUs(2);       //液晶延时子程序
 144:	82 e0       	ldi	r24, 0x02	; 2
 146:	0e 94 49 00 	call	0x92	; 0x92 <DelayUs>
    E_L;
 14a:	97 98       	cbi	0x12, 7	; 18
 14c:	1f 91       	pop	r17
 14e:	08 95       	ret

00000150 <SendByte>:
}
//*****************************************************
void SendByte(char DatCmd, unsigned char dByte)
{	
 150:	0f 93       	push	r16
 152:	1f 93       	push	r17
 154:	18 2f       	mov	r17, r24
 156:	06 2f       	mov	r16, r22
	while(Lcd_Busy()); //判断lcd是否内部操作状态
 158:	0e 94 6e 00 	call	0xdc	; 0xdc <Lcd_Busy>
 15c:	88 23       	and	r24, r24
 15e:	e1 f7       	brne	.-8      	; 0x158 <SendByte+0x8>
    E_L;
 160:	97 98       	cbi	0x12, 7	; 18
	if(DatCmd)
 162:	11 23       	and	r17, r17
 164:	11 f0       	breq	.+4      	; 0x16a <SendByte+0x1a>
	RS_H;
 166:	95 9a       	sbi	0x12, 5	; 18
 168:	01 c0       	rjmp	.+2      	; 0x16c <SendByte+0x1c>
	else
	RS_L;
 16a:	95 98       	cbi	0x12, 5	; 18
	RW_L;     //E=0(致能),RS=1(数据),RS=0(指令),RW=0(写)
 16c:	96 98       	cbi	0x12, 6	; 18
//    DelayUs(2);       //液晶延时子程序
    E_H;
 16e:	97 9a       	sbi	0x12, 7	; 18
    PORTB = dByte;      //向lcd写入一个字符
 170:	08 bb       	out	0x18, r16	; 24
//    DelayUs(2);       //液晶延时子程序
    E_L;
 172:	97 98       	cbi	0x12, 7	; 18
 174:	1f 91       	pop	r17
 176:	0f 91       	pop	r16
 178:	08 95       	ret

0000017a <Lcd_Init>:
数据线B0~B7接PORTB, E=D7 RW=D6 RS=D5
=========================================================*/
//初始化LCD_8位接口,4行x20字符的工作方式
void Lcd_Init()
{
 17a:	8f ef       	ldi	r24, 0xFF	; 255
 17c:	87 bb       	out	0x17, r24	; 23
    DDRB = 0xff;       //端口B设为输出方式
    DDRD = 0xff;       //端口D设为输出方式
 17e:	81 bb       	out	0x11, r24	; 17
    Lcd_Command(0x38); //
 180:	88 e3       	ldi	r24, 0x38	; 56
 182:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x38); //
 186:	88 e3       	ldi	r24, 0x38	; 56
 188:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x38); //
 18c:	88 e3       	ldi	r24, 0x38	; 56
 18e:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x38); //
 192:	88 e3       	ldi	r24, 0x38	; 56
 194:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x08); //令显示器off
 198:	88 e0       	ldi	r24, 0x08	; 8
 19a:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x01); //清除显示器
 19e:	81 e0       	ldi	r24, 0x01	; 1
 1a0:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x06); //令LCD每接收到1Byte数据后,AC自动加1
 1a4:	86 e0       	ldi	r24, 0x06	; 6
 1a6:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
    Lcd_Command(0x0C); //令光标,0x0c=不显示,0x0d=显示闪动. 
 1aa:	8c e0       	ldi	r24, 0x0C	; 12
 1ac:	0e 94 80 00 	call	0x100	; 0x100 <Lcd_Command>
 1b0:	08 95       	ret

000001b2 <SendStr>:
// Send a string to LCD screen
void SendStr(uint8 *ptString)
{
 1b2:	cf 93       	push	r28
 1b4:	df 93       	push	r29
 1b6:	ec 01       	movw	r28, r24
 1b8:	08 c0       	rjmp	.+16     	; 0x1ca <SendStr+0x18>
	while((*ptString)!='\0')
	{
		SendByte(iDat, *ptString++);
 1ba:	21 96       	adiw	r28, 0x01	; 1
 1bc:	81 e0       	ldi	r24, 0x01	; 1
 1be:	0e 94 a8 00 	call	0x150	; 0x150 <SendByte>
		DelayMs(20);
 1c2:	84 e1       	ldi	r24, 0x14	; 20
 1c4:	90 e0       	ldi	r25, 0x00	; 0
 1c6:	0e 94 4a 00 	call	0x94	; 0x94 <DelayMs>
 1ca:	68 81       	ld	r22, Y
 1cc:	66 23       	and	r22, r22
 1ce:	a9 f7       	brne	.-22     	; 0x1ba <SendStr+0x8>
 1d0:	df 91       	pop	r29
 1d2:	cf 91       	pop	r28
 1d4:	08 95       	ret

000001d6 <Move>:
	}
}

// Move Cursor or display
void Move(uint8 dir)
{
 1d6:	68 2f       	mov	r22, r24
 1d8:	80 e0       	ldi	r24, 0x00	; 0
 1da:	0e 94 a8 00 	call	0x150	; 0x150 <SendByte>
 1de:	08 95       	ret

000001e0 <Gotoxy>:
	SendByte(iCmd, dir);
}

// Goto specific location

⌨️ 快捷键说明

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