00:01
Hello student here to convert the decimal to the hexadecimal in mips assembly you can use the following code.
00:07
So load the decimal number into the register the number which we are interested in converting the decimal number hexadecimal number.
00:13
So store this decimal into the register.
00:16
So here into $t0 we are first storing or saving this number in register t0.
00:25
So here first load a word.
00:27
So here load a word means 76543210 this is a decimal number initialize a counter to 0 this counter will keep track of the number of the hexadecimal digit have been generated.
00:41
So here this number has been loaded into the register t0.
00:47
So 76543210 it has been loaded.
00:50
Now initialize a counter to 0 this counter will keep the track of the number of the hexadecimal digit have been generated.
00:58
Now t1 li so load immediately.
01:02
So this counter will keep the track of the number of the decimal digit that have been generated.
01:07
So in this way now loop till the counter reaches 4.
01:11
So this is because a 32 bit number can be represented by the 4 hexadecimal number because it's a 32 bit number can be represented by the 4 hexadecimal number.
01:26
So here 8 bit represent 1 hexadecimal.
01:32
Now loop shift the decimal number to the right by the 4 bit.
01:36
So here we have to shift the decimal number to the right by the 4 bit.
01:41
So here for shifting shift the decimal number from right to left now by the 4 digit.
01:50
So number is in t0.
01:51
So it will be shifted by 4.
01:54
Now add t2, 0 hexadecimal.
01:59
So convert the mask value to the hexadecimal.
02:02
If the value is less than 10 we add 48 to get the ascii code for the corresponding decimal digit.
02:09
If the value is greater than 9 we add 55 to get the ascii code for the corresponding hexadecimal number...