Skip to content

Instantly share code, notes, and snippets.

@n-eq
Created May 13, 2025 11:15
Show Gist options
  • Save n-eq/bfdd7a2d1cb0c7b567ca9650983f85c8 to your computer and use it in GitHub Desktop.
Save n-eq/bfdd7a2d1cb0c7b567ca9650983f85c8 to your computer and use it in GitHub Desktop.
; see https://n-eq.github.io/blog/2025/05/13/rust-avr-arduino-blink
blinky.S: file format elf32-avr
Disassembly of section .text:
00000000 <.text>:
0: 0c 94 34 00 jmp 0x68 ; 0x68
4: 0c 94 46 00 jmp 0x8c ; 0x8c
8: 0c 94 46 00 jmp 0x8c ; 0x8c
c: 0c 94 46 00 jmp 0x8c ; 0x8c
10: 0c 94 46 00 jmp 0x8c ; 0x8c
14: 0c 94 46 00 jmp 0x8c ; 0x8c
18: 0c 94 46 00 jmp 0x8c ; 0x8c
1c: 0c 94 46 00 jmp 0x8c ; 0x8c
20: 0c 94 46 00 jmp 0x8c ; 0x8c
24: 0c 94 46 00 jmp 0x8c ; 0x8c
28: 0c 94 46 00 jmp 0x8c ; 0x8c
2c: 0c 94 46 00 jmp 0x8c ; 0x8c
30: 0c 94 46 00 jmp 0x8c ; 0x8c
34: 0c 94 46 00 jmp 0x8c ; 0x8c
38: 0c 94 46 00 jmp 0x8c ; 0x8c
3c: 0c 94 46 00 jmp 0x8c ; 0x8c
40: 0c 94 46 00 jmp 0x8c ; 0x8c
44: 0c 94 46 00 jmp 0x8c ; 0x8c
48: 0c 94 46 00 jmp 0x8c ; 0x8c
4c: 0c 94 46 00 jmp 0x8c ; 0x8c
50: 0c 94 46 00 jmp 0x8c ; 0x8c
54: 0c 94 46 00 jmp 0x8c ; 0x8c
58: 0c 94 46 00 jmp 0x8c ; 0x8c
5c: 0c 94 46 00 jmp 0x8c ; 0x8c
60: 0c 94 46 00 jmp 0x8c ; 0x8c
64: 0c 94 46 00 jmp 0x8c ; 0x8c
68: 11 24 eor r1, r1
6a: 1f be out 0x3f, r1 ; 63
6c: cf ef ldi r28, 0xFF ; 255
6e: d8 e0 ldi r29, 0x08 ; 8
70: de bf out 0x3e, r29 ; 62
72: cd bf out 0x3d, r28 ; 61
74: 21 e0 ldi r18, 0x01 ; 1
76: a0 e0 ldi r26, 0x00 ; 0
78: b1 e0 ldi r27, 0x01 ; 1
7a: 01 c0 rjmp .+2 ; 0x7e
7c: 1d 92 st X+, r1
7e: a1 30 cpi r26, 0x01 ; 1
80: b2 07 cpc r27, r18
82: e1 f7 brne .-8 ; 0x7c
84: 0e 94 48 00 call 0x90 ; 0x90
88: 0c 94 96 00 jmp 0x12c ; 0x12c
8c: 0c 94 00 00 jmp 0 ; 0x0
90: 0e 94 4a 00 call 0x94 ; 0x94
94: 8f b7 in r24, 0x3f ; 63
96: f8 94 cli
98: 90 91 00 01 lds r25, 0x0100 ; 0x800100
9c: 91 30 cpi r25, 0x01 ; 1
9e: 09 f4 brne .+2 ; 0xa2
a0: 3b c0 rjmp .+118 ; 0x118
a2: 91 e0 ldi r25, 0x01 ; 1
a4: 90 93 00 01 sts 0x0100, r25 ; 0x800100
a8: 8f bf out 0x3f, r24 ; 63
aa: 2d 98 cbi 0x05, 5 ; 5
ac: 25 9a sbi 0x04, 5 ; 4
ae: 80 e0 ldi r24, 0x00 ; 0
b0: 90 e0 ldi r25, 0x00 ; 0
b2: 27 ef ldi r18, 0xF7 ; 247
b4: 3f e3 ldi r19, 0x3F ; 63
b6: 4b ef ldi r20, 0xFB ; 251
b8: 58 e0 ldi r21, 0x08 ; 8
ba: 2d 9a sbi 0x05, 5 ; 5
bc: bc 01 movw r22, r24
be: fc 01 movw r30, r24
c0: d9 01 movw r26, r18
c2: 11 97 sbiw r26, 0x01 ; 1
c4: f1 f7 brne .-4 ; 0xc2
c6: a1 e0 ldi r26, 0x01 ; 1
c8: 63 3f cpi r22, 0xF3 ; 243
ca: 71 05 cpc r23, r1
cc: e8 07 cpc r30, r24
ce: f9 07 cpc r31, r25
d0: 08 f0 brcs .+2 ; 0xd4
d2: a1 2d mov r26, r1
d4: a1 70 andi r26, 0x01 ; 1
d6: 6f 5f subi r22, 0xFF ; 255
d8: 7f 4f sbci r23, 0xFF ; 255
da: ef 4f sbci r30, 0xFF ; 255
dc: ff 4f sbci r31, 0xFF ; 255
de: a0 30 cpi r26, 0x00 ; 0
e0: 79 f7 brne .-34 ; 0xc0
e2: fa 01 movw r30, r20
e4: 31 97 sbiw r30, 0x01 ; 1
e6: f1 f7 brne .-4 ; 0xe4
e8: 2d 98 cbi 0x05, 5 ; 5
ea: bc 01 movw r22, r24
ec: fc 01 movw r30, r24
ee: d9 01 movw r26, r18
f0: 11 97 sbiw r26, 0x01 ; 1
f2: f1 f7 brne .-4 ; 0xf0
f4: a1 e0 ldi r26, 0x01 ; 1
f6: 63 3f cpi r22, 0xF3 ; 243
f8: 71 05 cpc r23, r1
fa: e8 07 cpc r30, r24
fc: f9 07 cpc r31, r25
fe: 08 f0 brcs .+2 ; 0x102
100: a1 2d mov r26, r1
102: a1 70 andi r26, 0x01 ; 1
104: 6f 5f subi r22, 0xFF ; 255
106: 7f 4f sbci r23, 0xFF ; 255
108: ef 4f sbci r30, 0xFF ; 255
10a: ff 4f sbci r31, 0xFF ; 255
10c: a0 30 cpi r26, 0x00 ; 0
10e: 79 f7 brne .-34 ; 0xee
110: fa 01 movw r30, r20
112: 31 97 sbiw r30, 0x01 ; 1
114: f1 f7 brne .-4 ; 0x112
116: d1 cf rjmp .-94 ; 0xba
118: 8f bf out 0x3f, r24 ; 63
11a: 0e 94 8f 00 call 0x11e ; 0x11e
11e: 0e 94 91 00 call 0x122 ; 0x122
122: 0e 94 93 00 call 0x126 ; 0x126
126: 0e 94 95 00 call 0x12a ; 0x12a
12a: ff cf rjmp .-2 ; 0x12a
12c: f8 94 cli
12e: ff cf rjmp .-2 ; 0x12e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment