|
00000000 00000001 00000010 00000011 00000100 00000101 00000110 00000111 00001000 00001001 00001010 00001011 00001100 00001101 00001110 00001111 00010000 00010001 00010010 00010011 00010100 00010101 00010110 00010111 00011000 00011001 00011010 00011011 00011100 00011101 00011110 00011111 00100000 00100001 00100010 00100011 00100100 00100101 00100110 00100111 00101000 00101001 00101010 00101011 00101100 00101101 00101110 00101111 00110000 00110001 00110010 00110011 00110100 00110101 00110110 00110111 00111000 00111001 00111010 00111011 00111100 00111101 00111110 00111111 .... (And so on...) 1 bit can hold 21 = 2 different patterns: 0 1 2 bits can hold 22 = 4 different patterns: 00 01 10 11 .. 8 bits can hold 28 = 256 different patterns: see above |
|
|
|
|
There are no markers in the memory to denotate where the address item are located and how big they are (how many bytes are used to hold the value of the item - short: 2 bytes, int 4 bytes, etc) !!!
The compiler will find an unused portion of consecute memory bytes to store the variable.
In addition, the starting location (= address) of the allocated memory and the size (number of bytes) are remembered by the compiler.
Schematically:
in its symbol table variable
(Remember, the compiler is a program and a program can have variables... The symbol table is one of the many variables used to write a compiler...)
The compiler needs to find the variable !!!!