Assembly examples for Red-V Thing Plus (SiFive FE310-G002)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
1.1 KiB

#
# main.s
#
# 2021 flabbergast <flabbergast@drak.xyz>
# Unlicense: https://unlicense.org/
#
.option norelax
.equ compressed_isa, 1
# -----------------------------------------------------------------------------
# Code begins here
# -----------------------------------------------------------------------------
.text
j Reset
# -----------------------------------------------------------------------------
# Include any supporting code
# -----------------------------------------------------------------------------
.include "platform_regs.inc"
.include "p_delay.s"
# -----------------------------------------------------------------------------
Reset: # Execution begins here
# -----------------------------------------------------------------------------
li s2, GPIO_BASE
li s1, 0b1 << 5 # pin 5 (SPI_SCK1)
sw s1, GPIO_OUTPUT_EN(s2) # set as output
sw zero, GPIO_IOF_EN(s2) # default bootloader doesn't clean up... (SPI pins)
li a0, 700 # delay in ms
1:
sw s1, GPIO_OUTPUT_VAL(s2) # make it high
jal delay
sw zero, GPIO_OUTPUT_VAL(s2) # make it low
jal delay
j 1b
end:
j end