Code: Select all
xtensa-esp32-elf-gcc -std=gnu99 -Og -ggdb -Wno-frame-address -ffunction-sections \
-fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all \
-Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable \
-Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare \
-Wno-old-style-declaration -DESP_PLATFORM -D IDF_VER=\"v4.0-dev-837-g58df1d93b-dirty\" \
-MMD -MP -D_GNU_SOURCE -DGCC_NOT_5_2_0=1 -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' \
-DHAVE_CONFIG_H -DUNITY_INCLUDE_CONFIG_H [a bunch of -I includes] \
-c /home/daniel/esp32/projects/hello_world/main/hello_world_main.c -o hello_world_main.o
Code: Select all
int a = 1;
a = 3;
printf("%d\n", a);
a = 4;
printf("%d\n", a);
Running 'disassemble' in gdb gives me this assembly:
Code: Select all
(gdb) disassemble /m app_main
Dump of assembler code for function app_main:
4 {
0x400d29e4 <+0>: entry a1, 32
5 int a = 1;
6 a = 3;
7 printf("%d\n", a);
0x400d29e7 <+3>: l32r a2, 0x400d0348 <_stext+816>
0x400d29ea <+6>: movi a11, 3
0x400d29ed <+9>: or a10, a2, a2
0x400d29f0 <+12>: call8 0x400d3290 <printf>
8 a = 4;
9 printf("%d\n", a);
0x400d29f3 <+15>: movi.n a11, 4
0x400d29f5 <+17>: mov.n a10, a2
0x400d29f7 <+19>: call8 0x400d3290 <printf>
0x400d29fa <+22>: retw.n
End of assembler dump.