Skip to content

Instantly share code, notes, and snippets.

make: Nothing to be done for 'all'.
# GNU Make 4.2.1
# Built for x86_64-pc-linux-gnu
# Copyright (C) 1988-2016 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
# Make data base, printed on Thu Oct 22 10:48:33 2020
@jonasdn
jonasdn / wait.S
Last active August 11, 2020 07:04
.section .text
.equ MTIME_REG, 0x200bff8 # memory address of MTIME register
.equ RTC_FREQ, 33
.global wait_ms
#
# Arguments:
# - a0: number of milliseconds to busy wait
#
.section .text
.equ GPIO_BASE, 0x10012000 # Memory address of FE310-G002 GPIO
.equ GPIO_RED, 0x400000 # (00000000010000000000000000000000)
.global init_led
init_led:
li t0, GPIO_BASE # li: load the constant GPIO_BASE into t0
li t1, GPIO_RED # Load the constant GPIO_RED into t1
using internal linker script:
==================================================
/* Script for -n: mix text and data on same page */
/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("elf32-littleriscv", "elf32-littleriscv",
"elf32-littleriscv")
OUTPUT_ARCH(riscv)