Assembler Sample

pdelprat
Posts: 10
Joined: Mon Sep 04, 2017 1:37 pm

Assembler Sample

Postby pdelprat » Tue Dec 19, 2017 6:10 pm

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Assembler Sample

Postby ESP_Angus » Wed Dec 20, 2017 3:18 am

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?

pdelprat
Posts: 10
Joined: Mon Sep 04, 2017 1:37 pm

Re: Assembler Sample

Postby pdelprat » Tue Dec 26, 2017 1:54 pm

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

pdelprat
Posts: 10
Joined: Mon Sep 04, 2017 1:37 pm

Re: Assembler Sample

Postby pdelprat » Tue Jan 02, 2018 2:23 pm

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 :cry:

Thanks,
Pascal

Who is online

Users browsing this forum: Baidu [Spider] and 105 guests