Programming Project

Description

2 attachmentsSlide 1 of 2attachment_1attachment_1attachment_2attachment_2

Unformatted Attachment Preview

Programming Assignment 6 – Improvements
Overview
For the final part of the project, extend your MiniJava compiler by adding support for division. The
support should include support for the division operation in the scanner, parser, semantic analysis
and code translation.
Implementation




Add support for the new division token “/”.
Add Expression ::= Expression / Expression as a new production.
Semantic analysis should check for valid expressions, as well as divide by zero.
Code generation should concatenate registers as described by the X86_64 architecture for
division.
Executing x86-64 Code with gcc
Your compiler should produce output containing x86-64 assembly language code for the division
operation. You can compile and execute your generated code and the bootstrap program using gcc,
and you can use gdb to debug it at the x86-64 instruction level. Refer to the previous Homework 5
for instructions on using gcc and gdb.
You should test your compiler by processing MiniJava programs, such as BinarySearch which use
division. You should also create your own test programs to verify implementation on a number of
scenarios, such as:

Divide by local registers

Divide by parameters

Divide by constants

Divide by zero
What to Hand In
For this phase of the project the main things we will be looking for are the following:




That your compiler properly generates the code to X86-64 assembly code (-C option)
That your assembly code compiles with GCC.
Your program runs to completion and produces the correct output for division
We also check several of the example MiniJava programs.
To submit your code, you must first clean the entire directory using the following command:
ant clean
After the directory has been cleaned, compress the entire minijava_starter directory structure into a
.zip file with the following name structure: csc348_hw6_[lastname]_[firstname].zip
Submit the code to D2L along with sample output in a text file in the submission folder. This is to
demonstrate that your code ran correctly before submitting it.
We will test your code by building and running your project using ant and Java from the command
line, using one or more sample programs from the project. Please make sure your program runs and
generates the correct output before submitting it.

Purchase answer to see full
attachment

Tags:
programming

code

binary

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Looking for this assignment?

do my essay homework

Reviews, comments, and love from our customers and community

Article Writing

Great service so far. Keep doing what you do, I am really impressed by the work done.

Alexender

Researcher

PowerPoint Presentation

I am speechless…WoW! Thank you so much! Definitely, the writer is talented person. She provided me with an essay a day early before the due date!

Stacy V.

Part-time student

Dissertation & Thesis

This was a very well-written paper. Great work fast. I was in pretty desperate need for help to finish this paper before the due date, which was in nine hours.

M.H.H. Tony

Student

Annotated Bibliography

I love working with this company. You always go above and beyond and exceed my expectations every time. Kate did a WONDERFUL job. I would highly recommend her.

Francisca N.

Student

Book Report / Review

I received my order wayyyyyyy sooner than I expected. Couldn’t ask for more. Very good at communicating & fast at replying. And change & corrections she put in the effort to go back and change it!

Mary J.

Student

Essay (Any Type)

On time, perfect paper. All concerns & matters I had Tom was able to answer them! I will definitely provide him with more orders!

Prof. Kate (Ph.D)

Student

Case Study

Awesome! Great papers, and early! Thank you so much once again! Definitely recommend to trust James with your assignments! He won’t disappoint!

Kaylin Green

Student

Proofreading & Editing

Thank you Dr. Rebecca for editing my essays! She completed my task literally in 3 hours. For sure will work with her again, she is great and follows all instructions

Rebecca L.

Researcher

Critical Thinking / Review

Extremely thorough summary, understanding and examples found for social science readings, with edits made as needed and on time. It’s like having a tutoring service available (:

Arnold W.

Customer

Coursework

Perfect!I only paid about $80, which i think was a good price considering what my paper entailed. My paper was done early and it was well written!

Joshua W.

Student

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>