TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

RISC-V assembly for kids: snakes and ladders [pdf]

3 点作者 throwaway7127112 个月前

1 comment

throwaway7127112 个月前
It prints on A4, each player plays (moves the PC) until they have to roll a dice and then the turn changes. If you have A3 printer it feels better.<p>For pawns I use capacitors with their legs cut off.<p>I made this &quot;game&quot; as a tool to teaching my daughter super basic RISC-V asssembly, but also to help her to get intuition what a variable is, and what an `if` is. I used it in preparation of playing <a href="https:&#x2F;&#x2F;punkx.org&#x2F;overflow&#x2F;" rel="nofollow">https:&#x2F;&#x2F;punkx.org&#x2F;overflow&#x2F;</a>.<p>I usually put stack pointer at address 1188 and since the dice variable is at (sp-16)+12 it ends up at 1184, and use pencil just to write values there, but sometimes its nice to put the stack pointer suspiciously close to 1160 (which is the main&#x27;s ret) to discuss the &quot;code is data&quot; concept.<p>You can see in the game where it uses the &quot;li a5, &quot; instruction, the machine code actually has questionmark on the right place in the instruction, which is also useful when teaching about &quot;what instructions are&quot;, and how programs are compiled.<p>PS: I almost forgot about this &quot;game&quot;, and we played it quite a lot, so decided to share as it might be useful to other parents. Also we spent quite a lot of time with <a href="https:&#x2F;&#x2F;punkx.org&#x2F;4917" rel="nofollow">https:&#x2F;&#x2F;punkx.org&#x2F;4917</a> which is a collection of tiny machine code programs for Richard Buckland&#x27;s educational 4bit computer.