Where do the base addresses come from?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Where do the base addresses come from?

dansan
Hey all,

I've cheated with the base addresses, by looking at how they are setup in the VME files. For the life of me, the only base address that I could find in the book is the one for the stack (256), but I could not find the other base addresses used. Can someone point me to where these come from?

Thanks,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Where do the base addresses come from?

cadet1620
Administrator
As you saw, for project 7 the test scripts set up all the pointers so that your generated code can be tested.

I project 8 you will add bootstrap code to the beginning of your generated code that initializes the SP and calls Sys.init().

The code that is generated for the 'call' VM command sets ARG and LOCAL. (You'll become intimately acquainted with stack frames in Project 8.)

THIS and THAT are set up as needed by the VM code generated by the compiler. THIS is set to point to the current object at the beginning of every object method. THAT is used for various memory accesses like array indexing.

--Mark