start.S

Assembly source for Emulating a round-screen ESP32 board, 19 lines. Raw file

# start.S - entry stub for the self-test. The emulator seeds a stack and jumps
# here. We disable windowed exceptions (PS.WOE=0) so the shallow calls below
# never need the ROM/IDF window-overflow handlers, set a known stack in SRAM1,
# and call main. No literals are used here so the pool placement never matters.
    .section .text._start, "ax"
    .global _start
    .align 4
_start:
    movi    a2, 0
    wsr.ps  a2                  # PS = 0: WOE off, EXCM off, INTLEVEL 0
    rsync
    # stack pointer = 0x3FCEB000 (high in SRAM1, data bus), built without a literal
    movi    a1, 0x3FC
    slli    a1, a1, 20          # 0x3FC00000
    movi    a3, 0xEB
    slli    a3, a3, 12          # 0x000EB000
    or      a1, a1, a3          # 0x3FCEB000
    call8   main
1:  j       1b