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

📄 communicate.lst

📁 驱动128芯片 完成基本的 PORTA亮灯调试功能
💻 LST
📖 第 1 页 / 共 2 页
字号:
   1               		.file	"communicate.c"
   2               		.arch atmega128
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  11               		.text
  12               	.Ltext0:
  63               	.global	main
  65               	main:
   1:communicate.c **** /////////////////////////////////////////////////////////////////////
   2:communicate.c **** //                        亮灯程序                                 //
   3:communicate.c **** /////////////////////////////////////////////////////////////////////
   4:communicate.c **** 
   5:communicate.c **** //#include <communicate.h>
   6:communicate.c **** #include <avr/io.h>
   7:communicate.c **** #include <stdio.h>
   8:communicate.c **** #include <avr/signal.h>
   9:communicate.c **** #include <avr/interrupt.h>
  10:communicate.c **** #include <avr/delay.h>
  11:communicate.c **** 
  12:communicate.c **** 
  13:communicate.c **** 
  14:communicate.c **** 
  15:communicate.c **** 
  16:communicate.c **** 
  17:communicate.c **** 
  18:communicate.c **** int main(void)
  19:communicate.c **** {	
  67               	.LM1:
  68               	/* prologue: frame size=0 */
  69 0000 C0E0      		ldi r28,lo8(__stack - 0)
  70 0002 D0E0      		ldi r29,hi8(__stack - 0)
  71 0004 DEBF      		out __SP_H__,r29
  72 0006 CDBF      		out __SP_L__,r28
  73               	/* prologue end (size=4) */
  20:communicate.c ****     
  21:communicate.c **** 	cli();   // 端口初始化
  75               	.LM2:
  76               	/* #APP */
  77 0008 F894      		cli
  22:communicate.c **** 	
  23:communicate.c **** 	PORTA=0xFF;
  79               	.LM3:
  80               	/* #NOAPP */
  81 000a 8FEF      		ldi r24,lo8(-1)
  82 000c 8BBB      		out 59-0x20,r24
  24:communicate.c **** 	PORTB=0xFF; 
  84               	.LM4:
  85 000e 88BB      		out 56-0x20,r24
  25:communicate.c **** 	PORTC=0xFF;
  87               	.LM5:
  88 0010 85BB      		out 53-0x20,r24
  26:communicate.c **** 	PORTD=0xFF;
  90               	.LM6:
  91 0012 82BB      		out 50-0x20,r24
  27:communicate.c **** 	PORTE=0xFF;
  93               	.LM7:
  94 0014 83B9      		out 35-0x20,r24
  28:communicate.c **** 	PORTF=0xFF;
  96               	.LM8:
  97 0016 8093 6200 		sts 98,r24
  29:communicate.c **** 	PORTG=0xFF;
  99               	.LM9:
 100 001a 8093 6500 		sts 101,r24
  30:communicate.c **** 	DDRD=0xD0;
 102               	.LM10:
 103 001e 90ED      		ldi r25,lo8(-48)
 104 0020 91BB      		out 49-0x20,r25
  31:communicate.c **** 	DDRA=0xFF;
 106               	.LM11:
 107 0022 8ABB      		out 58-0x20,r24
  32:communicate.c **** 
  33:communicate.c **** 	DDRB=0x08;      //MISO=output and MOSI,SCK,SS = input
 109               	.LM12:
 110 0024 88E0      		ldi r24,lo8(8)
 111 0026 87BB      		out 55-0x20,r24
  34:communicate.c **** 	PORTB=0x00;     //MISO上拉电阻有效	
 113               	.LM13:
 114 0028 18BA      		out 56-0x20,__zero_reg__
  35:communicate.c **** 	
  36:communicate.c **** 	
  37:communicate.c **** 	sei();
 116               	.LM14:
 117               	/* #APP */
 118 002a 7894      		sei
 119               	/* #NOAPP */
 120 002c 58EF      		ldi r21,lo8(-8)
 121 002e 4FEF      		ldi r20,lo8(-1)
 122               	.L2:
  38:communicate.c **** 	
  39:communicate.c **** 
  40:communicate.c **** 	while(1)
  41:communicate.c **** 	
  42:communicate.c **** 	{	
  43:communicate.c **** 	
  44:communicate.c **** 			    	
  45:communicate.c **** 				if(PORTA==0xFF)
 124               	.LM15:
 125 0030 8BB3      		in r24,59-0x20
 126 0032 8F3F      		cpi r24,lo8(-1)
 127 0034 11F4      		brne .L4
  46:communicate.c **** 				PORTA=0xF8;
 129               	.LM16:
 130 0036 5BBB      		out 59-0x20,r21
 131 0038 01C0      		rjmp .L5
 132               	.L4:
  47:communicate.c **** 				else
  48:communicate.c **** 				PORTA=0xFF;
 134               	.LM17:
 135 003a 4BBB      		out 59-0x20,r20
 136               	.L5:
 137 003c A0E0      		ldi r26,lo8(18432)
 138 003e B8E4      		ldi r27,hi8(18432)
 139 0040 C0E0      		ldi r28,hlo8(18432)
 140 0042 D0E0      		ldi r29,hhi8(18432)
 141 0044 23E1      		ldi r18,lo8(19)
 142 0046 30E0      		ldi r19,hi8(19)
 143               	.L17:
 144               	.LBB2:
 145               	.LBB3:
 146               	.LBB4:
 147               	.LBB5:
 148               	.LBB6:
 150               	.Ltext1:
   1:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** /* Copyright (c) 2002, Marek Michalkiewicz
   2:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    Copyright (c) 2004, Joerg Wunsch
   3:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    All rights reserved.
   4:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
   5:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    Redistribution and use in source and binary forms, with or without
   6:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    modification, are permitted provided that the following conditions are met:
   7:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
   8:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    * Redistributions of source code must retain the above copyright
   9:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****      notice, this list of conditions and the following disclaimer.
  10:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
  11:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    * Redistributions in binary form must reproduce the above copyright
  12:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****      notice, this list of conditions and the following disclaimer in
  13:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****      the documentation and/or other materials provided with the
  14:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****      distribution.
  15:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
  16:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    * Neither the name of the copyright holders nor the names of
  17:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****      contributors may be used to endorse or promote products derived
  18:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****      from this software without specific prior written permission.
  19:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
  20:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  24:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****   POSSIBILITY OF SUCH DAMAGE. */
  31:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
  32:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** /* $Id: delay.h,v 1.9 2004/12/22 10:16:54 joerg_wunsch Exp $ */
  33:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
  34:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** /*
  35:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****    avr/delay.h - loops for small accurate delays
  36:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h ****  */
  37:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** 
  38:G:/WinAVR2005/bin/../lib/gcc/avr/3.4.3/../../../../avr/include/avr/delay.h **** #ifndef _AVR_DELAY_H_

⌨️ 快捷键说明

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