Question: Using Assembly in MIPS A 2-D table, named 'Tab', has 60 words allocated in memory. The array Tab is organized by 10 entries, each of

Using Assembly in MIPS

Using Assembly in MIPS A 2-D table, named 'Tab', has 60 words

A 2-D table, named 'Tab', has 60 words allocated in memory. The array Tab is organized by 10 entries, each of which has a two-word 'name' and a one-word 'val as in HW1. A name is up to 8 characters long, and is stored in two MIPS words. A val is a single-digit integer. Write a MIPS program which reads in values to the Tab and prints the contents of Tab. For input and output of the Tab, it is recommended to use inBuf and outBuf, respectively, which hold an entry at a time. For input, function fillTab repeatedly uses a pair of syscalls (one with $v0 of 8 for name and another with $v0 of 5 for val) into inBuf and copies in Buf to the next available entry in Tab. The main then calls dumpTab, which similarly copy each entry of Tab into outBuf, which has four words. When the 3rd word is copied to outBuf, it has to be converted to ASCII alphanumeric to be printed. For simplicity, assume that the table Tab and the number of occupied entries max are declared global so that they do not have to be passed to fillTab and dumpTab functions. And when you execute your program, you can test with 3 or 4 entries. A 2-D table, named 'Tab', has 60 words allocated in memory. The array Tab is organized by 10 entries, each of which has a two-word 'name' and a one-word 'val as in HW1. A name is up to 8 characters long, and is stored in two MIPS words. A val is a single-digit integer. Write a MIPS program which reads in values to the Tab and prints the contents of Tab. For input and output of the Tab, it is recommended to use inBuf and outBuf, respectively, which hold an entry at a time. For input, function fillTab repeatedly uses a pair of syscalls (one with $v0 of 8 for name and another with $v0 of 5 for val) into inBuf and copies in Buf to the next available entry in Tab. The main then calls dumpTab, which similarly copy each entry of Tab into outBuf, which has four words. When the 3rd word is copied to outBuf, it has to be converted to ASCII alphanumeric to be printed. For simplicity, assume that the table Tab and the number of occupied entries max are declared global so that they do not have to be passed to fillTab and dumpTab functions. And when you execute your program, you can test with 3 or 4 entries

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!