Giter VIP home page Giter VIP logo

assembly-rpn-calculator's Introduction

COMP 40 hw08: Assembly RPN Calculator

Eli Intriligator and Colby Cho

Acknowledgements: Consulted the TAs during office hours for multiple parts of this assignment.

In this assignment, we programmed a reverse polish notation (RPN) calculator in the assembly language of the UM virtual machine built for HW6.

What has been correctly implemented:

To our knowledge, everything has been correctly implemented. We consistently pass the diff test against the reference for any number of random inputs up to 1 million.

Departures from the recommended calling convention:

  • r1 holds input during the waiting state (as is illustrated in sample code on the spec)
  • r3 holds our value stack pointer

Print module implementation:

The print module uses tail-end recursion to print the most significant n - 1 digits followed by the least significant digit of an n digit number.

RPN calculator value stack:

The value stack is a stack with space for one million entries, where r3 points to the top of the stack and the label end_valstack points to the bottom of the value stack.

Sections created across .ums files:

  • .section init - Contains setup code, including code to set up the stack, code to initialize jump tables, and code to call main when setup is complete.
  • .section rodata - Contains jump tables.
  • .section data - Contains a preallocated call stack and value stack.
  • .section text - Contains procedure definitions, including the definition of main.

Hours spent analyzing the assignment: 2

Hours spent writing assembly code: 17

Hours spent debugging the calculator: 8

assembly-rpn-calculator's People

Contributors

elewint avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.