npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodemips

v0.1.2

Published

MIPS assembler, emulation, and data manipulation within Node.JS.

Downloads

9

Readme

nodemips

nodemips is a MIPS assembling, emulation, and (essentially) manipulation library. You can use it within other projects for your MIPS needs, or simply run it to run a basic MIPS program.

How to Use

Library API documentation is yet to come. To run the simple test pogram (test.asm), which is a demonstration that comes with nodemips, simply run test.js (or nodemips-demo if globally installed via npm).

Usually, nodemips has a browser version, inside the browser folder. If you want to rebuild that version, please note that, in order to run Browserify (npm run build), there must be no browser field in the package.json file of the jimp dependency. Apparently, Browserify uses jimp's own browser version, the latter which requires many files that don't exist.

This currently must be done manually, but only once per nodemips update.

Key Aspects

Performance

Performance is decent for simpler programs, but there is most likely much room for optimization. For comparison, the super-minimalistic test program (test.asm), when run by test.js, takes around a second to run with debug logs, but a small fraction of a second without debug logs.

Current emulation accuracy

Note: nodemips is still in an alpha stage, which means it doesn't have as many features as it aims to eventually have.

  • Don't expect an existing MIPS program, e.g. Super Mario 64, to run in nodemips. While architecture accuracy was a concern, this emulator simply executes MIPS I instructions in a generic machine. It won't emulate console-specific details, like graphics registers and interrupts for the Nintendo 64.

    Also, MIPS programs will most likely come in an executable format, like ELF; nodemips follows a specific procedure in order to execute a program. The easiest way to create a nodemips program is by using the assembler (don't try to execute individual lines using the assembler, it won't work). One may also set the Program Counter (PC) to the address of the first instruction (usually, this address will be in the text buffer space, i.e. between 0x00400000 and 0x0FFFFFFF), and set the initial values in the RAM, VRAM, error handling instructions ROM, and maybe even the stack buffer, before starting the machine, by either calling clock many times (although this method won't allow blocking processes like reading on stdin), or using the start, toggle (pause/unpause) and stop methods (which might give lesser control over the flow of the CPU 'cycles').

  • It has a 320x200 VGA mode 13h memory and palette buffers, which may be used in order to display graphics, granted that you can see the JIMP image returned by the MIPSMachine.getVGA async method. To set the R, G and B of the color #i in the VGA palette, simply syscall with $v0 = 0x3C (which is 60, since, unlike i386 implementations of VGA, syscall slot 0x10 is taken), then set $a0, $a1, $a2, $a3 to, respectively, the index i, and the red, green and blue channel values.

  • Only a handful syscalls - printing, and (untested) stdin reading -, are supported at the moment.

  • The filesystem is not currently implemented. While it may eventually be implemented in the Node.JS version, the browserify version will never support a filesystem, due to the basic limitations of localStorage (or any other persistent or permanent data storage mechanism) in browser JavaScript engines.

  • Sound is not yet supported.