\nHi Amell,<\/p>\n
I just watched the entire series of MIPS tutorial that you have uploaded on your YT channel. First of all, thanks for that! It was awesome \ud83d\ude42<\/p>\n
Secondly, I have a few questions. As I am completely new to MIPS, I have received some tasks to do (from school) and do not know how they should be configured. Do you mind looking over them and give me some hints?<\/p>\n
For analyze.asm:
\nChange the program so that only every third character is printed. The program must still stop after “Z”.<\/p>\nFor hexmain.asm:
\nYou will now write a small subroutine, that converts numbers in the range 0 through 15 into a printable ASCII-coded character: ‘0’ through ‘9’, or ‘A’ through ‘F’, depending on the number. For numbers not in the range 0 through 15, some bits will be ignored. In file hexmain.asm, add an assembly-language subroutine with the following specification. Name: The subroutine must be called hexasc. Parameter: One, in register $a0. The 4 least significant bits specify a number, from 0 through 15. All other bits in register $a0 can have any value and must be ignored. Return value: The 7 least significant bits in register $v0 must be an ASCII code as described below. All other bits must be zero when your function returns. Required action: The function must convert input values 0 through 9 into the ASCII codes for digits ‘0’ through ‘9’, respectively. Input values 10 through 15 must be converted to the ASCII codes for letters ‘A’ through ‘F’, respectively. <\/p>\nThanks in advance!<\/p>\n
Best regards,
\nA.
\n01\/3\/17\n<\/p><\/blockquote>\n# hexmain.asm<\/p>\n
# Written
\n2015-09-04
\n by F Lundevall<\/p>\n# Copyright abandonded
\n– this file is
\nin the public domain.<\/p>\n.text<\/p>\n
main:<\/p>\n
li
\n$a0,3
\n # change this to test different values<\/p>\njal hexasc #
\ncall hexasc<\/p>\nnop # delay
\n slot filler (just in case)<\/p>\nmove
\n$a0,$v0
\n # copy return value to argument register<\/p>\nli
\n$v0,11
\n # syscall with v0 =
\n11 will print
\nout<\/p>\nsyscall # one
\n byte from a0 to the Run I\/O window<\/p>\nstop: j stop # stop after one run<\/p>\n
nop # delay
\n slot filler (just in case)<\/p>\n# You can write your own code for hexasc here<\/p>\n
#<\/p>\n
hexasc:<\/p>\n
andi
\n$a0,
\n$a0,
\n0xF # remove all bits except the
\n4 lsb.<\/p>\naddi
\n$v0,
\n$0,
\n0x30<\/p>\naddi
\n$t0,
\n$0,
\n0x9<\/p>\nble
\n$a0,
\n$t0,
\n converter<\/p>\nnop<\/p>\n
addi
\n$v0,
\n$v0,
\n0x7<\/p>\nconverter:<\/p>\n
add
\n$v0,
\n$a0,
\n$v0<\/p>\njr
\n$ra<\/p>\nnop<\/p>\n
-Amell<\/p>\n","protected":false},"excerpt":{"rendered":"
Hi Amell, I just watched the entire series of MIPS tutorial that you have uploaded on your YT channel. First of all, thanks for that! It was awesome \ud83d\ude42 Secondly, I have a few questions. As I am completely new to MIPS, I have received some tasks to do (from school) and do not know […]<\/p>\n","protected":false},"author":1,"featured_media":1098,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[],"jetpack_featured_media_url":"https:\/\/smartvania.com\/wp-content\/uploads\/2016\/03\/LTSK-copy.png","_links":{"self":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts\/1513"}],"collection":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/comments?post=1513"}],"version-history":[{"count":2,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts\/1513\/revisions"}],"predecessor-version":[{"id":1515,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/posts\/1513\/revisions\/1515"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/media\/1098"}],"wp:attachment":[{"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/media?parent=1513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/categories?post=1513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartvania.com\/wp-json\/wp\/v2\/tags?post=1513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}