Skip to content

Instantly share code, notes, and snippets.

@formicant
Created March 23, 2023 08:07
Show Gist options
  • Select an option

  • Save formicant/c60c47feb6d14223b37a3b9f897c33ce to your computer and use it in GitHub Desktop.

Select an option

Save formicant/c60c47feb6d14223b37a3b9f897c33ce to your computer and use it in GitHub Desktop.
AVR-GCC test with no optimizations
Disassembly of section .text:
00000000 <cast_to_uint16>:
0: cf 93 push r28
2: df 93 push r29
4: 0f 92 push r0
6: cd b7 in r28, 0x3d ; 61
8: de b7 in r29, 0x3e ; 62
a: 89 83 std Y+1, r24 ; 0x01
c: 89 81 ldd r24, Y+1 ; 0x01
e: 88 2f mov r24, r24
10: 90 e0 ldi r25, 0x00 ; 0
12: 0f 90 pop r0
14: df 91 pop r29
16: cf 91 pop r28
18: 08 95 ret
0000001a <cast_to_uint24>:
1a: cf 93 push r28
1c: df 93 push r29
1e: 0f 92 push r0
20: cd b7 in r28, 0x3d ; 61
22: de b7 in r29, 0x3e ; 62
24: 89 83 std Y+1, r24 ; 0x01
26: 89 81 ldd r24, Y+1 ; 0x01
28: 88 2f mov r24, r24
2a: 90 e0 ldi r25, 0x00 ; 0
2c: a0 e0 ldi r26, 0x00 ; 0
2e: bc 01 movw r22, r24
30: 8a 2f mov r24, r26
32: 0f 90 pop r0
34: df 91 pop r29
36: cf 91 pop r28
38: 08 95 ret
0000003a <cast_to_uint32>:
3a: cf 93 push r28
3c: df 93 push r29
3e: 00 d0 rcall .+0 ; 0x40 <L0^A>
00000040 <L0^A>:
40: 00 d0 rcall .+0 ; 0x42 <L0^A>
00000042 <L0^A>:
42: 0f 92 push r0
44: cd b7 in r28, 0x3d ; 61
46: de b7 in r29, 0x3e ; 62
48: 89 83 std Y+1, r24 ; 0x01
4a: 89 81 ldd r24, Y+1 ; 0x01
4c: 88 2f mov r24, r24
4e: 90 e0 ldi r25, 0x00 ; 0
50: a0 e0 ldi r26, 0x00 ; 0
52: b0 e0 ldi r27, 0x00 ; 0
54: 8a 83 std Y+2, r24 ; 0x02
56: 9b 83 std Y+3, r25 ; 0x03
58: ac 83 std Y+4, r26 ; 0x04
5a: bd 83 std Y+5, r27 ; 0x05
5c: 6a 81 ldd r22, Y+2 ; 0x02
5e: 7b 81 ldd r23, Y+3 ; 0x03
60: 8c 81 ldd r24, Y+4 ; 0x04
62: 9d 81 ldd r25, Y+5 ; 0x05
64: 0f 90 pop r0
66: 0f 90 pop r0
68: 0f 90 pop r0
6a: 0f 90 pop r0
6c: 0f 90 pop r0
6e: df 91 pop r29
70: cf 91 pop r28
72: 08 95 ret
00000074 <cast_to_uint64>:
74: 8f 92 push r8
76: 9f 92 push r9
78: af 92 push r10
7a: bf 92 push r11
7c: cf 92 push r12
7e: df 92 push r13
80: ef 92 push r14
82: ff 92 push r15
84: 0f 93 push r16
86: 1f 93 push r17
88: cf 93 push r28
8a: df 93 push r29
8c: 0f 92 push r0
8e: cd b7 in r28, 0x3d ; 61
90: de b7 in r29, 0x3e ; 62
92: 89 83 std Y+1, r24 ; 0x01
94: 89 81 ldd r24, Y+1 ; 0x01
96: 08 2f mov r16, r24
98: 10 e0 ldi r17, 0x00 ; 0
9a: 20 e0 ldi r18, 0x00 ; 0
9c: 30 e0 ldi r19, 0x00 ; 0
9e: 40 e0 ldi r20, 0x00 ; 0
a0: 50 e0 ldi r21, 0x00 ; 0
a2: ba 01 movw r22, r20
a4: 80 2e mov r8, r16
a6: 91 2e mov r9, r17
a8: a2 2e mov r10, r18
aa: b3 2e mov r11, r19
ac: c4 2e mov r12, r20
ae: d5 2e mov r13, r21
b0: e6 2e mov r14, r22
b2: f7 2e mov r15, r23
b4: 28 2d mov r18, r8
b6: 39 2d mov r19, r9
b8: 4a 2d mov r20, r10
ba: 5b 2d mov r21, r11
bc: 6c 2d mov r22, r12
be: 7d 2d mov r23, r13
c0: 8e 2d mov r24, r14
c2: 9f 2d mov r25, r15
c4: 0f 90 pop r0
c6: df 91 pop r29
c8: cf 91 pop r28
ca: 1f 91 pop r17
cc: 0f 91 pop r16
ce: ff 90 pop r15
d0: ef 90 pop r14
d2: df 90 pop r13
d4: cf 90 pop r12
d6: bf 90 pop r11
d8: af 90 pop r10
da: 9f 90 pop r9
dc: 8f 90 pop r8
de: 08 95 ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment