Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this assignment you will be asked to write your own code. Given below is a sk

ID: 3786913 • Letter: I

Question

In this assignment you will be asked to write your own code. Given below is a skeleton that you should use when writing your assembly programs. Be sure to include plenty of comments and the information header at the beginning of the code.

XDEF Entry, main

XREF __SEG_END_SSTACK

INCLUDE 'mc9s12dg256.inc'

MyCode: SECTION

main:

Entry: ;

; Your Code Here!!! :)

;

end

For this assignment you are asked to do some very simple math. First off you are to load five complex numbers (ex. 2+5i) into memory. You should load the real portion into the first memory slot followed by the imaginary portion in the next location. For example 0x1000 would contain ‘2’ and 0x1001 would contain ‘5’. You pick these numbers "at random," either to be initialized by the program, or hand loaded into memory at run time. Next you are to add the complex numbers that you have put into memory into the accumulators. Accumulator A should contain the real portion of the answer and Accumulator B should contain the imaginary portion of the answer. Hint 1: Start loading your numbers into memory at 0x1000. Ten locations will be needed, so do not go above 0x100A. Hint 2: Run this program in the simulator, since there is no user I/O

Explanation / Answer

public category information non-public RandomAccessFile database;
personal String fName = new String();;
personal IOmethods io = new IOmethods();
Database() throws IOException
}
database.close();
System.out.println("The record to be changed isn't within the database");
}
personal Boolean find(DbObject d) throws IOException {
DbObject[] tmp = new DbObject[1];
d.copy(tmp);
information = new RandomAccessFile(fName,"r");
whereas (database.getFilePointer() < information.length()) come back true;
}
}
database.close();
come back false;
}
personal void printDb(DbObject d) throws IOException {
information = new RandomAccessFile(fName,"r");
whereas (database.getFilePointer() < information.length())
database.close();
}
public void run(DbObject rec) throws IOException
else if (option.charAt(0) == '2')
else if (option.charAt(0) != '4')
System.out.println("Wrong option");
else return;
printDb(rec);
System.out.print("Enter AN option: ");
possibility = io.readLine();
}
}
}





import java.io.*;

public interface DbObject




import java.io.*;

public category IOmethods
public String readString(int len, RandomAccessFile in) throws IOException (char)ch == ' ') // {end of file or finish of line;
break;
else if ((char)ch != ' ') // ignore carriage return;
s = s + (char)ch;
}
return s;
}
}







import java.io.*;

public category Personal extends IOmethods implements DbObject ten, cityLen = 10;
protected String SSN, name, city;
protected int year;
protected long salary;
protected final int size = 9*2 + nameLen*2 + cityLen*2 + four + 8;
Personal()
Personal(String ssn, String n, String c, int y, long s) town = c; year = y; wage = s;
}
public int size() {
come back size;
}
public Boolean equals(Object pr)
public void writeToFile(RandomAccessFile out) throws IOException
public void writeLegibly()
}






import java.io.*;

public category Student extends Personal {
public int size() {
come back super.size() + majorLen*2;
}
protected String major;
protected final int majorLen = 10;
Student()
Student(String ssn, String n, String c, int y, long s, String m)
public void writeToFile(RandomAccessFile out) throws IOException
public void readFromFile(RandomAccessFile in) throws IOException
public void readFromConsole() throws IOException
public void copy(DbObject[] d)
}









import java.io.*;

public category UseDatabase
}