Conceptually, a table is created internally. This table contains variable names, types, addresses, and values. The names, types and addresses are first established essentially during compilation, then as execution takes place space is reserved in memory and the variable values are put into memory cells reserved for the variables. A table could look like this for example
Variable name Variable type Memory cell address Variable value
month int FFF8 12
expense float FFF6 111.1
income float FFF2 100
After the fourth and fifth assignment statements have been executed, the table becomes
Variable name Variable type Memory cell address Variable value
month int FFF8 11
expense float FFF6 111.1
income float FFF2 82.1
You will find that the program's purpose is to continually change the values in the variable table.
No comments:
Post a Comment