How are labels and static variables implemented on hack?

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

How are labels and static variables implemented on hack?

BigBang
If we compile multiple classes or files of a program, we are creating the same names for labels and segments for each class (e.g. L1, L2, L3... or static 0, static 1... for each class).

The VMEmulator has no problem with this.

How would this have to be implemented if you don't use an emulator, but if you actually want to get it running on your own hack computer?
Reply | Threaded
Open this post in threaded view
|

Re: How are labels and static variables implemented on hack?

WBahn
Administrator
These are issues that are addressed by the VM Translator. Review the Naming Conventions that are summarized in Figure 8.6 (1ed or 2ed).