Quantcast
Channel: Objective Development Forums
Viewing all articles
Browse latest Browse all 4524

Re: static uchar usbIsReset; /* = 0; USB bus is in reset p

$
0
0
The AVR-LIBC erases the the bss section before entering main. You can actually see it when disassembling:

This is just an arbitrary example:

>avr-objdump -d -S main.bin >main.lss

000017fa <__do_clear_bss>:
    17fa:   20 e0          ldi   r18, 0x00   ; 0
    17fc:   a0 e6          ldi   r26, 0x60   ; 96
    17fe:   b0 e0          ldi   r27, 0x00   ; 0
    1800:   01 c0          rjmp   .+2         ; 0x1804 <.do_clear_bss_start>

00001802 <.do_clear_bss_loop>:
    1802:   1d 92          st   X+, r1

00001804 <.do_clear_bss_start>:
    1804:   ac 38          cpi   r26, 0x8C   ; 140
    1806:   b2 07          cpc   r27, r18
    1808:   e1 f7          brne   .-8         ; 0x1802 <.do_clear_bss_loop>

Viewing all articles
Browse latest Browse all 4524

Trending Articles