Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dim [2019/07/29 10:19]
neils
dim [2020/01/25 09:58] (current)
neils
Line 3: Line 3:
 Syntax: Syntax:
  
-  dim <any variable>​[<​byte or int x_dim> [, <byte or int y_dim>]] [fast]+  dim <any variable>​[<​const byte or int x_dim> [, <const byte or int y_dim>]] [fast | @<const int address>]
  
-The ''​DIM''​ directive defines a variable or an array. See the [[arrays|Arrays]] page for more information about arrays.+The ''​DIM''​ directive defines a variable or an array __in compile time__. See the [[arrays|Arrays]] page for more information about arrays.
  
 Variables do not need to be predefined, but the ''​DIM''​ directive allows you to do so. For example you can use ''​DIM''​ to define fast variables: Variables do not need to be predefined, but the ''​DIM''​ directive allows you to do so. For example you can use ''​DIM''​ to define fast variables:
Line 12: Line 12:
   ​   ​
 Read more about fast variables on the [[Variables|Variables]] page. Read more about fast variables on the [[Variables|Variables]] page.
 +
 +Since version 2.2, you can explicitly tell the compiler where in the memory the variable or array will reside, for example you can map the screen to an array as follows:
 +
 +  dim screen![1000] @ $0400
 +  ​