Page 1 of 1
Assembler Sample
Posted: Tue Dec 19, 2017 6:10 pm
by pdelprat
Hello,
I would like to see a sample assembler (.S file) file as a main fonction, and not asm inside C file,
Is it exist somewhere ?
I would like to generate asm file from another language and integrate it into esp-idf project,
Thanks in advance,
Pascal
Re: Assembler Sample
Posted: Wed Dec 20, 2017 3:18 am
by ESP_Angus
Not sure what you mean by "as a main function", but there are a few .S files inside the esp-idf codebase (mostly for low-level RTOS functions). Do these help?
Re: Assembler Sample
Posted: Tue Dec 26, 2017 1:54 pm
by pdelprat
Yes,
Here is my sample, hello_world_asm.S :
Code: Select all
.data
hellostring0:
.string "Hello world from ASM"
.text
.literal_position
.literal hellostring1, hellostring0
.align 4
.global test_me
.type test_me,@function
test_me:
entry a1,32
l32r a10, hellostring1
call8 puts
retw.n
Calling by this c program :
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
void test_me();
void app_main()
{
test_me();
printf("Hello world!\n");
}
Thanks,
Pascal
Re: Assembler Sample
Posted: Tue Jan 02, 2018 2:23 pm
by pdelprat
Hello again,
it exists somewhere a small projet written entirely in assembler for ESP32 ? even, if it's only few lines, but a working projet with makefile, ld.conf, gdbinit ...
Currently I'm able to write assembler modules as freeRTOS module, but not without freeRTOS
Thanks,
Pascal