Created
November 8, 2016 18:01
-
-
Save ciniml/60ee3e0fdfde4356d547e1e4b7a3a21b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <stdint.h> | |
int main(void) | |
{ | |
/* Replace with your application code */ | |
while (1) | |
{ | |
const volatile uint8_t a = 10; | |
const volatile uint8_t b = 20; | |
volatile uint16_t result = a * b; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output for mega328:
:000000cc
#include <avr/io.h>
#include <stdint.h>
int main(void)
{
cc: cf 93 push r28
ce: df 93 push r29
d0: 00 d0 rcall .+0 ; 0xd2 <main+0x6>
d2: 00 d0 rcall .+0 ; 0xd4 <main+0x8>
d4: cd b7 in r28, 0x3d ; 61
d6: de b7 in r29, 0x3e ; 62
/* Replace with your application code /
while (1)
{
const volatile uint8_t a = 10;
d8: 3a e0 ldi r19, 0x0A ; 10
const volatile uint8_t b = 20;
da: 24 e1 ldi r18, 0x14 ; 20
int main(void)
{
/ Replace with your application code */
while (1)
{
const volatile uint8_t a = 10;
dc: 3c 83 std Y+4, r19 ; 0x04
const volatile uint8_t b = 20;
de: 2b 83 std Y+3, r18 ; 0x03
volatile uint16_t result = a * b;
e0: 8c 81 ldd r24, Y+4 ; 0x04
e2: 9b 81 ldd r25, Y+3 ; 0x03
e4: 89 9f mul r24, r25
e6: c0 01 movw r24, r0
e8: 11 24 eor r1, r1
ea: 9a 83 std Y+2, r25 ; 0x02
ec: 89 83 std Y+1, r24 ; 0x01
}
ee: f6 cf rjmp .-20 ; 0xdc <main+0x10>
000000f0 <_exit>:
f0: f8 94 cli
000000f2 <__stop_program>:
f2: ff cf rjmp .-2 ; 0xf2 <__stop_program>