{"id":46769913,"url":"https://github.com/alexsocha/mipsplusplus","last_synced_at":"2026-03-09T22:43:44.219Z","repository":{"id":57441917,"uuid":"144379036","full_name":"alexsocha/mipsplusplus","owner":"alexsocha","description":"MIPS++: A low-level programming language","archived":false,"fork":false,"pushed_at":"2020-11-28T04:15:27.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-28T14:21:46.794Z","etag":null,"topics":["compiler","mips-architecture","mips-assembly","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexsocha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-11T11:14:57.000Z","updated_at":"2023-01-30T02:23:59.000Z","dependencies_parsed_at":"2022-09-06T02:42:04.527Z","dependency_job_id":null,"html_url":"https://github.com/alexsocha/mipsplusplus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexsocha/mipsplusplus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexsocha%2Fmipsplusplus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexsocha%2Fmipsplusplus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexsocha%2Fmipsplusplus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexsocha%2Fmipsplusplus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexsocha","download_url":"https://codeload.github.com/alexsocha/mipsplusplus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexsocha%2Fmipsplusplus/sbom","scorecard":{"id":182601,"data":{"date":"2025-08-11","repo":{"name":"github.com/alexsocha/mipsplusplus","commit":"ee7f87605682fe0b219f754069bf11da80c0312a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yaml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/alexsocha/mipsplusplus/build.yaml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:2","Warn: pipCommand not pinned by hash: Dockerfile:10","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T19:08:15.177Z","repository_id":57441917,"created_at":"2025-08-16T19:08:15.178Z","updated_at":"2025-08-16T19:08:15.178Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["compiler","mips-architecture","mips-assembly","programming-language"],"created_at":"2026-03-09T22:43:44.121Z","updated_at":"2026-03-09T22:43:44.195Z","avatar_url":"https://github.com/alexsocha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MIPS++ Programming Language\n\n![build](https://github.com/alexsocha/mipsplusplus/workflows/build/badge.svg)\n[![PyPI version](https://badge.fury.io/py/mipsplusplus.svg)](https://badge.fury.io/py/mipsplusplus)\n\n\u003cimg src=\"https://raw.githubusercontent.com/alexsocha/mipsplusplus/master/logo.svg?sanitize=true\" align=\"left\" hspace=\"10\" width=\"150px\"\u003e\n\n**MIPS++** is a low-level programming language based on the [MIPS architecture](https://en.wikipedia.org/wiki/MIPS_architecture). Its purpose is to generate faithful MIPS assembly code using a clearer syntax, with a focus on optimization. It is also a superset of MIPS.\n\nCurrent features include arithmetic expressions, data types, register aliases (i.e. local variables), conditional jumps and arrays.\n\n## Usage\n\nInstalling:\n```\npip install mipsplusplus\n```\n\nCommand line:\n```\npython -m mipsplusplus path/to/source.mpp -o output.asm\n--comments 1 --registers \"$t0\" \"$t1\" \"$t2\"\n```\n\nPython:\n```python\nimport mipsplusplus\n\ncompiled = mipsplusplus.compile(lines=source.readlines(),\n  comments=1, registers=['$t0', '$t1', '$t2'])\n```\n\n### Optional Parameters\n* **comments:** The level of commenting in the generated MIPS code.\n0 = None, 1 = Minimal, 2 = Almost every line. Defaults to 1.\n\n* **registers:** List of temporary registers (in order) for the compiler to use where necessary. These should not be used to store variables as they may be overridden. The compiler will indicate if more are required for any particular statement. Defaults to `[$t0, $t1, $t2]`.\n\n## Syntax Example\nThe following program converts a decimal number to an arbitrary base.\n```ruby\n.data\nbyte[30] digits\nstring numPrompt = \"Enter number: \"\nstring basePrompt = \"Enter base: \"\nstring convertedInfo = \"Converted: \"\n\n.text\n@alias $num = $t3, $base = $t4, $i = $t5\n\nprint numPrompt\n$num = input()\n\nprint basePrompt\n$base = input()\n\n$i = 0\ncalcLoop:\n  digits[$i] = $num % $base\n  $num = $num / $base\n\n  $i = $i + 1\n  goto calcLoop if $num \u003e 0\n\nprint convertedInfo\nprintLoop:\n  $i = $i - 1\n  goto endPrintLoop if i \u003c 0\n\n  @alias $digit = $t3\n  $digit = digits[$i]\n\n  goto printAsChar if $digit \u003e 9\n\n  print $digit\n  goto printLoop\n\n  printAsChar:\n    print (55 + $digit) as char\n    goto printLoop\nendPrintLoop:\nexit\n```\n\n## Language Reference\n### Definitions\n```ruby\n.data\n# Numeric\nint x = 123456789 # 4 bytes\nshort y = -32000  # 2 bytes\nbyte z = 64       # 1 byte\nchar letter = 'C' # 1 byte\n\n# Addresses/arrays\nstring greeting = \"hello\"\nchar[20] name # Empty string with space for 20 characters\n\nint[] numbers = [20, -65, 42]\nbyte[30] byteArray\n\n.text\n# ...code\n```\n\n### Registers and Variables\n```ruby\n# Any register can be given an alias, which remains\n# for all following lines or until it is reassigned\n@alias $num = $t3, $array = $t4, $character = $t5\n\n# Direct register assignment\n$num = 42\n$character = 'K'\n\n# Loading from defined variables\n$num = x\n$array = numbers\n$character = letter\n\n# Saving to defined variables\nx = $num\nletter = 'M'\ny = letter # Uses ASCII value\n```\n\n### Operators\n```ruby\n# Standard\n$num = (x + y) / (z - 7)\n$num = neg $num * (y % 8)\n\n# Boolean logic\n$true = 1\n$false = 0\n$bool = not ($true and $false) nor $true xor ($true or $false)\n\n# Bitwise\n$num = (1 \u003c\u003c 4) and ($num \u003e\u003e 1) # Zeros are shifted in\n$num = -8 \u003e\u003e\u003e 2 # The sign bit is shifted in\n# Note that \u003c\u003c\u003c is not an operator\n\n# Comparison\n$condition = z \u003c 200\n# Note that this is the only comparison operator\n# which can be used in arbitrary expressions\n```\n\n### Addresses\n```ruby\n# Addresses\n$numAddress = addressof x # Requires explicit 'addressof' operator\n$stringAddress = greeting\n$arrayAddress = numbers\n\n$offsetAddress = $numbers + 4\n$offsetAddress = addressof $numbers[4] # Equivalent to previous line\n```\n\n### Arrays\n```ruby\n# Byte arrays\n$num = byteArray[3]\nbyteArray[4] = 42 + $num - z\n\n# Integer arrays\n# (indexes must be multiplied by the number\n# of bytes in the corresponding data type)\nnum = numbers[$index * 4] \nnumbers[24] = 32 # Sets the 6th element\n\n# Ambiguous arrays\n$array = someArray\n\n# - Explicit\n$num = $array[0] as int # Load value as int\n$array[4] as int = $num # Store value as int\n\n# - Implied\n$array[8] = 42 # Store int\n$array[9] = 42 as byte # Store byte\n$array[10] = $num + y + 3 # Store short\n$array[11] = $array[12] as char # Load and store char (byte)\n\n# - Combined\n$array1[13] as int = 6 * ($array2[$i * 2] as short) # Load short, store int\n$array3[14] = (22 - numbers[$i * 4]) as byte # Load int, store byte\n```\n\n### Control Flow\n```ruby\nlabel:\n  # ...\n\n# Jumping to labels\ngoto label\ngotolink label # Return address is stored in $ra\n\n# Jumping to addresses in registers\n$storedLabel = label # (addressof label)\ngoto $storedLabel\n\n# Conditional jumps\n# (supports all comparison operators)\ngoto label if x \u003e 9\ngoto label if $num + 4 != x\ngoto $storedLabel if $num % 7 \u003c= x / y\ngoto $storedLabel if $condition1 and x \u003c 8 # ($condition1 and x \u003c 8) \u003e 0\n\n# - With link (only \u003c 0 and \u003e= 0)\ngotolink label if $num \u003c 0\ngotolink $storedLabel if $num \u003e= 0\n```\n\n### System Functions\n```ruby\n# Printing\nprint $num\nprint greeting\nprint $character as char\n\n# Input integer\n$num = input()\nx = input() + 6\ninput() # Value is stored in $v0\n\n# Input string\ninputstr name\ninputstr addressof $array[8]\ninputstr $location, 40 # Max length 40\n\n# Memory allocation\naddress = alloc(50) # Alocate 50 bytes, store first address as int\n$array = alloc(20) + 4 # Offset by 4\nalloc(80) # Address is stored in $v0\n\n# Exit\nexit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexsocha%2Fmipsplusplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexsocha%2Fmipsplusplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexsocha%2Fmipsplusplus/lists"}