RISC-V Online Assembler using Emscripten, Gnu Binutils

Overview

RISC-V Online Assembler

This is a very crude online assembler for RISC-V assembly (all variants that gas supports)

It uses a webassembly compiled version of gnu as, objdump and objcopy to build the assembly.

It has been done REALLY quick (probably less than 2h) for my RISC-V Emulator series (currently only in portuguese at https://www.youtube.com/playlist?list=PLEP_M2UAh9q6_2Jtvs9fgOVlRgsruii2m)

Compiling binutils

wget http://ftp.gnu.org/gnu/binutils/binutils-2.31.tar.xz
tar -xf binutils-2.31.tar.xz
rm binutils-2.31.tar.xz
mkdir -p build
mkdir -p bins
mkdir -p web
cd build
source {PATH_TO_EMSDK}/emsdk_env.sh
echo "Module['FS'] = FS;" > post-js.txt
emconfigure ../binutils-2.31/configure --disable-doc --build=x86 --host=wasm32 --target=riscv64-linux-gnu
emmake make -j4 CFLAGS="-DHAVE_PSIGNAL=1 -DELIDE_CODE -D__GNU_LIBRARY__ -O2" LDFLAGS="-s MODULARIZE=1 -s FORCE_FILESYSTEM=1 --post-js $(pwd)/post-js.txt"
emmake make install DESTDIR="$(pwd)/../bins"
cp binutils/objcopy.wasm binutils/objdump.wasm gas/as-new.wasm ../web
cd ..
cd bins
cp usr/local/bin/riscv64-linux-gnu-as ../web/riscv64-linux-gnu-as.js
cp usr/local/bin/riscv64-linux-gnu-objcopy ../web/riscv64-linux-gnu-objcopy.js
cp usr/local/bin/riscv64-linux-gnu-objdump ../web/riscv64-linux-gnu-objdump.js
You might also like...

A Chrome T-Rex game remake using javascript and threejs. Online demo: https://rossning92.github.io/t-rex

A Chrome T-Rex game remake using javascript and threejs. Online demo: https://rossning92.github.io/t-rex

T-Rex Game in 3D A Chrome T-rex game remake using javascript and threejs. Build the code Make sure you have node 12+ installed: https://nodejs.org/en/

Dec 29, 2022

Cyberpunk Store - online supermarket project, using cyberpunk inspired theme.

Cyberpunk Store - online supermarket project, using cyberpunk inspired theme.

if you downloaded the project from GITHUB TO START THE PROJECT WITHOUT ERRORS - Copy/Cut the "assets" folder into "Client/src/" folder (i threw the

Jan 2, 2022

Awesome book website, small online library to store books when added to the list we have implemented this using a plaint JavaScript!

microverse-m2-Awesome-books This project is about building Awsome Books using javascript Live demo Live Demo Link Built With -Lighthouse (An open-sour

Dec 27, 2022

JIT Compiler is a open source online code compiler. You can run more than 40+ most popular programming languages in your browser just-in-time using jitcompiler.

JIT Compiler is a open source online code compiler. You can run more than 40+ most popular programming languages in your browser just-in-time using jitcompiler.

JIT Compiler is a open source online code compiler. You can run more than 40+ most popular programming languages in your browser just-in-time using jitcompiler.

Jan 5, 2023

Awesome-book is an online library website where a user can store a collection of books. Different book can be added and removed. Built with JavaScript using Dom

Awesome-book Description Awesome-book is an online library website where a user can store a collection of books. Differents book can be added and remo

Sep 9, 2022

Awesome Books project : An online Book Library. Storing book information using local storage and displaying it as a list on HTML page

This is project is my based on building an online Book Library. Storing book information using local storage and displaying it as a list on html page

Nov 11, 2022

:fireworks:Interactive Online Platform that Visualizes Algorithms from Code

:fireworks:Interactive Online Platform that Visualizes Algorithms from Code

Algorithm Visualizer Algorithm Visualizer is an interactive online platform that visualizes algorithms from code. Learning an algorithm gets much easi

Jan 4, 2023

Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.

Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.

English| 简体中文 Introduction 🚀 Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source. Links

Dec 31, 2022

A Github Pages template for nonprofits seeking a starter website. Includes online donations and newsletter signup.

A Github Pages template for nonprofits seeking a starter website. Includes online donations and newsletter signup.

A Free Website Template for Nonprofits We want to help introduce the nonprofit community to the powerful world of open source development. Just follow

Dec 16, 2022

Online Golang Struct to TypeScript Interface Converter

Golang Struct to TypeScript Interface Use this tool live! https://stirlingmarketinggroup.github.io/go2ts/ This tool converts Go structs to TypeScript

Dec 17, 2022

an Advanced Verification Bot for Discord, has dashboard, online captcha etc.

Verification Bot an Advanced Verification Bot for Discord, has dashboard, online captcha etc. Info & Credits This bot was made by legendjs#0001 If you

Aug 30, 2022

Add to your GitHub readme a badge that shows your Discord username and presence (online/idle/do not disturb/offline)!

Discord Profile Markdown badge Add to your GitHub readme a badge that shows your Discord username and presence! Set up Join the Discord server (requir

Dec 30, 2022

An online code editor for interviews, troubleshooting, teaching & more…

An online code editor for interviews, troubleshooting, teaching & more…

PEER CODER ⭐ Overview 👀 Real time code syncing among peers 👨‍💻 Executes code in Java, Python, C++, C 💻 Real time video and audio call 📹 Clean UI

Nov 9, 2022

Free, open source game engine online

microStudio is a free, open source game engine online. It is also a platform to learn and practise programming. microStudio can be used for free at ht

Dec 30, 2022

⚡ Extremely fast online playground for every programming language.

Riju Riju is a very fast online playground for every programming language. In less than a second, you can start playing with a Python interpreter or c

Dec 28, 2022

No BS webpack development tool for Shopify themes (online store 2.0)

Shopify Theme Development Tool Development tool for Shopify to create themes for Online Store 2.0. Shopify Theme Development Tool Getting Started Comm

Oct 14, 2021

MERN stack application which serves as an online map journal where users can mark and rate the places they've been to.

MERN stack application which serves as an online map journal where users can mark and rate the places they've been to.

PlaceRate PlaceRate is a MERN stack application which serves as an online map journal where users can mark and rate the places they've been to. You ca

May 17, 2022

Buy or renew two-wheeler insurance online. Free Quotes from Top Insurers with Lowest Premiums in 20 Seconds

Buy or renew two-wheeler insurance online. Free Quotes from Top Insurers with Lowest Premiums in 20 Seconds

PolicyBazaar Clone This project was created using create-react-app and Json server How to run app Clone the app git clone url How to run backend npm

Nov 17, 2022

Online Inventory Control System for an apparel manufacturing company "CASANOVA" (Pvt) Ltd. Technology stack: Node.js, Express.js, MongoDB Atlas, React.js (MERN Stack).

Project Name - Online Inventory Control System for an apparel manufacturing company "CASANOVA". The project was given a "A" grade. Group Leader - IT20

Dec 26, 2021
Comments
  • Compile error when 12th bit of an immediate value is set

    Compile error when 12th bit of an immediate value is set

    Running this instruction seems to generate a compile error

    addi x1, x0, 2048
    
    file.s: Assembler messages:
    file.s:6: Error: illegal operands `addi x1,x0,2048'
    

    However, running this seems to work just fine.

    addi x1, x0, 1024
    
    OK!
    

    I could be wrong, but I believe the immediate value should be 12 bits long.

    opened by nishtahir 2
Owner
Lucas Teske
I am because we are.
Lucas Teske
A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose

By running a single command, you will get a production-ready Node.js app installed and fully configured on your machine. The app comes with many built-in features, such as authentication using JWT, request validation, unit and integration tests, continuous integration, docker support, API documentation, pagination, etc. For more details, check the features list below.

Hagop Jamkojian 5k Dec 31, 2022
A Gatsby starter using the latest Shopify plugin showcasing a store with product overview, individual product pages, and a cart

Gatsby Starter Shopify Kick off your next Shopify project with this boilerplate. This starter creates a store with a custom landing page, individual f

Brent Jackson 12 May 12, 2021
Express typescript boilerplate using @types/node, @types/express

Express framework boilerplate in typescript.

Harris Gurung 3 Sep 21, 2022
A boilerplate for REST API Development with Node.js, Express, and MongoDB using TypesScript

node-mongo-boilerplate A simple boilerplate for NODEJS, EXPRESS and MONGODB REST API development . Quick Start Make sure you have node.js v14 + npm v8

Asamoah Michael 5 Oct 16, 2022
A lightweight IDE that supports verilog simulation and Risc-V code compilation

EveIDE_LIGHT 使用手册 当前版本 : v0.0.2-beta (支持windows7以上版本 64位操作系统) 作者 : Adancurusul 版本说明 版本部分特性 概述 什么是EveIDE_LIGHT 使用介绍 选择工作区 进入主界面 左侧模组区 工程视图 编译设置 仿真设置 右侧

Chen Yuheng 43 Aug 29, 2022
Super Mario 64 ported to JavaScript and WebAssembly via Emscripten.

SM64-JS Super Mario 64 ported to JavaScript and WebAssembly via Emscripten. REPL Takedown I was forced to take down the REPL for this project due to c

Sevenworks 12 Dec 23, 2022
Custom touch bar or digital macropad app for GNU/Linux 🐧 using an Android device 📱

?? Boar ??️ Custom touch bar or digital macropad app for GNU/Linux ?? using an Android device ?? Those apps allow creating a keyboard with custom keys

Fabián Velosa 0 Oct 29, 2022
AutoScroll is a plugin for BetterDiscord that brings the mouse wheel button autoscroll feature to the GNU/Linux and macOS client.

AutoScroll AutoScroll is a plugin for BetterDiscord that brings the mouse wheel button autoscroll feature to the GNU/Linux and macOS client. This plug

Luna 12 Dec 14, 2022
A chat logs online saver for discord bots to save messages history & cleared messages online

Chat Logs NPM package that saves messages online to view it later Useful for bots where users can save messages history & cleared messages online Supp

TARIQ 8 Dec 28, 2022
BookAttic is an online bookstore made using the MERN stack.

BookAttic is an online bookstore made using the MERN stack. Link to the website. Table of contents General info Technologies Setup General info This p

Chirag Datwani 32 Nov 19, 2022