A computer has 8 general purpose registers r0 to r7 but


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.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: A computer has 8 general purpose registers r0 to r7 but
Reference No:- TGS0953237

Expected delivery within 24 Hours