MIPS Assemply Language Convert using radix
I have this code, but I have to make some changes to it. The following MIPS code converts an unsigned integer stored in register $a0 into a string stored in the data segment in memory. The string is initialized with 10 space characters. The string has 10 characters only because a 32-bit unsigned integer can have at most 10 digits. .data str: .asciiz " " # str = 10 space characters .text .globl main main: li $a0, 5128 # $a0 = unsigned integer to convert la $v0, str # load address of str into $v0 addiu $v0, $v0, 11 # $v0 = pointer at end of str li $a1, 10 # Initialize $a1 = 10 int2str: divu $a0, $a1 # divide $a0 by 10 mflo $a0 # $a0 = quotient mfhi $t0 # $t0 = remainder (0 to 9) addiu $t0, $t0, 48 # convert digit into a character addiu $v0, $v0, -1 # point to previous space character sb $t0, ( $v0) # store byte: Memory($v0) = $t0 bnez $a0, int2str # loop back if quotient is not zero done: . . . # $v0 = pointer to string in memory The integer-to-string program presented above converts an unsigned integer to string format using successive division by 10 and storing the remainder digit characters in a string. It is also possible to convert the unsigned integer to any radix using successive divisions by the radix value. Rewrite the integer-to-string program asking the user to input an unsigned integer and a radix value between 2 and 10. Do the radix conversion and then print the string. Make sure that the string has sufficient space characters, especially when converting to radix
How to change the comment sign for m4's --synclines option?
Define “getting a value from the chip” vs. using a provided constant - assembly
I want to copy bytes from file to string
Assembly language simple program
repeating mov instruction x86
How to display value having RIP relative address in gdb?
GNU 8085 Simulator(How to change the initial starting address)
NASM - Get number of items in stack
Assembly, easy code, Segmentation fault why
How to write a procedure to print a string and a newline character in x86 assembly?
Profiling compiled code without source code?
Where is -32768 coming from?
Printing decimal number in assembly language?
How to take digits as input in Assembly Language then print them as a number?
Indirection on a DEC PDP 8
OP code for shifting operations (Intel, ARM)