RAM and ROM

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RAM and ROM

ysh443
Hi
on section 6.1 on TECS:
Three comments are in order here. First, note that the variable allocation assumption implies that the largest program that we can run is 1,024 instructions
long. Since realistic programs (like the operating system) are obviously much larger,
the base address for storing variables will normally be much farther.

but
if i correctlly understand, the program code resides on the ROM16K while the variables are stored on the RAM address range. so why should be aqny adress range restriction on the code size?

regards
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RAM and ROM

cadet1620
Administrator
ROM addressing and RAM addressing are completely independent in the Hack computer. The program is stored in ROM starting at address 0 and has 32K instructions available.

The first 16 RAM addresses are reserved for special usage that will be explained in later chapters. The remainder of the RAM is usable for program variables and call stack (also described later).

--Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RAM and ROM

ysh443
i understand and agree with your explanation
and thats what brought me to ask my question

why on chapter 6 on the cited paragraph, the builded symbol table is spilted to 2 ranges?
0-1023 for code labels and 1024 and up for variables?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RAM and ROM

ybakos
Section 6.1 Background is a description of the concept, rather than the actual Hack specification. This section describes mnemonic-to-bits translation of assembly language in general. To illustrate symbol resolution, the author is asking you to pretend that commands will get stored in addresses 0 - 1023 and variables stored in address 1024 on up. This is completely arbitrary, and is used only to express how code with symbols can be resolved (figure 6.1).
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RAM and ROM

cadet1620
Administrator
In reply to this post by ysh443
Never read that section of the book -- clearly it's describing a program in a single memory space computer.

--Mark
Loading...