{"id":19051964,"url":"https://github.com/benknoble/mips2","last_synced_at":"2026-06-22T13:31:54.276Z","repository":{"id":70217131,"uuid":"308087981","full_name":"benknoble/mips2","owner":"benknoble","description":"MIPS interpreting MIPS","archived":false,"fork":false,"pushed_at":"2020-11-11T18:32:13.000Z","size":146,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-12T13:23:45.938Z","etag":null,"topics":["interpreter","mips","mips-architecture","mips-assembly","mips-simulator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benknoble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-28T17:11:43.000Z","updated_at":"2025-06-14T00:08:08.000Z","dependencies_parsed_at":"2023-03-11T08:19:02.779Z","dependency_job_id":null,"html_url":"https://github.com/benknoble/mips2","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/benknoble/mips2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fmips2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fmips2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fmips2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fmips2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benknoble","download_url":"https://codeload.github.com/benknoble/mips2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fmips2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34651747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpreter","mips","mips-architecture","mips-assembly","mips-simulator"],"created_at":"2024-11-08T23:20:19.233Z","updated_at":"2026-06-22T13:31:54.258Z","avatar_url":"https://github.com/benknoble.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MIPS interpreting MIPS\n\n[![This project is considered experimental](https://img.shields.io/badge/status-experimental-critical.svg)](https://benknoble.github.io/status/experimental/)\n\nInterprets the relatively complete subset of MIPS built on hardware for UNC Comp\n541 in the same subset.\n\nTakes advantage of memory-mapped IO from hardware to play sounds based on the\ncurrent instruction and to display the current set of registers.\n\n[Design documentation](./DESIGN.md)\n\n### Demos (YouTube)\n\n- [almost complete demo](https://www.youtube.com/watch?v=HqFFAOen22g)\n- [Fib(12) recursively demo](https://www.youtube.com/watch?v=WRYfnbXZhao)\n\n## Controls when choosing a program (no sound playing)\n\n- \u003ckbd\u003e0\u003c/kbd\u003e: toggle \"step mode\"\n- \u003ckbd\u003e1\u003c/kbd\u003e: compute `12! = 479001600 = 0x1C8CFC00` into `$v0` iteratively\n- \u003ckbd\u003e2\u003c/kbd\u003e: compute `12!` into `$v0` recursively\n- \u003ckbd\u003e3\u003c/kbd\u003e: compute `Fib(47) = 2971215073 = 0xB11924E1` into `$v0` iteratively\n- \u003ckbd\u003e4\u003c/kbd\u003e: compute `Fib(12) = 144 = 0x00000090` into `$v0` recursively\n- \u003ckbd\u003e5\u003c/kbd\u003e: sort 10 pre-generated random 32-bit integers in memory using\n  bubblesort, and set `$v0` to `1` if they are sorted after the algorithm runs.\n  Also copies the integers into `$t0` through `$t9` for inspection. The original\n  integers are\n  - 0xc69020dc\n  - 0xc3848f98\n  - 0x40c0016f\n  - 0x55282432\n  - 0x81dfe057\n  - 0x52957459\n  - 0x25c0a1e3\n  - 0x47a7a168\n  - 0xbf60aa02\n  - 0x683dd5b0\n\n## Controls when running a program (sound playing; only in step mode)\n\n- \u003ckbd\u003eSpace\u003c/kbd\u003e: execute next instruction\n- \u003ckbd\u003ek\u003c/kbd\u003e: quit interpreter and go back to menu\n\n### Building examples into the interpreter\n\nThe `makefile` can build `.hex` files (suitable for inclusion in the\ninterpreter) and `.{i,d}mem` files (raw hex-codes of the instructions and data\nvalues, suitable for inclusion in a Verilog description with `$readmemh`) from\nthe corresponding `.mips` file, provided you have\n\n- a java installation; and\n- the MARS jar ([MARS\n  homepage](http://courses.missouristate.edu/kenvollmar/mars/index.htm)).\n\nSet the environment or make variable `MARS` to the path to the jar.\n\nHex and memory dumps of all the examples are included with the repository.\n\nPrograms to be interpreted should declare data as `.space 4*n_words` or as\n`.word 0:n_words`; that is, they must assume that data is 0-initialized.\n(Otherwise the interpreter would need to store data for each program in its own\ndata segment, which is not as modular as I would like. If anyone has\nsuggestions for getting around this limitation, let me know.)\n\nThis effectively means that the only relevant `.dmem` file will be that of\n`mips/mips2.mips`, since it (implicitly) contains all the `.imem`s of the\nprograms it can interpret. And, of course, the `.imem` file of `mips/mips2.mips`\nwill be the one relevant to load on the CPU we've built.\n\nThe `makefile` can also runs mars, under the same conditions, as a convenience.\n\n---\n\n### About the sprites\n\nThe sprites were generated using (a version of) a friend's tool,\n[spritemaker](https://github.com/abrahampost/spritemaker.git).\n\nThe script `bin/bmp` uses `pbpaste` (macOS) to automatically convert the\nclipboard contents into a `.bmp` file and commit it. Users on other platforms\ncould replace `pbpaste` with, e.g., `xsel ...` or another program.\n\nThe script `bin/no-bmps-the-same` double-checks that all bitmaps differ (but it\nis quadratic in the number of bitmaps, so expect to wait).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Fmips2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenknoble%2Fmips2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Fmips2/lists"}