rmips: mips32 assembly emulator
This is alpha, but you can check it out if you are brave. Download:
- bitstring.rb: implements a Bitstring class used to perform operations on a binary string.
- signedness.rb: implements a signedness module for converting between integers and bitstrings.
- mips.rb: Implements the mips32 core memory and registers, and assembles (but does not execute) mips32 instructions.
- mips_ops.rb: Implements mips32 instructions for execution.
- test-mips.rb: Unit tests for 'mips.rb' and 'mips_ops.rb'
- test_bit_sign.rb: Unit tests for 'bitstring.rb' and 'signedness.rb'
A quick play with bitstring.rb:
$ irb --prompt simple
>> require 'bitstring'
=> true
>> s = Bitstring.new(32)
=> b'0100000'
>> t = Bitstring.new('0100000')
=> b'0100000'
>> s + t
=> b'01000000'
>> (s + t).to_i
=> 64
>> x = Bitstring.new(-25)
=> b'100111'
>> x << 2
=> b'10011100'
>> x << 2
=> b'1001110000'
>> x << 2
=> b'100111000000'
>> x.to_i
=> -1600
>> x.halfword?
=> false
>> x.halfword!
=> true
>> x
=> b'1111100111000000'
stats
It is
Saturday May 17, 2008 3:46 pm
This page served 270 times
This page last modified: April 14, 2008 11:28 am
Your IP address is: 38.103.63.17
You are browsing using: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
You are browsing from: United States.
badcomputer.org's uptime: 15:46:15 up 23 days, 16:28, 0 users, load average: 0.00, 0.00, 0.00
local
home | unix stuff | dir2ogg | sneetchalizer | wmainfo | q&d guide to permissions | q&d guide to tar and gzip | code | MS rant | browser shootout | linux & iAudio X5 | photos | music | programming poetry | sieve of Eratosthenes | plea | rain | suffer | archive | about | recipes | compaqr3000 | sitemap
search
credits
This page, and all pages on this site were created and are maintained by Darren Kirby using valid XHTML 1.0 and CSS, and are ©copyright 2002 - 2008. The Penguin image was created by Tukka, and is used by permission. Inspiration for the look of this site was provided by Eric A. Meyer's CSS gallery. This website runs on Gentoo Linux. It is served by Apache. PHP and MySQL hold together the backend.