Pop the top three elements of the stack add them and push


Assume that the top of the stack in a program is pointed to by the register SP.You are required to write program segments to perform each of the followingtasks (assume that only the following addressing modes are available:indexed, autoincrement, and autodecrement).

(a) Pop the top three elements of the stack, add them, and push the resultback onto the stack.

(b) Pop the top two elements of the stack, subtract them, and push the resultsback onto the stack.

(c) Push five elements (one at a time) onto the stack

(d) Remove the top five elements from the top of the stack.

(e) Copy the third element from the top of the stack into register R0.

Request for Solution File

Ask an Expert for Answer!!
Mechanical Engineering: Pop the top three elements of the stack add them and push
Reference No:- TGS02136402

Expected delivery within 24 Hours