How implement both a push and pop instruction

Assignment Help Data Structure & Algorithms
Reference no: EM13699951

Question: A computer has 8 general purpose registers (R0 to R7) but does not have PUSH or POP instructions. The computer does have the register indirect with auto increment mode (post-inc) and register indirect with auto decrement mode (predec) for storing and loading to memory, as illustrated below (with pseudo-code comments):

LD R2, [R1]+ // R2->M[R1] // R1->R1 + 1

ST [R1]+, R2 // M[R1]->R2 // R1->R1 + 1

LD R2, -[R1]

// R1->R1 - 1 // R2->M[R1]

// R1->R1 - 1 // M[R1]->R2

Using some combination and sequence of these instructions, you are to show how implement both a PUSH and POP instruction where R7 is used as the stack pointer and R6 is used as the data register to push or pop.

Be sure to add comments. The comment should explain the purpose of the program and the data to be entered.

Reference no: EM13699951

Questions Cloud

Set all paragraph text to the hexadecimal color : Set all paragraph text for paragraphs nested inside div tags to the hex color #CC0000. (What color will they turn if they've already been told in step #1 to be #00E5EE? See the Hint!)
Calculate the percentage difference in the fundamental : Problem- Calculate the percentage difference in the fundamental vibration wave number of 23Na35Cl and 23Na37Cl on the assumption that their force constants are the same
How much water added to hydrochloric acid : Problem- Assuming volumes are additive, how much water (in mL) should be added to 30.8 mL of a 1.12 M solution of hydrochloric acid (HCl) to produce a 0.100 M solution
Find the corresponding rpn notation : Find the corresponding RPN notation and write the program using PUSH, POP, ADD, MUL, SUB, and DIV stack instructions.
How implement both a push and pop instruction : A computer has 8 general purpose registers (R0 to R7) but does not have PUSH or POP instructions. The computer does have the register indirect with auto increment mode (post-inc) and register
How much water should be added to sodium hydroxide : Problem- Assuming volumes are additive, how much water (in mL) should be added to 13.7 mL of a 2.35 M solution of sodium hydroxide (NaOH) to produce a 0.250 M solution
How many times will the cpu have to reference memory : How many times will the CPU have to reference memory in order to fetch and execute a two-word indirect addressing mode instruction (b) if the instruction is a JMP instruction?
Explain atomic number and mass number of the nuclide : Problem- Give the symbols for the nuclide that is formed in each of the following radioactive decays by indicating the atomic symbol, atomic number, and mass number of the nuclide.
Write the lisp functions : Write the subsequent LISP functions, add2, add5 and double, if they executed will produce the following results:

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  How to sort an array using insertion sort

How to sort an array using insertion sort and track teh number of swaps during the sorting - Can someone provide the answer with reference to data structure?

  Studying in major paralegal

Make a Microsoft Word document which includes a table and hyperlinks to Web sites helpful to someone studying in your main Paralegal.

  Determine the average complexity of an enqueue

question suppose we implement a priority queue as a heap. assume the queue has thousands of elements. suppose further

  Question about java programming

Define a class named Document that have an instance variable of type String named text that stores any textual content for the file. Design a technique named toString that returns the text field and also include a method to set this value.

  True or false about networking

2- A print queue must be set up for every printer on the network served by a print server. True False

  Explain advantages of eager decision tree algorithm

Explain advantages and disadvantages of new algorithm compared with eager decision tree algorithm, and advantages and disadvantages of new algorithm compared with lazy kNN algorithm.

  Using a linked implementation of graph prepare a method

using a linked implementation of graph prepare a method checkpath that takes two nodes as input. the method must

  Linked list class to hold a series of integers

1) Design your own linked list class to hold a series of integers. The class should have member functions for appending, inserting, and deleting nodes. Dont forget to add a destructor that destroys the list. Demonstrate the class with a driver progra..

  Time n-processor common crcw pram algorithm

present an O(1) time n-processor common CRCW PRAM algorithm for computing the boolean AND of n bits.

  You have been commissioned to prepare a manual covering the

in a 6-8-page paper complete the followingyou have been commissioned to create a manual covering the installation

  Draw an eer or er diagram for the conceptual design

Translate your EERD or ERD to tables. Clearly show the primary key, foreign keys, and alternate keys.

  Write the selection sort algorithm

Write the selection sort algorithm

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd