Added opgave b1

This commit is contained in:
2016-02-23 14:52:30 +01:00
parent a349cc58df
commit 066e031d25
12 changed files with 385 additions and 721 deletions
Binary file not shown.
+27 -509
View File
@@ -3,29 +3,29 @@ MIC-Week3.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000054 00800100 00000364 000003d8 2**0
0 .data 00000000 00800100 00800100 00000116 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 00000364 00000000 00000000 00000074 2**1
1 .text 000000c2 00000000 00000000 00000054 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .comment 00000030 00000000 00000000 0000042c 2**0
2 .comment 00000030 00000000 00000000 00000116 2**0
CONTENTS, READONLY
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 0000045c 2**2
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000148 2**2
CONTENTS, READONLY
4 .debug_aranges 00000048 00000000 00000000 00000498 2**0
4 .debug_aranges 00000030 00000000 00000000 00000184 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 00000573 00000000 00000000 000004e0 2**0
5 .debug_info 0000040a 00000000 00000000 000001b4 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_abbrev 0000023d 00000000 00000000 00000a53 2**0
6 .debug_abbrev 000001fd 00000000 00000000 000005be 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 00000287 00000000 00000000 00000c90 2**0
7 .debug_line 000001de 00000000 00000000 000007bb 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_frame 00000080 00000000 00000000 00000f18 2**2
8 .debug_frame 00000044 00000000 00000000 0000099c 2**2
CONTENTS, READONLY, DEBUGGING
9 .debug_str 000001eb 00000000 00000000 00000f98 2**0
9 .debug_str 000001f2 00000000 00000000 000009e0 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_loc 000001b5 00000000 00000000 00001183 2**0
10 .debug_loc 00000027 00000000 00000000 00000bd2 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000038 00000000 00000000 00001338 2**0
11 .debug_ranges 00000020 00000000 00000000 00000bf9 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
@@ -114,517 +114,35 @@ Disassembly of section .text:
98: 11 e0 ldi r17, 0x01 ; 1
9a: a0 e0 ldi r26, 0x00 ; 0
9c: b1 e0 ldi r27, 0x01 ; 1
9e: e4 e6 ldi r30, 0x64 ; 100
a0: f3 e0 ldi r31, 0x03 ; 3
9e: e2 ec ldi r30, 0xC2 ; 194
a0: f0 e0 ldi r31, 0x00 ; 0
a2: 00 e0 ldi r16, 0x00 ; 0
a4: 0b bf out 0x3b, r16 ; 59
a6: 02 c0 rjmp .+4 ; 0xac <__do_copy_data+0x14>
a8: 07 90 elpm r0, Z+
aa: 0d 92 st X+, r0
ac: a4 35 cpi r26, 0x54 ; 84
ac: a0 30 cpi r26, 0x00 ; 0
ae: b1 07 cpc r27, r17
b0: d9 f7 brne .-10 ; 0xa8 <__do_copy_data+0x10>
b2: a3 d0 rcall .+326 ; 0x1fa <main>
b4: 55 c1 rjmp .+682 ; 0x360 <_exit>
b2: 02 d0 rcall .+4 ; 0xb8 <main>
b4: 04 c0 rjmp .+8 ; 0xbe <_exit>
000000b6 <__bad_interrupt>:
b6: a4 cf rjmp .-184 ; 0x0 <__vectors>
000000b8 <lcd_writeChar>:
lcd_command( 0x80 );
}
000000b8 <main>:
//opgave1();
void lcd_writeChar( unsigned char dat )
{
PORTC = dat & 0xF0; // hoge nibble
b8: 98 2f mov r25, r24
ba: 90 7f andi r25, 0xF0 ; 240
bc: 95 bb out 0x15, r25 ; 21
PORTC = PORTC | 0x0C; // Enable on (EN = 1, RS=1),
be: 95 b3 in r25, 0x15 ; 21
c0: 9c 60 ori r25, 0x0C ; 12
c2: 95 bb out 0x15, r25 ; 21
#else
//round up by default
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
#endif
opgave2knop();
__builtin_avr_delay_cycles(__ticks_dc);
c4: ef ec ldi r30, 0xCF ; 207
c6: f7 e0 ldi r31, 0x07 ; 7
c8: 31 97 sbiw r30, 0x01 ; 1
ca: f1 f7 brne .-4 ; 0xc8 <lcd_writeChar+0x10>
cc: 00 c0 rjmp .+0 ; 0xce <lcd_writeChar+0x16>
ce: 00 00 nop
_delay_ms(1); // wait 1 ms
PORTC = 0x04; // Enable off (EN = 0, RS = 1)
d0: 94 e0 ldi r25, 0x04 ; 4
d2: 95 bb out 0x15, r25 ; 21
PORTC = (dat & 0x0F) << 4; // lage nibble
d4: f0 e1 ldi r31, 0x10 ; 16
d6: 8f 9f mul r24, r31
d8: c0 01 movw r24, r0
da: 11 24 eor r1, r1
dc: 85 bb out 0x15, r24 ; 21
PORTC = PORTC | 0x0C; // Enable on (RS=1),
de: 85 b3 in r24, 0x15 ; 21
e0: 8c 60 ori r24, 0x0C ; 12
e2: 85 bb out 0x15, r24 ; 21
e4: 8f ec ldi r24, 0xCF ; 207
e6: 97 e0 ldi r25, 0x07 ; 7
e8: 01 97 sbiw r24, 0x01 ; 1
ea: f1 f7 brne .-4 ; 0xe8 <lcd_writeChar+0x30>
ec: 00 c0 rjmp .+0 ; 0xee <lcd_writeChar+0x36>
ee: 00 00 nop
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x00; // stop
f0: 15 ba out 0x15, r1 ; 21
f2: 08 95 ret
000000f4 <lcd_command>:
// (EN=0 RS=0)
}
void lcd_command ( unsigned char dat )
{
PORTC = dat & 0xF0; // hoge nibble
f4: 98 2f mov r25, r24
f6: 90 7f andi r25, 0xF0 ; 240
f8: 95 bb out 0x15, r25 ; 21
PORTC = PORTC | 0x08; // data (RS=0),
fa: ab 9a sbi 0x15, 3 ; 21
fc: ef ec ldi r30, 0xCF ; 207
fe: f7 e0 ldi r31, 0x07 ; 7
100: 31 97 sbiw r30, 0x01 ; 1
102: f1 f7 brne .-4 ; 0x100 <lcd_command+0xc>
104: 00 c0 rjmp .+0 ; 0x106 <lcd_command+0x12>
106: 00 00 nop
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x04; // stop (EN = 0)
108: 94 e0 ldi r25, 0x04 ; 4
10a: 95 bb out 0x15, r25 ; 21
PORTC = (dat & 0x0F) << 4; // lage nibble
10c: f0 e1 ldi r31, 0x10 ; 16
10e: 8f 9f mul r24, r31
110: c0 01 movw r24, r0
112: 11 24 eor r1, r1
114: 85 bb out 0x15, r24 ; 21
PORTC = PORTC | 0x08; // data (RS=0),
116: ab 9a sbi 0x15, 3 ; 21
118: 8f ec ldi r24, 0xCF ; 207
11a: 97 e0 ldi r25, 0x07 ; 7
11c: 01 97 sbiw r24, 0x01 ; 1
11e: f1 f7 brne .-4 ; 0x11c <lcd_command+0x28>
120: 00 c0 rjmp .+0 ; 0x122 <lcd_command+0x2e>
122: 00 00 nop
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x00; // stop
124: 15 ba out 0x15, r1 ; 21
126: 08 95 ret
00000128 <lcd_init>:
}
}
void lcd_init()
{
DDRC = 0b11111111;
128: 8f ef ldi r24, 0xFF ; 255
12a: 84 bb out 0x14, r24 ; 20
12c: 2f ef ldi r18, 0xFF ; 255
12e: 80 e7 ldi r24, 0x70 ; 112
130: 92 e0 ldi r25, 0x02 ; 2
132: 21 50 subi r18, 0x01 ; 1
134: 80 40 sbci r24, 0x00 ; 0
136: 90 40 sbci r25, 0x00 ; 0
138: e1 f7 brne .-8 ; 0x132 <lcd_init+0xa>
13a: 00 c0 rjmp .+0 ; 0x13c <lcd_init+0x14>
13c: 00 00 nop
_delay_ms(100);
// return home
lcd_command( 0x02 );
13e: 82 e0 ldi r24, 0x02 ; 2
140: 90 e0 ldi r25, 0x00 ; 0
142: d8 df rcall .-80 ; 0xf4 <lcd_command>
// mode: 4 bits interface data, 2 lines, 5x8 dots
lcd_command( 0x28 );
144: 88 e2 ldi r24, 0x28 ; 40
146: 90 e0 ldi r25, 0x00 ; 0
148: d5 df rcall .-86 ; 0xf4 <lcd_command>
// display: on, cursor off, blinking off
lcd_command( 0x0C );
14a: 8c e0 ldi r24, 0x0C ; 12
14c: 90 e0 ldi r25, 0x00 ; 0
14e: d2 df rcall .-92 ; 0xf4 <lcd_command>
// entry mode: cursor to right, no shift
lcd_command( 0x06 );
150: 86 e0 ldi r24, 0x06 ; 6
152: 90 e0 ldi r25, 0x00 ; 0
154: cf df rcall .-98 ; 0xf4 <lcd_command>
// RAM address: 0, first position, line 1
lcd_command( 0x80 );
156: 80 e8 ldi r24, 0x80 ; 128
158: 90 e0 ldi r25, 0x00 ; 0
15a: cc cf rjmp .-104 ; 0xf4 <lcd_command>
15c: 08 95 ret
0000015e <lcd_writeLine>:
PORTC = 0x00; // stop
// (EN=0 RS=0)
}
void lcd_writeLine ( int line, char text[] )
{
15e: cf 93 push r28
160: df 93 push r29
162: eb 01 movw r28, r22
// eerst de eerste 8 karakters = regel 1
if(line)
164: 89 2b or r24, r25
166: 19 f0 breq .+6 ; 0x16e <lcd_writeLine+0x10>
{
// eerste pos regel 1
lcd_command(0xC0);
168: 80 ec ldi r24, 0xC0 ; 192
16a: c4 df rcall .-120 ; 0xf4 <lcd_command>
16c: 02 c0 rjmp .+4 ; 0x172 <lcd_writeLine+0x14>
}
else
{
// regel 0
lcd_command(0x80);
16e: 80 e8 ldi r24, 0x80 ; 128
170: c1 df rcall .-126 ; 0xf4 <lcd_command>
}
int count = 0;
while (text[count] != '\0') {
172: 88 81 ld r24, Y
174: 88 23 and r24, r24
176: 59 f0 breq .+22 ; 0x18e <lcd_writeLine+0x30>
178: 21 96 adiw r28, 0x01 ; 1
lcd_writeChar( text[count] );
17a: 9e df rcall .-196 ; 0xb8 <lcd_writeChar>
17c: 8f ec ldi r24, 0xCF ; 207
17e: 97 e0 ldi r25, 0x07 ; 7
180: 01 97 sbiw r24, 0x01 ; 1
182: f1 f7 brne .-4 ; 0x180 <lcd_writeLine+0x22>
184: 00 c0 rjmp .+0 ; 0x186 <lcd_writeLine+0x28>
186: 00 00 nop
lcd_command(0x80);
}
int count = 0;
while (text[count] != '\0') {
188: 89 91 ld r24, Y+
18a: 81 11 cpse r24, r1
18c: f6 cf rjmp .-20 ; 0x17a <lcd_writeLine+0x1c>
lcd_writeChar( text[count] );
count++;
_delay_ms(1);
}
18e: df 91 pop r29
190: cf 91 pop r28
192: 08 95 ret
00000194 <opgave1>:
return 1;
}
b8: 81 e0 ldi r24, 0x01 ; 1
ba: 90 e0 ldi r25, 0x00 ; 0
bc: 08 95 ret
void opgave1()
{
lcd_init();
194: c9 df rcall .-110 ; 0x128 <lcd_init>
000000be <_exit>:
be: f8 94 cli
srand(98126519);
196: 87 eb ldi r24, 0xB7 ; 183
198: 9a e4 ldi r25, 0x4A ; 74
19a: 7a d0 rcall .+244 ; 0x290 <srand>
int r = 8;
while(1){
r = rand() % 8;
19c: 76 d0 rcall .+236 ; 0x28a <rand>
19e: 87 70 andi r24, 0x07 ; 7
1a0: 90 78 andi r25, 0x80 ; 128
1a2: 99 23 and r25, r25
1a4: 24 f4 brge .+8 ; 0x1ae <opgave1+0x1a>
1a6: 01 97 sbiw r24, 0x01 ; 1
1a8: 88 6f ori r24, 0xF8 ; 248
1aa: 9f 6f ori r25, 0xFF ; 255
1ac: 01 96 adiw r24, 0x01 ; 1
lcd_writeLine(0, pattern[r].data);
1ae: bc 01 movw r22, r24
1b0: 66 0f add r22, r22
1b2: 77 1f adc r23, r23
1b4: 88 0f add r24, r24
1b6: 99 1f adc r25, r25
1b8: 88 0f add r24, r24
1ba: 99 1f adc r25, r25
1bc: 88 0f add r24, r24
1be: 99 1f adc r25, r25
1c0: 68 0f add r22, r24
1c2: 79 1f adc r23, r25
1c4: 6c 5f subi r22, 0xFC ; 252
1c6: 7e 4f sbci r23, 0xFE ; 254
1c8: 80 e0 ldi r24, 0x00 ; 0
1ca: 90 e0 ldi r25, 0x00 ; 0
1cc: c8 df rcall .-112 ; 0x15e <lcd_writeLine>
1ce: 2f ef ldi r18, 0xFF ; 255
1d0: 89 e6 ldi r24, 0x69 ; 105
1d2: 98 e1 ldi r25, 0x18 ; 24
1d4: 21 50 subi r18, 0x01 ; 1
1d6: 80 40 sbci r24, 0x00 ; 0
1d8: 90 40 sbci r25, 0x00 ; 0
1da: e1 f7 brne .-8 ; 0x1d4 <opgave1+0x40>
1dc: 00 c0 rjmp .+0 ; 0x1de <opgave1+0x4a>
1de: 00 00 nop
_delay_ms(1000);
//clear
lcd_command(0x01);
1e0: 81 e0 ldi r24, 0x01 ; 1
1e2: 90 e0 ldi r25, 0x00 ; 0
1e4: 87 df rcall .-242 ; 0xf4 <lcd_command>
1e6: 2f ef ldi r18, 0xFF ; 255
1e8: 80 e7 ldi r24, 0x70 ; 112
1ea: 92 e0 ldi r25, 0x02 ; 2
1ec: 21 50 subi r18, 0x01 ; 1
1ee: 80 40 sbci r24, 0x00 ; 0
1f0: 90 40 sbci r25, 0x00 ; 0
1f2: e1 f7 brne .-8 ; 0x1ec <opgave1+0x58>
1f4: 00 c0 rjmp .+0 ; 0x1f6 <opgave1+0x62>
1f6: 00 00 nop
1f8: d1 cf rjmp .-94 ; 0x19c <opgave1+0x8>
000001fa <main>:
{"Kenneth"}, {"Janco"}, {"Arthur"}, {"Martijn"}, {"Mauro"}, {"Rene"}, {"Remco"}, {"Jannick"}
};
int main(void)
{
opgave1();
1fa: cc df rcall .-104 ; 0x194 <opgave1>
000001fc <do_rand>:
1fc: 8f 92 push r8
1fe: 9f 92 push r9
200: af 92 push r10
202: bf 92 push r11
204: cf 92 push r12
206: df 92 push r13
208: ef 92 push r14
20a: ff 92 push r15
20c: cf 93 push r28
20e: df 93 push r29
210: ec 01 movw r28, r24
212: 68 81 ld r22, Y
214: 79 81 ldd r23, Y+1 ; 0x01
216: 8a 81 ldd r24, Y+2 ; 0x02
218: 9b 81 ldd r25, Y+3 ; 0x03
21a: 61 15 cp r22, r1
21c: 71 05 cpc r23, r1
21e: 81 05 cpc r24, r1
220: 91 05 cpc r25, r1
222: 21 f4 brne .+8 ; 0x22c <do_rand+0x30>
224: 64 e2 ldi r22, 0x24 ; 36
226: 79 ed ldi r23, 0xD9 ; 217
228: 8b e5 ldi r24, 0x5B ; 91
22a: 97 e0 ldi r25, 0x07 ; 7
22c: 2d e1 ldi r18, 0x1D ; 29
22e: 33 ef ldi r19, 0xF3 ; 243
230: 41 e0 ldi r20, 0x01 ; 1
232: 50 e0 ldi r21, 0x00 ; 0
234: 38 d0 rcall .+112 ; 0x2a6 <__divmodsi4>
236: 49 01 movw r8, r18
238: 5a 01 movw r10, r20
23a: 9b 01 movw r18, r22
23c: ac 01 movw r20, r24
23e: a7 ea ldi r26, 0xA7 ; 167
240: b1 e4 ldi r27, 0x41 ; 65
242: 4d d0 rcall .+154 ; 0x2de <__muluhisi3>
244: 6b 01 movw r12, r22
246: 7c 01 movw r14, r24
248: ac ee ldi r26, 0xEC ; 236
24a: b4 ef ldi r27, 0xF4 ; 244
24c: a5 01 movw r20, r10
24e: 94 01 movw r18, r8
250: 52 d0 rcall .+164 ; 0x2f6 <__mulohisi3>
252: dc 01 movw r26, r24
254: cb 01 movw r24, r22
256: 8c 0d add r24, r12
258: 9d 1d adc r25, r13
25a: ae 1d adc r26, r14
25c: bf 1d adc r27, r15
25e: b7 ff sbrs r27, 7
260: 03 c0 rjmp .+6 ; 0x268 <do_rand+0x6c>
262: 01 97 sbiw r24, 0x01 ; 1
264: a1 09 sbc r26, r1
266: b0 48 sbci r27, 0x80 ; 128
268: 88 83 st Y, r24
26a: 99 83 std Y+1, r25 ; 0x01
26c: aa 83 std Y+2, r26 ; 0x02
26e: bb 83 std Y+3, r27 ; 0x03
270: 9f 77 andi r25, 0x7F ; 127
272: df 91 pop r29
274: cf 91 pop r28
276: ff 90 pop r15
278: ef 90 pop r14
27a: df 90 pop r13
27c: cf 90 pop r12
27e: bf 90 pop r11
280: af 90 pop r10
282: 9f 90 pop r9
284: 8f 90 pop r8
286: 08 95 ret
00000288 <rand_r>:
288: b9 cf rjmp .-142 ; 0x1fc <do_rand>
0000028a <rand>:
28a: 80 e0 ldi r24, 0x00 ; 0
28c: 91 e0 ldi r25, 0x01 ; 1
28e: b6 cf rjmp .-148 ; 0x1fc <do_rand>
00000290 <srand>:
290: a0 e0 ldi r26, 0x00 ; 0
292: b0 e0 ldi r27, 0x00 ; 0
294: 80 93 00 01 sts 0x0100, r24
298: 90 93 01 01 sts 0x0101, r25
29c: a0 93 02 01 sts 0x0102, r26
2a0: b0 93 03 01 sts 0x0103, r27
2a4: 08 95 ret
000002a6 <__divmodsi4>:
2a6: 05 2e mov r0, r21
2a8: 97 fb bst r25, 7
2aa: 16 f4 brtc .+4 ; 0x2b0 <__divmodsi4+0xa>
2ac: 00 94 com r0
2ae: 0f d0 rcall .+30 ; 0x2ce <__negsi2>
2b0: 57 fd sbrc r21, 7
2b2: 05 d0 rcall .+10 ; 0x2be <__divmodsi4_neg2>
2b4: 24 d0 rcall .+72 ; 0x2fe <__udivmodsi4>
2b6: 07 fc sbrc r0, 7
2b8: 02 d0 rcall .+4 ; 0x2be <__divmodsi4_neg2>
2ba: 46 f4 brtc .+16 ; 0x2cc <__divmodsi4_exit>
2bc: 08 c0 rjmp .+16 ; 0x2ce <__negsi2>
000002be <__divmodsi4_neg2>:
2be: 50 95 com r21
2c0: 40 95 com r20
2c2: 30 95 com r19
2c4: 21 95 neg r18
2c6: 3f 4f sbci r19, 0xFF ; 255
2c8: 4f 4f sbci r20, 0xFF ; 255
2ca: 5f 4f sbci r21, 0xFF ; 255
000002cc <__divmodsi4_exit>:
2cc: 08 95 ret
000002ce <__negsi2>:
2ce: 90 95 com r25
2d0: 80 95 com r24
2d2: 70 95 com r23
2d4: 61 95 neg r22
2d6: 7f 4f sbci r23, 0xFF ; 255
2d8: 8f 4f sbci r24, 0xFF ; 255
2da: 9f 4f sbci r25, 0xFF ; 255
2dc: 08 95 ret
000002de <__muluhisi3>:
2de: 31 d0 rcall .+98 ; 0x342 <__umulhisi3>
2e0: a5 9f mul r26, r21
2e2: 90 0d add r25, r0
2e4: b4 9f mul r27, r20
2e6: 90 0d add r25, r0
2e8: a4 9f mul r26, r20
2ea: 80 0d add r24, r0
2ec: 91 1d adc r25, r1
2ee: 11 24 eor r1, r1
2f0: 08 95 ret
000002f2 <__mulshisi3>:
2f2: b7 ff sbrs r27, 7
2f4: f4 cf rjmp .-24 ; 0x2de <__muluhisi3>
000002f6 <__mulohisi3>:
2f6: f3 df rcall .-26 ; 0x2de <__muluhisi3>
2f8: 82 1b sub r24, r18
2fa: 93 0b sbc r25, r19
2fc: 08 95 ret
000002fe <__udivmodsi4>:
2fe: a1 e2 ldi r26, 0x21 ; 33
300: 1a 2e mov r1, r26
302: aa 1b sub r26, r26
304: bb 1b sub r27, r27
306: fd 01 movw r30, r26
308: 0d c0 rjmp .+26 ; 0x324 <__udivmodsi4_ep>
0000030a <__udivmodsi4_loop>:
30a: aa 1f adc r26, r26
30c: bb 1f adc r27, r27
30e: ee 1f adc r30, r30
310: ff 1f adc r31, r31
312: a2 17 cp r26, r18
314: b3 07 cpc r27, r19
316: e4 07 cpc r30, r20
318: f5 07 cpc r31, r21
31a: 20 f0 brcs .+8 ; 0x324 <__udivmodsi4_ep>
31c: a2 1b sub r26, r18
31e: b3 0b sbc r27, r19
320: e4 0b sbc r30, r20
322: f5 0b sbc r31, r21
00000324 <__udivmodsi4_ep>:
324: 66 1f adc r22, r22
326: 77 1f adc r23, r23
328: 88 1f adc r24, r24
32a: 99 1f adc r25, r25
32c: 1a 94 dec r1
32e: 69 f7 brne .-38 ; 0x30a <__udivmodsi4_loop>
330: 60 95 com r22
332: 70 95 com r23
334: 80 95 com r24
336: 90 95 com r25
338: 9b 01 movw r18, r22
33a: ac 01 movw r20, r24
33c: bd 01 movw r22, r26
33e: cf 01 movw r24, r30
340: 08 95 ret
00000342 <__umulhisi3>:
342: a2 9f mul r26, r18
344: b0 01 movw r22, r0
346: b3 9f mul r27, r19
348: c0 01 movw r24, r0
34a: a3 9f mul r26, r19
34c: 70 0d add r23, r0
34e: 81 1d adc r24, r1
350: 11 24 eor r1, r1
352: 91 1d adc r25, r1
354: b2 9f mul r27, r18
356: 70 0d add r23, r0
358: 81 1d adc r24, r1
35a: 11 24 eor r1, r1
35c: 91 1d adc r25, r1
35e: 08 95 ret
00000360 <_exit>:
360: f8 94 cli
00000362 <__stop_program>:
362: ff cf rjmp .-2 ; 0x362 <__stop_program>
000000c0 <__stop_program>:
c0: ff cf rjmp .-2 ; 0xc0 <__stop_program>
+123 -82
View File
@@ -1,9 +1,13 @@
Archive member included to satisfy reference by file (symbol)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
main.o (__divmodhi4)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o (exit)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_copy_data.o)
main.o (__do_copy_data)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o) (__udivmodhi4)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
main.o (rand)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
@@ -23,9 +27,55 @@ Discarded input sections
.data 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o
.bss 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o
.text 0x00000000 0x0 lcd.o
.data 0x00000000 0x0 lcd.o
.bss 0x00000000 0x0 lcd.o
.text.display_char
0x00000000 0x48 lcd.o
.text.lcd_command
0x00000000 0x40 lcd.o
.text.init 0x00000000 0x90 lcd.o
.text.display_text
0x00000000 0x3c lcd.o
.text.set_cursor
0x00000000 0x8 lcd.o
.text.shift_display
0x00000000 0x52 lcd.o
.debug_info 0x00000000 0x5c9 lcd.o
.debug_abbrev 0x00000000 0x1ac lcd.o
.debug_loc 0x00000000 0x2e1 lcd.o
.debug_aranges
0x00000000 0x48 lcd.o
.debug_ranges 0x00000000 0x38 lcd.o
.debug_line 0x00000000 0x2c5 lcd.o
.debug_str 0x00000000 0x211 lcd.o
.comment 0x00000000 0x31 lcd.o
.debug_frame 0x00000000 0x9c lcd.o
.text 0x00000000 0x0 main.o
.data 0x00000000 0x0 main.o
.bss 0x00000000 0x0 main.o
.rodata.str1.1
0x00000000 0xa main.o
.text.opgave1 0x00000000 0xba main.o
.text.opgave2knop
0x00000000 0x2 main.o
.data.pattern 0x00000000 0x5a main.o
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc.mul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc.div
0x00000000 0x28 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc.prologue
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc.builtins
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc.fmul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text.libgcc.fixed
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodhi4.o)
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
@@ -58,13 +108,35 @@ Discarded input sections
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_copy_data.o)
.text.libgcc.fixed
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_copy_data.o)
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc.mul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc.div
0x00000000 0x28 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc.prologue
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc.builtins
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc.fmul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text.libgcc.fixed
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodhi4.o)
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
.data 0x00000000 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
.text.avr-libc
0x00000000 0xb4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
.comment 0x00000000 0x31 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
.text.libgcc.mul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
.text.libgcc.div
0x00000000 0x2e c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
.text.libgcc.prologue
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
@@ -79,6 +151,8 @@ Discarded input sections
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_negsi2.o)
.text.libgcc.mul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_negsi2.o)
.text.libgcc.div
0x00000000 0x10 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_negsi2.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_negsi2.o)
.text.libgcc.prologue
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_negsi2.o)
@@ -91,6 +165,8 @@ Discarded input sections
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
.text.libgcc.mul
0x00000000 0x16 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
.text.libgcc.div
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
@@ -105,6 +181,8 @@ Discarded input sections
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
.text.libgcc.mul
0x00000000 0x10 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
.text.libgcc.div
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
@@ -121,6 +199,8 @@ Discarded input sections
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodsi4.o)
.text.libgcc.mul
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodsi4.o)
.text.libgcc.div
0x00000000 0x44 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodsi4.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodsi4.o)
.text.libgcc.prologue
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodsi4.o)
@@ -133,6 +213,8 @@ Discarded input sections
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
.text.libgcc.mul
0x00000000 0x1e c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
.text.libgcc.div
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
.text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
@@ -161,6 +243,7 @@ Linker script and memory map
Address of section .data set to 0x800100
LOAD C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o
LOAD lcd.o
LOAD main.o
START GROUP
LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libm.a
@@ -262,7 +345,7 @@ END GROUP
.rela.plt
*(.rela.plt)
.text 0x00000000 0x364
.text 0x00000000 0xc2
*(.vectors)
.vectors 0x00000000 0x8c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/Atmel/ATmega_DFP/1.0.91/gcc/dev/atmega128/avr51/crtatmega128.o
0x00000000 __vector_default
@@ -354,51 +437,13 @@ END GROUP
0x000000b6 __vector_20
0x000000b8 . = ALIGN (0x2)
*(.text.*)
.text.lcd_writeChar
0x000000b8 0x3c main.o
0x000000b8 lcd_writeChar
.text.lcd_command
0x000000f4 0x34 main.o
0x000000f4 lcd_command
.text.lcd_init
0x00000128 0x36 main.o
0x00000128 lcd_init
.text.lcd_writeLine
0x0000015e 0x36 main.o
0x0000015e lcd_writeLine
.text.opgave1 0x00000194 0x66 main.o
0x00000194 opgave1
.text.main 0x000001fa 0x2 main.o
0x000001fa main
.text.avr-libc
0x000001fc 0xaa c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
0x00000288 rand_r
0x0000028a rand
0x00000290 srand
.text.libgcc.div
0x000002a6 0x28 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_divmodsi4.o)
0x000002a6 __divmodsi4
.text.libgcc.div
0x000002ce 0x10 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_negsi2.o)
0x000002ce __negsi2
.text.libgcc.mul
0x000002de 0x14 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_muluhisi3.o)
0x000002de __muluhisi3
.text.libgcc.mul
0x000002f2 0xc c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_mulshisi3.o)
0x000002f2 __mulshisi3
0x000002f6 __mulohisi3
.text.libgcc.div
0x000002fe 0x44 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_udivmodsi4.o)
0x000002fe __udivmodsi4
.text.libgcc.mul
0x00000342 0x1e c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_umulhisi3.o)
0x00000342 __umulhisi3
0x00000360 . = ALIGN (0x2)
.text.main 0x000000b8 0x6 main.o
0x000000b8 main
0x000000be . = ALIGN (0x2)
*(.fini9)
.fini9 0x00000360 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
0x00000360 _exit
0x00000360 exit
.fini9 0x000000be 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
0x000000be _exit
0x000000be exit
*(.fini9)
*(.fini8)
*(.fini8)
@@ -417,39 +462,36 @@ END GROUP
*(.fini1)
*(.fini1)
*(.fini0)
.fini0 0x00000360 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
.fini0 0x000000be 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/avr51\libgcc.a(_exit.o)
*(.fini0)
0x00000364 _etext = .
0x000000c2 _etext = .
.data 0x00800100 0x54 load address 0x00000364
.data 0x00800100 0x0 load address 0x000000c2
0x00800100 PROVIDE (__data_start, .)
*(.data)
.data 0x00800100 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
*(.data*)
.data.pattern 0x00800104 0x50 main.o
0x00800104 pattern
*(.rodata)
*(.rodata*)
*(.gnu.linkonce.d*)
0x00800154 . = ALIGN (0x2)
0x00800154 _edata = .
0x00800154 PROVIDE (__data_end, .)
0x00800100 . = ALIGN (0x2)
0x00800100 _edata = .
0x00800100 PROVIDE (__data_end, .)
.bss 0x00800154 0x0
0x00800154 PROVIDE (__bss_start, .)
.bss 0x00800100 0x0
0x00800100 PROVIDE (__bss_start, .)
*(.bss)
*(.bss*)
*(COMMON)
0x00800154 PROVIDE (__bss_end, .)
0x00000364 __data_load_start = LOADADDR (.data)
0x000003b8 __data_load_end = (__data_load_start + SIZEOF (.data))
0x00800100 PROVIDE (__bss_end, .)
0x000000c2 __data_load_start = LOADADDR (.data)
0x000000c2 __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x00800154 0x0
0x00800154 PROVIDE (__noinit_start, .)
.noinit 0x00800100 0x0
0x00800100 PROVIDE (__noinit_start, .)
*(.noinit*)
0x00800154 PROVIDE (__noinit_end, .)
0x00800154 _end = .
0x00800154 PROVIDE (__heap_start, .)
0x00800100 PROVIDE (__noinit_end, .)
0x00800100 _end = .
0x00800100 PROVIDE (__heap_start, .)
.eeprom 0x00810000 0x0
*(.eeprom*)
@@ -492,7 +534,6 @@ END GROUP
*(.comment)
.comment 0x00000000 0x30 main.o
0x31 (size before relaxing)
.comment 0x00000030 0x31 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr51\libc.a(rand.o)
.note.gnu.avr.deviceinfo
0x00000000 0x3c
@@ -514,38 +555,38 @@ END GROUP
.debug_sfnames
*(.debug_sfnames)
.debug_aranges 0x00000000 0x48
.debug_aranges 0x00000000 0x30
*(.debug_aranges)
.debug_aranges
0x00000000 0x48 main.o
0x00000000 0x30 main.o
.debug_pubnames
*(.debug_pubnames)
.debug_info 0x00000000 0x573
.debug_info 0x00000000 0x40a
*(.debug_info .gnu.linkonce.wi.*)
.debug_info 0x00000000 0x573 main.o
.debug_info 0x00000000 0x40a main.o
.debug_abbrev 0x00000000 0x23d
.debug_abbrev 0x00000000 0x1fd
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x23d main.o
.debug_abbrev 0x00000000 0x1fd main.o
.debug_line 0x00000000 0x287
.debug_line 0x00000000 0x1de
*(.debug_line .debug_line.* .debug_line_end)
.debug_line 0x00000000 0x287 main.o
.debug_line 0x00000000 0x1de main.o
.debug_frame 0x00000000 0x80
.debug_frame 0x00000000 0x44
*(.debug_frame)
.debug_frame 0x00000000 0x80 main.o
.debug_frame 0x00000000 0x44 main.o
.debug_str 0x00000000 0x1eb
.debug_str 0x00000000 0x1f2
*(.debug_str)
.debug_str 0x00000000 0x1eb main.o
0x229 (size before relaxing)
.debug_str 0x00000000 0x1f2 main.o
0x230 (size before relaxing)
.debug_loc 0x00000000 0x1b5
.debug_loc 0x00000000 0x27
*(.debug_loc)
.debug_loc 0x00000000 0x1b5 main.o
.debug_loc 0x00000000 0x27 main.o
.debug_macinfo
*(.debug_macinfo)
@@ -565,9 +606,9 @@ END GROUP
.debug_pubtypes
*(.debug_pubtypes)
.debug_ranges 0x00000000 0x38
.debug_ranges 0x00000000 0x20
*(.debug_ranges)
.debug_ranges 0x00000000 0x38 main.o
.debug_ranges 0x00000000 0x20 main.o
.debug_macro
*(.debug_macro)
+4 -52
View File
@@ -8,56 +8,8 @@ S113005032C0000030C000002EC000002CC00000E0
S11300602AC0000028C0000026C0000024C00000F0
S113007022C0000020C000001EC000001CC0000000
S11300801AC0000018C0000016C0000011241FBED2
S1130090CFEFD0E1DEBFCDBF11E0A0E0B1E0E4E6F8
S11300A0F3E000E00BBF02C007900D92A435B10746
S11300B0D9F7A3D055C1A4CF982F907F95BB95B302
S11300C09C6095BBEFECF7E03197F1F700C00000BE
S11300D094E095BBF0E18F9FC001112485BB85B3EB
S11300E08C6085BB8FEC97E00197F1F700C00000AE
S11300F015BA0895982F907F95BBAB9AEFECF7E073
S11301003197F1F700C0000094E095BBF0E18F9FB8
S1130110C001112485BBAB9A8FEC97E00197F1F7EE
S113012000C0000015BA08958FEF84BB2FEF80E75D
S113013092E0215080409040E1F700C0000082E04E
S113014090E0D8DF88E290E0D5DF8CE090E0D2DF69
S113015086E090E0CFDF80E890E0CCCF0895CF93A5
S1130160DF93EB01892B19F080ECC4DF02C080E837
S1130170C1DF8881882359F021969EDF8FEC97E0B8
S11301800197F1F700C0000089918111F6CFDF914A
S1130190CF910895C9DF87EB9AE47AD076D087703F
S11301A09078992324F40197886F9F6F0196BC017E
S11301B0660F771F880F991F880F991F880F991F43
S11301C0680F791F6C5F7E4F80E090E0C8DF2FEFEF
S11301D089E698E1215080409040E1F700C000009A
S11301E081E090E087DF2FEF80E792E021508040AC
S11301F09040E1F700C00000D1CFCCDF8F929F92F6
S1130200AF92BF92CF92DF92EF92FF92CF93DF93A0
S1130210EC01688179818A819B8161157105810571
S1130220910521F464E279ED8BE597E02DE133EF5C
S113023041E050E038D049015A019B01AC01A7EAE2
S1130240B1E44DD06B017C01ACEEB4EFA501940197
S113025052D0DC01CB018C0D9D1DAE1DBF1DB7FF1F
S113026003C00197A109B04888839983AA83BB83FB
S11302709F77DF91CF91FF90EF90DF90CF90BF9069
S1130280AF909F908F900895B9CF80E091E0B6CF62
S1130290A0E0B0E08093000190930101A0930201DB
S11302A0B09303010895052E97FB16F400940FD024
S11302B057FD05D024D007FC02D046F408C0509561
S11302C04095309521953F4F4F4F5F4F089590953E
S11302D08095709561957F4F8F4F9F4F089531D0D2
S11302E0A59F900DB49F900DA49F800D911D112486
S11302F00895B7FFF4CFF3DF821B930B0895A1E2B7
S11303001A2EAA1BBB1BFD010DC0AA1FBB1FEE1F8B
S1130310FF1FA217B307E407F50720F0A21BB30BD6
S1130320E40BF50B661F771F881F991F1A9469F752
S113033060957095809590959B01AC01BD01CF01AE
S11303400895A29FB001B39FC001A39F700D811DAA
S11303501124911DB29F700D811D1124911D0895CA
S1070360F894FFCF3B
S1130364010000004B656E6E6574680000004A610C
S11303746E636F00000000004172746875720000BF
S113038400004D617274696A6E0000004D617572FB
S11303946F000000000052656E650000000000005C
S11303A452656D636F00000000004A616E6E6963FC
S10703B46B000000D6
S1130090CFEFD0E1DEBFCDBF11E0A0E0B1E0E2ECF4
S11300A0F0E000E00BBF02C007900D92A030B10752
S11300B0D9F702D004C0A4CF81E090E00895F89469
S10500C0FFCF6C
S9030000FC
+7
View File
@@ -37,6 +37,7 @@ SUBDIRS :=
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../lcd.c \
../main.c
@@ -47,15 +48,19 @@ ASM_SRCS +=
OBJS += \
lcd.o \
main.o
OBJS_AS_ARGS += \
lcd.o \
main.o
C_DEPS += \
lcd.d \
main.d
C_DEPS_AS_ARGS += \
lcd.d \
main.d
OUTPUT_FILE_PATH +=MIC-Week3.elf
@@ -75,6 +80,8 @@ LINKER_SCRIPT_DEP+=
./%.o: .././%.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 4.9.2
+52
View File
@@ -0,0 +1,52 @@
lcd.d lcd.o: .././lcd.c \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdint.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h \
C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include/avr/iom128.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdlib.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h \
.././lcd.h
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stdint.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h:
C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.0.91\include/avr/iom128.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdlib.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h:
.././lcd.h:
+4 -1
View File
@@ -14,7 +14,8 @@ main.d main.o: .././main.c \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdlib.h \
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h \
.././lcd.h
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:
@@ -47,3 +48,5 @@ c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdlib.h:
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\4.9.2\include\stddef.h:
.././lcd.h:
+2
View File
@@ -2,5 +2,7 @@
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd.c
main.c
+6
View File
@@ -110,6 +110,12 @@
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="lcd.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="lcd.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>
+118
View File
@@ -0,0 +1,118 @@
/*
* lcd.c
*
* Created: 23-2-2016 14:06:31
* Author: kenny
*/
#define F_CPU 8000000UL //CPU op 8MHz
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#include "lcd.h"
//LOCAL
void display_char(unsigned char dat);
void lcd_command(unsigned char dat);
void init()
{
DDRC = 0b11111111;
_delay_ms(100);
// return home
lcd_command( 0x02 );
// mode: 4 bits interface data, 2 lines, 5x8 dots
_delay_ms(50);
lcd_command( 0x28 );
// display: on, cursor off, blinking off
_delay_ms(50);
lcd_command( 0x0C );
// entry mode: cursor to right, no shift
_delay_ms(50);
lcd_command( 0x06 );
// RAM address: 0, first position, line 1
_delay_ms(50);
lcd_command( 0x80 );
_delay_ms(100);
}
void display_text( int line, char *text )
{
// eerst de eerste 8 karakters = regel 1
if(line)
{
// eerste pos regel 1
lcd_command(0xC0);
}
else
{
// regel 0
lcd_command(0x80);
}
int count = 0;
while (text[count] != '\0') {
display_char( text[count] );
count++;
_delay_ms(1);
}
}
void set_cursor(int position)
{
position = position | (1<<7);
lcd_command(position);
}
void shift_display(int left, int count)
{
unsigned char data = left ? 0b00011100 : 0b00011000;
for (int i=0; i<count; i++) {
lcd_command(data);
_delay_ms(1);
}
}
void display_char( unsigned char dat )
{
PORTC = dat & 0xF0; // hoge nibble
PORTC = PORTC | 0x0C; // Enable on (EN = 1, RS=1),
_delay_ms(1); // wait 1 ms
PORTC = 0x04; // Enable off (EN = 0, RS = 1)
_delay_ms(1); // wait 1 ms
PORTC = (dat & 0x0F) << 4; // lage nibble
PORTC = PORTC | 0x0C; // Enable on (RS=1),
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x00; // stop
// (EN=0 RS=0)
}
void lcd_command ( unsigned char dat )
{
PORTC = dat & 0xF0; // hoge nibble
PORTC = PORTC | 0x08; // data (RS=0),
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x04; // stop (EN = 0)
_delay_ms(1); // wait 1 ms
PORTC = (dat & 0x0F) << 4; // lage nibble
PORTC = PORTC | 0x08; // data (RS=0),
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x00; // stop
// (EN=0 RS=0)
}
+18
View File
@@ -0,0 +1,18 @@
/*
* lcd.h
*
* Created: 23-2-2016 14:06:44
* Author: kenny
*/
#ifndef LCD_H_
#define LCD_H_
void init();
void display_text(int line, char *str);
void display_char(unsigned char d);
void set_cursor(int position);
void shift_display(int left, int count);
#endif /* LCD_H_ */
+24 -77
View File
@@ -4,12 +4,14 @@
* Created: 23-2-2016 10:18:35
* Author : kenny
*/
#define F_CPU 8000000UL //CPU op 8MHz
#define F_CPU 8000000UL //CPU op 8MHz
#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#include "lcd.h"
typedef struct {
unsigned char data[10];
} PATTERN_STRUCT;
@@ -25,29 +27,42 @@ typedef struct {
//Array van patronen die elkaar opvolgen.
PATTERN_STRUCT pattern[] = {
{"Kenneth"}, {"Janco"}, {"Arthur"}, {"Martijn"}, {"Mauro"}, {"Rene"}, {"Remco"}, {"Jannick"}
{"Kenneth"}, {"Janco"}, {"Arthur"}, {"Martijn"}, {"Mauro"}, {"Rene"}, {"Remco"}, {"Jannick"}, {"Tim"}
};
int main(void)
{
opgave1();
//opgave1();
opgave2knop();
return 1;
}
void opgave1()
{
lcd_init();
init();
srand(98126519);
srand(14152);
int r = 8;
int r = 0;
while(1){
r = rand() % 8;
r = rand() % 9;
display_text(1, ":-) ~ (-:");
display_text(0, pattern[r].data);
_delay_ms(1000);
set_cursor(15);
display_char(0b01000001);
_delay_ms(1000);
shift_display(1, 3);
lcd_writeLine(0, pattern[r].data);
_delay_ms(1000);
//clear
@@ -56,75 +71,7 @@ void opgave1()
}
}
void lcd_init()
void opgave2knop()
{
DDRC = 0b11111111;
_delay_ms(100);
// return home
lcd_command( 0x02 );
// mode: 4 bits interface data, 2 lines, 5x8 dots
lcd_command( 0x28 );
// display: on, cursor off, blinking off
lcd_command( 0x0C );
// entry mode: cursor to right, no shift
lcd_command( 0x06 );
// RAM address: 0, first position, line 1
lcd_command( 0x80 );
}
void lcd_writeChar( unsigned char dat )
{
PORTC = dat & 0xF0; // hoge nibble
PORTC = PORTC | 0x0C; // Enable on (EN = 1, RS=1),
_delay_ms(1); // wait 1 ms
PORTC = 0x04; // Enable off (EN = 0, RS = 1)
PORTC = (dat & 0x0F) << 4; // lage nibble
PORTC = PORTC | 0x0C; // Enable on (RS=1),
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x00; // stop
// (EN=0 RS=0)
}
void lcd_command ( unsigned char dat )
{
PORTC = dat & 0xF0; // hoge nibble
PORTC = PORTC | 0x08; // data (RS=0),
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x04; // stop (EN = 0)
PORTC = (dat & 0x0F) << 4; // lage nibble
PORTC = PORTC | 0x08; // data (RS=0),
// start (EN=1)
_delay_ms(1); // wait 1 ms
PORTC = 0x00; // stop
// (EN=0 RS=0)
}
void lcd_writeLine ( int line, char text[] )
{
// eerst de eerste 8 karakters = regel 1
if(line)
{
// eerste pos regel 1
lcd_command(0xC0);
}
else
{
// regel 0
lcd_command(0x80);
}
int count = 0;
while (text[count] != '\0') {
lcd_writeChar( text[count] );
count++;
_delay_ms(1);
}
}