Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In MIPS machine code for MARS, Write your own exception handler that prints the address of the instruction that caused the exception, the exception code

In MIPS machine code for MARS,

Write your own exception handler that prints the address of the instruction that caused the exception, the exception code and an accompanying message.

Example outputs include:

Exception caused by instruction at Address: 0x0040000c Exception Code = 12 Ignore and continue program ...

-- program is finished running --

A few important points to keep in mind: The exception handler must start at the fixed address 0x80000180. This address is in the kernel text segment. An exception handler can be written in the same file as the regular program, or in a separate file. Write your exception handler solution in a separate .asm file.

Use this code to invoke your exception handler:

.text

.globl main

main: li $t1, 300

li $t0, 0

div $a0, $t1, $t0# Do $a0 = $t1 / $t0

li $v0, 1 # Print result as an integer

syscall

li $v0, 10 # and exit

syscall

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

Be able to suggest some future options for human resources

Answered: 1 week ago

Question

Be able to create a contract for consultant services

Answered: 1 week ago