sunzc / Compiler

0 stars 1 forks source link

Additional Methods in Register Manager.C #1

Open Arnab035 opened 7 years ago

Arnab035 commented 7 years ago

Hi Sun,

Are you going to use/add other functionality over register manager --> say methods for getting the base pointer register or say like getting the stack pointer/ global memory register ?

I just wanted to know because they seem to make the remaining implementations much easier ?

sunzc commented 7 years ago

So far, I fixed SP,BP,RA(Return Address Register) RV(Return Value Register) to certain registers. I use global variable to represent for ease of use.

Arnab035 commented 7 years ago

Can I add some helper methods over your class -> that returns the values of these registers when they are called ? -like get_stck_ptr_reg() that returns the register containing the stack pointer.

sunzc commented 7 years ago

stack_pointer is fixed to REG_SP(which is fixed to 901), as described in RegManager.C & .h,, You can copy code to your code base, then modify as necessary...