firmware.elf: file format elf32-msp430 Disassembly of section .text: 0000c000 <__watchdog_support>: c000: 55 42 20 01 mov.b &0x0120,r5 c004: 35 d0 08 5a bis #23048, r5 ;#0x5a08 c008: 82 45 02 02 mov r5, &0x0202 0000c00c <__init_stack>: c00c: 31 40 00 04 mov #1024, r1 ;#0x0400 0000c010 <__do_copy_data>: c010: 3f 40 00 00 mov #0, r15 ;#0x0000 c014: 0f 93 tst r15 c016: 08 24 jz $+18 ;abs 0xc028 c018: 92 42 02 02 mov &0x0202,&0x0120 c01c: 20 01 c01e: 2f 83 decd r15 c020: 9f 4f 45 c1 mov -16059(r15),512(r15);0xc145(r15), 0x0200(r15) c024: 00 02 c026: f8 23 jnz $-14 ;abs 0xc018 0000c028 <__do_clear_bss>: c028: 3f 40 02 00 mov #2, r15 ;#0x0002 c02c: 0f 93 tst r15 c02e: 07 24 jz $+16 ;abs 0xc03e c030: 92 42 02 02 mov &0x0202,&0x0120 c034: 20 01 c036: 1f 83 dec r15 c038: cf 43 00 02 mov.b #0, 512(r15);r3 As==00, 0x0200(r15) c03c: f9 23 jnz $-12 ;abs 0xc030 0000c03e
: P1OUT ^= BIT0; // toggle P1.0 (red led) } int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT c03e: b2 40 80 5a mov #23168, &0x0120 ;#0x5a80 c042: 20 01 BCSCTL1 = CALBC1_1MHZ; // Set DCO c044: d2 42 ff 10 mov.b &0x10ff,&0x0057 c048: 57 00 DCOCTL = CALDCO_1MHZ; c04a: d2 42 fe 10 mov.b &0x10fe,&0x0056 c04e: 56 00 P1DIR = BIT0 + BIT6; // P1.0 and P1.6 are the red+green LEDs c050: f2 40 41 00 mov.b #65, &0x0022 ;#0x0041 c054: 22 00 P1OUT = BIT0 + BIT6; // All LEDs off c056: f2 40 41 00 mov.b #65, &0x0021 ;#0x0041 c05a: 21 00 uart_init(); c05c: b0 12 92 c0 call #0xc092 // register ISR called when data was received uart_set_rx_isr_ptr(uart_rx_isr); c060: 3f 40 88 c0 mov #-16248,r15 ;#0xc088 c064: b0 12 c2 c0 call #0xc0c2 __bis_SR_register(GIE); c068: 32 d2 eint uart_puts((char *)"MSP430 harduart\n\r"); c06a: 3f 40 1c c1 mov #-16100,r15 ;#0xc11c c06e: b0 12 e4 c0 call #0xc0e4 uart_puts((char *)"Waiting for a tag ... "); c072: 3f 40 2e c1 mov #-16082,r15 ;#0xc12e c076: b0 12 e4 c0 call #0xc0e4 unsigned char c = uart_getc(); c07a: b0 12 c8 c0 call #0xc0c8 0000c07e <__stop_progExec__>: c07e: 32 d0 f0 00 bis #240, r2 ;#0x00f0 c082: fd 3f jmp $-4 ;abs 0xc07e 0000c084 <__ctors_end>: c084: 30 40 1a c1 br #0xc11a 0000c088 : #include #include "uart.h" void uart_rx_isr(unsigned char c) { uart_putc(c); c088: b0 12 d6 c0 call #0xc0d6 P1OUT ^= BIT0; // toggle P1.0 (red led) c08c: d2 e3 21 00 xor.b #1, &0x0021 ;r3 As==01 } c090: 30 41 ret 0000c092 : IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt } void uart_set_rx_isr_ptr(void (*isr_ptr)(unsigned char c)) { uart_rx_isr_ptr = isr_ptr; c092: 82 43 00 02 mov #0, &0x0200 ;r3 As==00 void uart_init(void) { uart_set_rx_isr_ptr(0L); P1SEL = RXD + TXD; c096: f2 40 06 00 mov.b #6, &0x0026 ;#0x0006 c09a: 26 00 P1SEL2 = RXD + TXD; c09c: f2 40 06 00 mov.b #6, &0x0041 ;#0x0006 c0a0: 41 00 UCA0CTL1 |= UCSSEL_2; // SMCLK c0a2: f2 d0 80 ff bis.b #-128, &0x0061 ;#0xff80 c0a6: 61 00 UCA0BR0 = 104; // 1MHz 9600 c0a8: f2 40 68 00 mov.b #104, &0x0062 ;#0x0068 c0ac: 62 00 UCA0BR1 = 0; // 1MHz 9600 c0ae: c2 43 63 00 mov.b #0, &0x0063 ;r3 As==00 UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1 c0b2: e2 43 64 00 mov.b #2, &0x0064 ;r3 As==10 UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine c0b6: f2 f0 fe ff and.b #-2, &0x0061 ;#0xfffe c0ba: 61 00 IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt c0bc: d2 d3 01 00 bis.b #1, &0x0001 ;r3 As==01 } c0c0: 30 41 ret 0000c0c2 : void uart_set_rx_isr_ptr(void (*isr_ptr)(unsigned char c)) { uart_rx_isr_ptr = isr_ptr; c0c2: 82 4f 00 02 mov r15, &0x0200 } c0c6: 30 41 ret 0000c0c8 : unsigned char uart_getc() { while (!(IFG2&UCA0RXIFG)); // USCI_A0 RX buffer ready? c0c8: 5f 42 03 00 mov.b &0x0003,r15 c0cc: 1f f3 and #1, r15 ;r3 As==01 c0ce: fc 27 jz $-6 ;abs 0xc0c8 return UCA0RXBUF; c0d0: 5f 42 66 00 mov.b &0x0066,r15 } c0d4: 30 41 ret 0000c0d6 : void uart_putc(unsigned char c) { while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready? c0d6: 5e 42 03 00 mov.b &0x0003,r14 c0da: 2e f3 and #2, r14 ;r3 As==10 c0dc: fc 27 jz $-6 ;abs 0xc0d6 UCA0TXBUF = c; // TX c0de: c2 4f 67 00 mov.b r15, &0x0067 } c0e2: 30 41 ret 0000c0e4 : void uart_puts(const char *str) { c0e4: 0b 12 push r11 c0e6: 0b 4f mov r15, r11 while(*str) uart_putc(*str++); c0e8: 03 3c jmp $+8 ;abs 0xc0f0 c0ea: 1b 53 inc r11 c0ec: b0 12 d6 c0 call #0xc0d6 c0f0: 6f 4b mov.b @r11, r15 c0f2: 4f 93 tst.b r15 c0f4: fa 23 jnz $-10 ;abs 0xc0ea } c0f6: 3b 41 pop r11 c0f8: 30 41 ret 0000c0fa : interrupt(USCIAB0RX_VECTOR) USCI0RX_ISR(void) { c0fa: 0f 12 push r15 c0fc: 0e 12 push r14 c0fe: 0d 12 push r13 c100: 0c 12 push r12 if(uart_rx_isr_ptr != 0L) { c102: 1e 42 00 02 mov &0x0200,r14 c106: 0e 93 tst r14 c108: 03 24 jz $+8 ;abs 0xc110 (uart_rx_isr_ptr)(UCA0RXBUF); c10a: 5f 42 66 00 mov.b &0x0066,r15 c10e: 8e 12 call r14 } } c110: 3c 41 pop r12 c112: 3d 41 pop r13 c114: 3e 41 pop r14 c116: 3f 41 pop r15 c118: 00 13 reti 0000c11a <_unexpected_>: c11a: 00 13 reti Disassembly of section .vectors: 0000ffe0 <__ivtbl_16>: ffe0: 84 c0 84 c0 84 c0 84 c0 84 c0 84 c0 84 c0 fa c0 ................ fff0: 84 c0 84 c0 84 c0 84 c0 84 c0 84 c0 84 c0 00 c0 ................