1. Homepage
  2. Programming
  3. COMPSCI 2000 Computer Systems - Practical Assignment 6: Hack Assembly

COMPSCI 2000 Computer Systems - Practical Assignment 6: Hack Assembly

Engage in a Conversation
The University of AdelaideComputer SystemsAssemblyAdelaidePythonJavaC++Hack Assembly

Part 1 - Basic Stack Operations (40 points) CourseNana.COM

In this part you'll be writing code to generate Hack Assembly for the basic VM Push/Pop operations CourseNana.COM

You'll also need to write your own tests. Take a look at the sample test file provided to see how to write your own test cases. CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Task 1.1 - Push (20 points) CourseNana.COM

  CourseNana.COM

Complete the vm_push method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

Read the value from the correct memory segment, then push that value to the stack. CourseNana.COM

Constant values need to be emulated. CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 4 test cases. CourseNana.COM

Each test case should be in a file named PushXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing. CourseNana.COM

  CourseNana.COM

Task 1.2 - Pop (20 points) CourseNana.COM

  CourseNana.COM

Complete the vm_pop method. CourseNana.COM

This method should return Hack Assembly code that does the following:2022/6/1 18:04 CourseNana.COM

  CourseNana.COM

Pop a value from the stack, then write that value to the correct memory segment. CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 4 test cases. CourseNana.COM

Each test case should be in a file named PopXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing. CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Part 2 - Arithmetic/Logic Operations (up to 40 points) CourseNana.COM

In this part you'll be writing code to generate Hack Assembly for the VM Arithmetic/Logic operations CourseNana.COM

You only need to complete 40 points of tasks in this part for full marks, and my do so using anycombination of the tasks CourseNana.COM

  CourseNana.COM

Task 2.1 - add (7 points) CourseNana.COM

  CourseNana.COM

Complete the vm_add method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

Pop 2 values from the stack, add them, then push then result back to the stack. CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 1 test case. CourseNana.COM

Each test case should be in a file named AddXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing CourseNana.COM

  CourseNana.COM

Task 2.2 - sub (7 points) CourseNana.COM

  CourseNana.COM

Complete the vm_add method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

Pop 2 values from the stack, subtract them, then push the result back to the stack.The value at the top of the stack should be subtracted from the next value in the stack (Seechapter 7.3 in the Text book) CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 1 test case. CourseNana.COM

Each test case should be in a file named SubXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing. CourseNana.COM

  CourseNana.COM

Task 2.3 - neg (7 points) CourseNana.COM

  CourseNana.COM

Complete the vm_neg method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

Pop 1 value from the stack, negate it (i.e. flip its sign), then push the result back to the stack. CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 1 test case. CourseNana.COM

Each test case should be in a file named NegXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing. CourseNana.COM

  CourseNana.COM

Task 2.4 - eq (7 points) CourseNana.COM

  CourseNana.COM

Complete the vm_eq method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

Pop 2 values from the stack, and compare them, then push the result back to the stack.If they are equal, then push TRUE (-1) back to the stack, otherwise push FALSE (0) CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 1 test case. CourseNana.COM

Each test case should be in a file named EqXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing. CourseNana.COM

  CourseNana.COM

Task 2.5 - gt (7 points) CourseNana.COM

  CourseNana.COM

Complete the vm_gt method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

  CourseNana.COM

Pop 2 values from the stack, and compare them, then push the result back to the stack. Compare if the second value from the top of the stack to the value at the top of the stack(See chapter 7.3 in the Text book) CourseNana.COM

If the second value is greater than the top value, then push TRUE (-1) back to the stack, otherwise push FALSE (0) CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 1 test case. CourseNana.COM

Each test case should be in a file named GtXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing. CourseNana.COM

  CourseNana.COM

Task 2.6 - lt (7 points) CourseNana.COM

  CourseNana.COM

Complete the vm_lt method. CourseNana.COM

This method should return Hack Assembly code that does the following: CourseNana.COM

Pop 2 values from the stack, and compare them, then push the result back to the stack.Compare if the second value from the top of the stack to the value at the top of the stack(See chapter 7.3 in the Text book) CourseNana.COM

If the second value is lest than the top value, then push TRUE (-1) back to the stack,otherwise push FALSE (0) CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Test Cases: CourseNana.COM

Write at least 1 test case. CourseNana.COM

Each test case should be in a file named LtXX.tst where XX is a number starting at 01. CourseNana.COM

See the section Writing Tests below for details on how to write test cases. CourseNana.COM

Your mark for this task may be scaled down as much as 50% for poor/missing testing CourseNana.COM

  CourseNana.COM

  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
The University of Adelaide代写,Computer Systems代写,Assembly代写,Adelaide代写,Python代写,Java代写,C++代写,Hack Assembly代写,The University of Adelaide代编,Computer Systems代编,Assembly代编,Adelaide代编,Python代编,Java代编,C++代编,Hack Assembly代编,The University of Adelaide代考,Computer Systems代考,Assembly代考,Adelaide代考,Python代考,Java代考,C++代考,Hack Assembly代考,The University of Adelaidehelp,Computer Systemshelp,Assemblyhelp,Adelaidehelp,Pythonhelp,Javahelp,C++help,Hack Assemblyhelp,The University of Adelaide作业代写,Computer Systems作业代写,Assembly作业代写,Adelaide作业代写,Python作业代写,Java作业代写,C++作业代写,Hack Assembly作业代写,The University of Adelaide编程代写,Computer Systems编程代写,Assembly编程代写,Adelaide编程代写,Python编程代写,Java编程代写,C++编程代写,Hack Assembly编程代写,The University of Adelaideprogramming help,Computer Systemsprogramming help,Assemblyprogramming help,Adelaideprogramming help,Pythonprogramming help,Javaprogramming help,C++programming help,Hack Assemblyprogramming help,The University of Adelaideassignment help,Computer Systemsassignment help,Assemblyassignment help,Adelaideassignment help,Pythonassignment help,Javaassignment help,C++assignment help,Hack Assemblyassignment help,The University of Adelaidesolution,Computer Systemssolution,Assemblysolution,Adelaidesolution,Pythonsolution,Javasolution,C++solution,Hack Assemblysolution,