MIPS Aiken to Binary

29 Views Asked by At

Below is part of my code being used to convert an Aiken code (ex: 0xDCB43210) to binary (ex: 0x48FF4EA).

li $t1, 8 #limit

loop:
srl $t2, $t0, 28
andi $t2, $t2, 0xf #mask

li $t4, 4
slt $t5, $t4, $t2
beq $t5, $zero, skip_sub
sub $t2, $t2, 6

skip_sub:
li $t4, 10
mul $t2, $t2, $t4
add $t0, $t0, $t2

li $t4, 4
sllv $t4, $t4, $t1
srlv $t2, $t0, $t4
andi $t2, $t2, 0xf
add $t0, $t0, $t2

sub $t1, $t1, 1
bnez $t1, loop

I'm trying to convert each input from Aiken to binary, but none of the outputs match up with what I'm expecting. I've tried going to others for help, but am still struggling. Any help or advice would be greatly appreciated.

0

There are 0 best solutions below