1 .file "led_flash4.c" 2 __SREG__ = 0x3f 3 __SP_H__ = 0x3e 4 __SP_L__ = 0x3d 5 __tmp_reg__ = 0 6 __zero_reg__ = 1 7 .global __do_copy_data 8 .global __do_clear_bss 10 .text 11 .Ltext0: 75 .global main 77 main: 1:led_flash4.c **** #include "oulib.h" 2:led_flash4.c **** // Bion board example 3:led_flash4.c **** // Turn on LED when button is pressed 4:led_flash4.c **** 5:led_flash4.c **** // One change from our discussion in class: 6:led_flash4.c **** // When the button is pressed, the pin reads a 0 7:led_flash4.c **** // 8:led_flash4.c **** // Circuit information: 9:led_flash4.c **** // Button connected to PORT D, pin 3 10:led_flash4.c **** // -- When open, the pin is at +5 V 11:led_flash4.c **** // -- When closed, the pin is at 0 V 12:led_flash4.c **** // 13:led_flash4.c **** // LED connected to PORT C, pin 5 14:led_flash4.c **** // 15:led_flash4.c **** 16:led_flash4.c **** 17:led_flash4.c **** 18:led_flash4.c **** int main (void) 19:led_flash4.c **** { 79 .LM0: 80 .LFBB1: 81 /* prologue: frame size=0 */ 82 0000 C0E0 ldi r28,lo8(__stack - 0) 83 0002 D0E0 ldi r29,hi8(__stack - 0) 84 0004 DEBF out __SP_H__,r29 85 0006 CDBF out __SP_L__,r28 86 /* prologue end (size=4) */ 20:led_flash4.c **** 21:led_flash4.c **** DDRC = 0xFF; 88 .LM1: 89 0008 8FEF ldi r24,lo8(-1) 90 000a 84BB out 52-0x20,r24 22:led_flash4.c **** DDRD = 0x0; 92 .LM2: 93 000c 11BA out 49-0x20,__zero_reg__ 94 .L9: 23:led_flash4.c **** 24:led_flash4.c **** while(1) { 25:led_flash4.c **** if(!(PIND & 0x8)) // Does PIN 3 of PORT D read low right now? 96 .LM3: 97 000e 8399 sbic 48-0x20,3 98 0010 00C0 rjmp .L3 26:led_flash4.c **** { 27:led_flash4.c **** // The button is pressed 28:led_flash4.c **** PORTC = PORTC | 0x20; 100 .LM4: 101 0012 AD9A sbi 53-0x20,5 102 0014 00C0 rjmp .L9 103 .L3: 29:led_flash4.c **** // PORTC |= 0x20; // Equivalent to above line 30:led_flash4.c **** } 31:led_flash4.c **** else 32:led_flash4.c **** { 33:led_flash4.c **** // Button is not pressed 34:led_flash4.c **** PORTC &= ~0x20; 105 .LM5: 106 0016 AD98 cbi 53-0x20,5 107 0018 00C0 rjmp .L9 108 /* epilogue: frame size=0 */ 109 /* epilogue: noreturn */ 110 /* epilogue end (size=0) */ 111 /* function main size 13 (9) */ 113 .Lscope1: 115 .Letext0: 116 /* File "led_flash4.c": code 13 = 0x000d ( 9), prologues 4, epilogues 0 */ DEFINED SYMBOLS *ABS*:0000000000000000 led_flash4.c /tmp/ccXGmZYh.s:2 *ABS*:000000000000003f __SREG__ /tmp/ccXGmZYh.s:3 *ABS*:000000000000003e __SP_H__ /tmp/ccXGmZYh.s:4 *ABS*:000000000000003d __SP_L__ /tmp/ccXGmZYh.s:5 *ABS*:0000000000000000 __tmp_reg__ /tmp/ccXGmZYh.s:6 *ABS*:0000000000000001 __zero_reg__ /tmp/ccXGmZYh.s:77 .text:0000000000000000 main UNDEFINED SYMBOLS __do_copy_data __do_clear_bss __stack