📄 os_cpu.lst
字号:
165 # include <avr/iom64.h>
166 #elif defined (__AVR_ATmega103__)
167 # include <avr/iom103.h>
168 #elif defined (__AVR_ATmega32__)
169 # include <avr/iom32.h>
170 #elif defined (__AVR_ATmega323__)
171 # include <avr/iom323.h>
172 #elif defined (__AVR_ATmega16__)
173 # include <avr/iom16.h>
174 #elif defined (__AVR_ATmega161__)
175 # include <avr/iom161.h>
176 #elif defined (__AVR_ATmega162__)
177 # include <avr/iom162.h>
178 #elif defined (__AVR_ATmega163__)
179 # include <avr/iom163.h>
180 #elif defined (__AVR_ATmega169__)
181 # include <avr/iom169.h>
182 #elif defined (__AVR_ATmega8__)
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccAvaaaa.s page 6
183 # include <avr/iom8.h>
1 /* Copyright (c) 2002, Marek Michalkiewicz
2 All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in
11 the documentation and/or other materials provided with the
12 distribution.
13
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 POSSIBILITY OF SUCH DAMAGE. */
25
26 /* $Id: iom8.h,v 1.8 2003/02/17 09:57:28 marekm Exp $ */
27
28 /* avr/iom8.h - definitions for ATmega8 */
29
30 #ifndef _AVR_IOM8_H_
31 #define _AVR_IOM8_H_ 1
32
33 /* This file should only be included from <avr/io.h>, never directly. */
34
35 #ifndef _AVR_IO_H_
36 # error "Include <avr/io.h> instead of this file."
37 #endif
38
39 #ifndef _AVR_IOXXX_H_
40 # define _AVR_IOXXX_H_ "iom8.h"
41 #else
42 # error "Attempt to include more than one <avr/ioXXX.h> file."
43 #endif
44
45 /* I/O registers */
46
47 /* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
48 #define TWBR _SFR_IO8(0x00)
49 #define TWSR _SFR_IO8(0x01)
50 #define TWAR _SFR_IO8(0x02)
51 #define TWDR _SFR_IO8(0x03)
52
53 /* ADC */
54 #define ADCW _SFR_IO16(0x04)
55 #ifndef __ASSEMBLER__
56 #define ADC _SFR_IO16(0x04)
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccAvaaaa.s page 7
57 #endif
58 #define ADCL _SFR_IO8(0x04)
59 #define ADCH _SFR_IO8(0x05)
60 #define ADCSR _SFR_IO8(0x06)
61 #define ADCSRA _SFR_IO8(0x06) /* Changed in 2486H-AVR-09/02 */
62 #define ADMUX _SFR_IO8(0x07)
63
64 /* analog comparator */
65 #define ACSR _SFR_IO8(0x08)
66
67 /* USART */
68 #define UBRRL _SFR_IO8(0x09)
69 #define UCSRB _SFR_IO8(0x0A)
70 #define UCSRA _SFR_IO8(0x0B)
71 #define UDR _SFR_IO8(0x0C)
72
73 /* SPI */
74 #define SPCR _SFR_IO8(0x0D)
75 #define SPSR _SFR_IO8(0x0E)
76 #define SPDR _SFR_IO8(0x0F)
77
78 /* Port D */
79 #define PIND _SFR_IO8(0x10)
80 #define DDRD _SFR_IO8(0x11)
81 #define PORTD _SFR_IO8(0x12)
82
83 /* Port C */
84 #define PINC _SFR_IO8(0x13)
85 #define DDRC _SFR_IO8(0x14)
86 #define PORTC _SFR_IO8(0x15)
87
88 /* Port B */
89 #define PINB _SFR_IO8(0x16)
90 #define DDRB _SFR_IO8(0x17)
91 #define PORTB _SFR_IO8(0x18)
92
93 /* 0x1C..0x1F EEPROM */
94
95 #define UCSRC _SFR_IO8(0x20)
96 #define UBRRH _SFR_IO8(0x20)
97
98 #define WDTCR _SFR_IO8(0x21)
99 #define ASSR _SFR_IO8(0x22)
100
101 /* Timer 2 */
102 #define OCR2 _SFR_IO8(0x23)
103 #define TCNT2 _SFR_IO8(0x24)
104 #define TCCR2 _SFR_IO8(0x25)
105
106 /* Timer 1 */
107 #define ICR1 _SFR_IO16(0x26)
108 #define ICR1L _SFR_IO8(0x26)
109 #define ICR1H _SFR_IO8(0x27)
110 #define OCR1B _SFR_IO16(0x28)
111 #define OCR1BL _SFR_IO8(0x28)
112 #define OCR1BH _SFR_IO8(0x29)
113 #define OCR1A _SFR_IO16(0x2A)
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccAvaaaa.s page 8
114 #define OCR1AL _SFR_IO8(0x2A)
115 #define OCR1AH _SFR_IO8(0x2B)
116 #define TCNT1 _SFR_IO16(0x2C)
117 #define TCNT1L _SFR_IO8(0x2C)
118 #define TCNT1H _SFR_IO8(0x2D)
119 #define TCCR1B _SFR_IO8(0x2E)
120 #define TCCR1A _SFR_IO8(0x2F)
121
122 #define SFIOR _SFR_IO8(0x30)
123
124 #define OSCCAL _SFR_IO8(0x31)
125
126 /* Timer 0 */
127 #define TCNT0 _SFR_IO8(0x32)
128 #define TCCR0 _SFR_IO8(0x33)
129
130 #define MCUCSR _SFR_IO8(0x34)
131 #define MCUCR _SFR_IO8(0x35)
132
133 #define TWCR _SFR_IO8(0x36)
134
135 #define SPMCR _SFR_IO8(0x37)
136
137 #define TIFR _SFR_IO8(0x38)
138 #define TIMSK _SFR_IO8(0x39)
139
140 #define GIFR _SFR_IO8(0x3A)
141 #define GIMSK _SFR_IO8(0x3B)
142 #define GICR _SFR_IO8(0x3B) /* Changed in 2486H-AVR-09/02 */
143
144 /* 0x3C reserved (OCR0?) */
145
146 /* 0x3D..0x3E SP */
147
148 /* 0x3F SREG */
149
150 /* Interrupt vectors */
151
152 #define SIG_INTERRUPT0 _VECTOR(1)
153 #define SIG_INTERRUPT1 _VECTOR(2)
154 #define SIG_OUTPUT_COMPARE2 _VECTOR(3)
155 #define SIG_OVERFLOW2 _VECTOR(4)
156 #define SIG_INPUT_CAPTURE1 _VECTOR(5)
157 #define SIG_OUTPUT_COMPARE1A _VECTOR(6)
158 #define SIG_OUTPUT_COMPARE1B _VECTOR(7)
159 #define SIG_OVERFLOW1 _VECTOR(8)
160 #define SIG_OVERFLOW0 _VECTOR(9)
161 #define SIG_SPI _VECTOR(10)
162 #define SIG_UART_RECV _VECTOR(11)
163 #define SIG_UART_DATA _VECTOR(12)
164 #define SIG_UART_TRANS _VECTOR(13)
165 #define SIG_ADC _VECTOR(14)
166 #define SIG_EEPROM_READY _VECTOR(15)
167 #define SIG_COMPARATOR _VECTOR(16)
168 #define SIG_2WIRE_SERIAL _VECTOR(17)
169 #define SIG_SPM_READY _VECTOR(18)
170
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccAvaaaa.s page 9
171 #define _VECTORS_SIZE 38
172
173 /* Bit numbers */
174
175 /* GIMSK / GICR */
176 #define INT1 7
177 #define INT0 6
178 #define IVSEL 1
179 #define IVCE 0
180
181 /* GIFR */
182 #define INTF1 7
183 #define INTF0 6
184
184 #elif defined (__AVR_ATmega8515__)
18 #include <avr/signal.h>
1 /* Copyright (c) 2002, Marek Michalkiewicz
2 All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in
11 the documentation and/or other materials provided with the
12 distribution.
13
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
20 #define OS_SET_I SEI ;开总中断
21 #define OS_CLEAR_I CLI ;关总中断
22
23
24 .global OS_GET_TO_TASK_INT ;汇编函数跳入下一条线程(中断模式)
25 .global OS_GET_TO_TASK_DISP ;汇编函数跳入下一条线程(普通模式)
26 .global START_TICK_POINT ;汇编函数第一次启动时跳入调度入口点
27 .global OS_DISP_TIME_P ;汇编线程等待处理过程
28
29 .extern OS_ATTEMPER ;C函数获取下一条线程
30 .extern OS_GETTO_NEXT_TASK_INT ;C函数进入下一条线程(中断模式)
31 .extern OS_GETTO_NEXT_TASK_DISP ;C函数进入下一条线程(普通模式)
32 .extern OS_SAVE_TASK_SP ;C函数保存当前线程SP指针
33 .extern OS_DLY_TIME_DEC ;C函数线程等待时间处理函数
34 .extern OS_RELOAD_TICK ;重新初始化系统时钟
35
36
37 ;保存寄存器宏
38 .macro PUSHRS
39 PUSH R0
40 PUSH R1
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccAvaaaa.s page 10
41 PUSH R2
42 PUSH R3
43 PUSH R4
44 PUSH R5
45 PUSH R6
46 PUSH R7
47 PUSH R8
48 PUSH R9
49 PUSH R10
50 PUSH R11
51 PUSH R12
52 PUSH R13
53 PUSH R14
54 PUSH R15
55 PUSH R16
56 PUSH R17
57 PUSH R18
58 PUSH R19
59 PUSH R20
60 PUSH R21
61 PUSH R22
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -