-
-
Save ciniml/60ee3e0fdfde4356d547e1e4b7a3a21b to your computer and use it in GitHub Desktop.
#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; | |
} | |
} | |
Output for tiny10:
00000028
#include <avr/io.h>
#include <stdint.h>
int main(void)
{
28: cf 93 push r28
2a: df 93 push r29
2c: 00 d0 rcall .+0 ; 0x2e <main+0x6>
2e: 00 d0 rcall .+0 ; 0x30 <main+0x8>
30: cd b7 in r28, 0x3d ; 61
32: de b7 in r29, 0x3e ; 62
/* Replace with your application code /
while (1)
{
const volatile uint8_t a = 10;
34: ea e0 ldi r30, 0x0A ; 10
const volatile uint8_t b = 20;
36: 44 e1 ldi r20, 0x14 ; 20
int main(void)
{
/ Replace with your application code */
while (1)
{
const volatile uint8_t a = 10;
38: cc 5f subi r28, 0xFC ; 252
3a: df 4f sbci r29, 0xFF ; 255
3c: e8 83 st Y, r30
3e: c4 50 subi r28, 0x04 ; 4
40: d0 40 sbci r29, 0x00 ; 0
const volatile uint8_t b = 20;
42: cd 5f subi r28, 0xFD ; 253
44: df 4f sbci r29, 0xFF ; 255
46: 48 83 st Y, r20
48: c3 50 subi r28, 0x03 ; 3
4a: d0 40 sbci r29, 0x00 ; 0
volatile uint16_t result = a * b;
4c: cc 5f subi r28, 0xFC ; 252
4e: df 4f sbci r29, 0xFF ; 255
50: 88 81 ld r24, Y
52: c4 50 subi r28, 0x04 ; 4
54: d0 40 sbci r29, 0x00 ; 0
56: cd 5f subi r28, 0xFD ; 253
58: df 4f sbci r29, 0xFF ; 255
5a: 68 81 ld r22, Y
5c: c3 50 subi r28, 0x03 ; 3
5e: d0 40 sbci r29, 0x00 ; 0
60: 90 e0 ldi r25, 0x00 ; 0
62: 70 e0 ldi r23, 0x00 ; 0
64: 07 d0 rcall .+14 ; 0x74 <__mulhi3>
66: ce 5f subi r28, 0xFE ; 254
68: df 4f sbci r29, 0xFF ; 255
6a: 98 83 st Y, r25
6c: 8a 93 st -Y, r24
6e: c1 50 subi r28, 0x01 ; 1
70: d0 40 sbci r29, 0x00 ; 0
}
72: e2 cf rjmp .-60 ; 0x38 <main+0x10>
00000074 <__mulhi3>:
74: 00 27 eor r16, r16
76: 55 27 eor r21, r21
78: 04 c0 rjmp .+8 ; 0x82 <__mulhi3+0xe>
7a: 08 0f add r16, r24
7c: 59 1f adc r21, r25
7e: 88 0f add r24, r24
80: 99 1f adc r25, r25
82: 80 50 subi r24, 0x00 ; 0
84: 90 40 sbci r25, 0x00 ; 0
86: 29 f0 breq .+10 ; 0x92 <__mulhi3+0x1e>
88: 76 95 lsr r23
8a: 67 95 ror r22
8c: b0 f3 brcs .-20 ; 0x7a <__mulhi3+0x6>
8e: 71 07 cpc r23, r17
90: b1 f7 brne .-20 ; 0x7e <__mulhi3+0xa>
92: 80 2f mov r24, r16
94: 95 2f mov r25, r21
96: 08 95 ret
00000098 <_exit>:
98: f8 94 cli
0000009a <__stop_program>:
9a: ff cf rjmp .-2 ; 0x9a <__stop_program>
Output for tiny817:
0000004c
#include <avr/io.h>
#include <stdint.h>
int main(void)
{
4c: cf 93 push r28
4e: df 93 push r29
50: 00 d0 rcall .+0 ; 0x52 <main+0x6>
52: 00 d0 rcall .+0 ; 0x54 <main+0x8>
54: cd b7 in r28, 0x3d ; 61
56: de b7 in r29, 0x3e ; 62
/* Replace with your application code /
while (1)
{
const volatile uint8_t a = 10;
58: 3a e0 ldi r19, 0x0A ; 10
const volatile uint8_t b = 20;
5a: 24 e1 ldi r18, 0x14 ; 20
int main(void)
{
/ Replace with your application code */
while (1)
{
const volatile uint8_t a = 10;
5c: 3c 83 std Y+4, r19 ; 0x04
const volatile uint8_t b = 20;
5e: 2b 83 std Y+3, r18 ; 0x03
volatile uint16_t result = a * b;
60: 8c 81 ldd r24, Y+4 ; 0x04
62: 9b 81 ldd r25, Y+3 ; 0x03
64: 89 9f mul r24, r25
66: c0 01 movw r24, r0
68: 11 24 eor r1, r1
6a: 89 83 std Y+1, r24 ; 0x01
6c: 9a 83 std Y+2, r25 ; 0x02
}
6e: f6 cf rjmp .-20 ; 0x5c <main+0x10>
00000070 <_exit>:
70: f8 94 cli
00000072 <__stop_program>:
72: ff cf rjmp .-2 ; 0x72 <__stop_program>
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>
Output for tiny861A:
int main(void)
{
/* Replace with your application code */
while (1)
{
const volatile uint8_t a = 10;
48: 3c 83 std Y+4, r19 ; 0x04
const volatile uint8_t b = 20;
4a: 2b 83 std Y+3, r18 ; 0x03
volatile uint16_t result = a * b;
4c: 8c 81 ldd r24, Y+4 ; 0x04
4e: 6b 81 ldd r22, Y+3 ; 0x03
50: 70 e0 ldi r23, 0x00 ; 0
52: 90 e0 ldi r25, 0x00 ; 0
54: 03 d0 rcall .+6 ; 0x5c <__mulhi3>
56: 9a 83 std Y+2, r25 ; 0x02
58: 89 83 std Y+1, r24 ; 0x01
}
5a: f6 cf rjmp .-20 ; 0x48 <SREG+0x9>
0000005c <__mulhi3>:
5c: 00 24 eor r0, r0
5e: 55 27 eor r21, r21
60: 04 c0 rjmp .+8 ; 0x6a <__mulhi3+0xe>
62: 08 0e add r0, r24
64: 59 1f adc r21, r25
66: 88 0f add r24, r24
68: 99 1f adc r25, r25
6a: 00 97 sbiw r24, 0x00 ; 0
6c: 29 f0 breq .+10 ; 0x78 <__mulhi3+0x1c>
6e: 76 95 lsr r23
70: 67 95 ror r22
72: b8 f3 brcs .-18 ; 0x62 <__mulhi3+0x6>
74: 71 05 cpc r23, r1
76: b9 f7 brne .-18 ; 0x66 <__mulhi3+0xa>
78: 80 2d mov r24, r0
7a: 95 2f mov r25, r21
7c: 08 95 ret
0000007e <_exit>:
7e: f8 94 cli
00000080 <__stop_program>:
80: ff cf rjmp .-2 ; 0x80 <__stop_program>