So ... i succeeded read asm about arduino compiler ... is hudge file, but for some experiments is good a begin!
So ... i compile blink example from arduino examples ! Is not important that 13 is not compatible with esp,
i only want what happen with file.
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
and i dont know until now that can compile esp only inserting the esp8266com from new folder
"hardware" created in my documents/Arduino
So ... i insert esp8266com from here [https://github.com/Yveaux/esp8266-Arduino](https://github.com/Yveaux/esp8266-
Arduino)
and i set on Arduino in File/Preferences Show verbose output during compilation
and after compile i can see directory where arduino ide have temporary file for extract elf file
So ... elf file copy to my documents. elf file is hudge for few lines of codes ... have 900kb!!!!
Copy objdump.exe in My Documents from
My Documents\Arduino\hardware\esp8266com\tools\windows\xtensa-lx106-elf\xtensa-lx106-elf\bin\objdump.exe
Create a batch file ( my elf file is blink.elf)
@echo off
cls
objdump -S blink.elf > blink.txt
pause
and save in My Documents with name decompile
Now in My Documents i have decompile.bat,objdump.exe and blink.elf ...
So when execute decompile.bat result a huge file for about 4MEGA !!!! that contains asm codes!
I so that somewhere already exists these informations ... but when these informations is in many place
is also easy to find.
Also is good for me when forget how obtain asm from arduino esp8266 ...
And put here costycnc name for to be easy to find when type costycnc esp8266 in google !
Here is head , a few lines begin from asm file for blink.ino
blink.elf: file format elf32-xtensa-le
Disassembly of section .irom0.text:
40201010 <core_version>:
40201010: 32 7c 4f 61 2|Oa
40201014 <delay_end>:
static uint32_t micros_at_last_overflow_tick = 0;
static uint32_t micros_overflow_count = 0;
#define ONCE 0
#define REPEAT 1
void delay_end(void* arg) {
40201014: f0c112 addi a1, a1, -16
40201017: 3109 s32i.n a0, a1, 12
(void) arg;
esp_schedule();
40201019: 00aac5 call0 40201ac8 <esp_schedule>
}
4020101c: 3108 l32i.n a0, a1, 12
4020101e: 10c112 addi a1, a1, 16
40201021: f00d ret.n
40201023: e6dc00 excw
40201026: fe .byte 0xfe
40201027: 3f .byte 0x3f
40201028: e6d8 l32i.n a13, a6, 56
4020102a: fe .byte 0xfe
4020102b: 3f .byte 0x3f
4020102c: 1013b0 and a1, a3, a11
4020102f: c11240 mul16u a1, a2, a4
40201030 <micros_overflow_tick>:
if(ms) {
os_timer_disarm(&delay_timer);
}
}
void micros_overflow_tick(void* arg) {
40201030: f0c112 addi a1, a1, -16
40201033: 036102 s32i a0, a1, 12
(void) arg;
uint32_t m = system_get_time();
40201036: fffd01 l32r a0, 4020102c <delay_end+0x18>
40201039: 0000c0 callx0 a0
if(m < micros_at_last_overflow_tick)
4020103c: fffa31 l32r a3, 40201024 <delay_end+0x10>
4020103f: 0358 l32i.n a5, a3, 0
40201041: 034d mov.n a4, a3
40201043: 09b257 bgeu a2, a5, 40201050 <micros_overflow_tick+0x20>
++micros_overflow_count;
40201046: fff831 l32r a3, 40201028 <delay_end+0x14>
40201049: 0358 l32i.n a5, a3, 0
4020104b: 551b addi.n a5, a5, 1
4020104d: 006352 s32i a5, a3, 0
micros_at_last_overflow_tick = m;
}
40201050: 3108 l32i.n a0, a1, 12
void micros_overflow_tick(void* arg) {
(void) arg;
uint32_t m = system_get_time();
if(m < micros_at_last_overflow_tick)
++micros_overflow_count;
micros_at_last_overflow_tick = m;
40201052: 0429 s32i.n a2, a4, 0
}
40201054: 10c112 addi a1, a1, 16
40201057: f00d ret.n
40201059: 000000 ill
4020105c: fee6f4 excw
4020105f: 3f .byte 0x3f
40201060: 201014 excw
40201063: 0e7440 excw
40201066: fc4010 excw
40201069: 0f .byte 0xf
4020106a: 4c4010 excw
4020106d: 0f .byte 0xf
4020106e: 124010 excw
40201070 <delay>:
void delay_end(void* arg) {
(void) arg;
esp_schedule();
}
void delay(unsigned long ms) {
40201070: f0c112 addi a1, a1, -16
40201073: 21c9 s32i.n a12, a1, 8
40201075: 3109 s32i.n a0, a1, 12
40201077: 11d9 s32i.n a13, a1, 4
40201079: 02cd mov.n a12, a2
if(ms) {
4020107b: 22ac beqz.n a2, 402010a1 <delay+0x31>
os_timer_setfn(&delay_timer, (os_timer_func_t*) &delay_end, 0);
4020107d: fff7d1 l32r a13, 4020105c <micros_overflow_tick+0x2c>
40201080: fff831 l32r a3, 40201060 <micros_overflow_tick+0x30>
40201083: 0d2d mov.n a2, a13
40201085: 00a042 movi a4, 0
40201088: fff701 l32r a0, 40201064 <micros_overflow_tick+0x34>
4020108b: 0000c0 callx0 a0
os_timer_arm(&delay_timer, ms, ONCE);
4020108e: 0d2d mov.n a2, a13
40201090: 0c3d mov.n a3, a12
40201092: 040c movi.n a4, 0
40201094: 150c movi.n a5, 1
40201096: fff401 l32r a0, 40201068 <micros_overflow_tick+0x38>
40201099: 0000c0 callx0 a0
4020109c: 000106 j 402010a4 <delay+0x34>
4020109f: 450000 extui a0, a0, 16, 5
} else {
esp_schedule();
402010a2: 4500a2 l8ui a10, a0, 69
}
esp_yield();
402010a5: 9f .byte 0x9f
402010a6: 7c8c00 excw
if(ms) {
os_timer_disarm(&delay_timer);
402010a9: ffec21 l32r a2, 4020105c <micros_overflow_tick+0x2c>
402010ac: fff001 l32r a0, 4020106c <micros_overflow_tick+0x3c>
402010af: 0000c0 callx0 a0
}
}
402010b2: 3108 l32i.n a0, a1, 12
402010b4: 21c8 l32i.n a12, a1, 8
402010b6: 11d8 l32i.n a13, a1, 4
402010b8: 10c112 addi a1, a1, 16
Im so happy! 