Predefined Symbols table

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

Predefined Symbols table

T KARTHIKEYAN
RAM address for SP is the same as that of R0, wouldn't that create any error?
Reply | Threaded
Open this post in threaded view
|

Re: Predefined Symbols table

Lozminda
The short answer is, 'No.'

These are just naming conventions, which will make sense as you work through the book. The authors do this a lot, drop in stuff early that doesn't quite make sense until a couple of chapters later.

All will be revealed, have faith !

Lozminda
Reply | Threaded
Open this post in threaded view
|

Re: Predefined Symbols table

WBahn
Administrator
In reply to this post by T KARTHIKEYAN
Only if you try to use them for different things at the same time.

R0 through R15 are just names used to refer to the first 16 words in RAM for the purpose of making our assembly language programs easier to read for humans. The same for the beginning of screen memory and the keyboard.

As we move up the tool chain, we choose to dedicate some of those early memory addresses to specific uses and we choose to use names that are descriptive of those uses. In doing so, we are also making an agreement with ourselves that we won't use those same memory locations for anything else, regardless of what we call it.