Last visit was: Thu Oct 30, 2025 9:45 pm
It is currently Thu Oct 30, 2025 9:45 pm



 [ 5 posts ] 
 Easy RISC-V (online tutorial with emulation in browser) 
Author Message

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1847
Thought this was interesting and relevant here:

https://dramforever.github.io/easyriscv/
Quote:
Inspired by Easy 6502 by Nick Morgan, this is a quick-ish introductory tutorial to RISC-V assembly programming. This tutorial is intended for those with a basic familiarity with low level computer science concepts, but unfamiliar with RISC-V. If you’re curious about RISC-V, I hope this will be a good start to your journey to learning about it.


Code is on github

via HN discussion here


Tue Oct 28, 2025 9:45 pm

Joined: Sat Oct 04, 2025 10:54 am
Posts: 10
That's a great way to introduce and teach it, with the editable code and emulator inline to let you play with things and experiment. It'd be nice if the emulator's single-stepping showed where it was in the code as well.

I am not an expert on RISC-V but as far as I understand, some of the things aren't explained quite right, such as position-independent code - the term is used but I believe in the RISC-V world it means something more than what is stated there. Still it's nice that it touches on it at all, and it gets through quite a range of topics in one page.


Wed Oct 29, 2025 6:07 pm

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1847
Some years ago I adapted Easy6502 to demo the 65Org16 - it was easy enough to tweak the emulator and assembler to match a tweaked ISA. It struck me that one might possibly do the same with this RISC-V and your related GF-RV16...


Wed Oct 29, 2025 6:13 pm

Joined: Sat Oct 04, 2025 10:54 am
Posts: 10
Yes I'd be very interested in doing that at some point. I don't know what the ins and outs of actually hosting things on web sites is these days though, I lost track of that in the "Web 2.0" years!

I do fear that the process of assembly is rather complex for my system, and don't know what sort of architecture/language needs to be used to make this sort of online thing work. Hopefully not javascript! If it's possible to just run Python in WebAssembly then that would certainly be easiest but maybe wishful thinking.

Edit - Brython, Skulpt, and Pyodide look promising.

Edit edit - Brython is actually really easy to get up and running, the assembler is now working in a webpage, so you can type code in and see the listing it generates. The simulator will take a bit more effort though! And I need to try harder to understand GitHub Pages and GitHub Actions to get the most out of it.


Wed Oct 29, 2025 7:27 pm

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1847
Ah, you're already up and running with github pages - excellent! That's how easy6502 is done too. On reflection, there is a different in that the simulator is in JavaScript - I've a strong feeling I've transliterated between python and JS in one direction or another. If one writes Algol-like code, that's not too hard at all. But it is yet another language. So something which is transpiled to JS is another good plan, good to see you found a way to do it.


Thu Oct 30, 2025 8:37 am
 [ 5 posts ] 

Who is online

Users browsing this forum: DotBot and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software