Hexadecimal

Hexadecimal

Easy

Instructions

Convert a hexadecimal number, represented as a string (e.g. "10af8c"), to its decimal equivalent using first principles (i.e. no, you may not use built-in or external libraries to accomplish the conversion).

On the web we use hexadecimal to represent colors, e.g. green: 008000, teal: 008080, navy: 000080).

The program should handle invalid hexadecimal strings.

Registers

Register Usage Type Description
$a0 input address null-terminated string of hexadecimal chars
$v0 output integer decimal value of input string
$t0-9 temporary any used for temporary storage
Edit via GitHub The link opens in a new window or tab
MIPS Assembly Exercism

Ready to start Hexadecimal?

Sign up to Exercism to learn and master MIPS Assembly with 47 exercises, and real human mentoring, all for free.