assignment03

assignment03 - CSC402 - Assignment #3 Due in class...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSC402 - Assignment #3 Due in class Wednesday 10/5 Version 1.0 Introduction The goal is to implement an interpreter for an abstract stack machine lan- guage. Consider the following abstract stack machine bytecode instructions: push NUM- pushes the integer value NUM on the stack. push VAR- pushes the integer value stored in variable VAR on the stack. pop- pops the value on the top of the stack and discards it. print- pops the value on the top of the stack and prints it to the terminal screen. store VAR- pops the value on the top of the stack and stores it in the variable VAR. ask- asks the user for an input value and then pushes that value on the stack. dup- duplicate the value on the top of the stack; pop top of stack temp, then push temp, and push temp again. add- pop top of stack temp1, pop top of stack temp2, then push value temp2 + temp1. sub- pop top of stack temp1, pop top of stack temp2, then push value temp2 - temp1....
View Full Document

This note was uploaded on 10/03/2011 for the course CSC 402 taught by Professor Staff during the Fall '09 term at Rhode Island.

Page1 / 3

assignment03 - CSC402 - Assignment #3 Due in class...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online