Differences

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

Link to this comparison view

poke [2019/05/07 22:28]
neils created
poke [2019/05/07 22:32] (current)
neils
Line 5: Line 5:
  poke <int address>, <byte or int value>  poke <int address>, <byte or int value>
  
-The ''POKE'' command stores a value into the given memory address. Both the address and the value are integers, thus the following conversions will be made:+The ''POKE'' command stores a value into the given memory address. The following type conversions are possible:
  
-- The address will be recognized as an unsigned integer, or if it'an expression, a signed integer will be converted to unsigned +  * ''address'' will be recognized as an unsigned integer 
-- The value will be truncated to 8 bits+  * if ''value'' is an integer, it will be truncated to a byte
  
 Examples: Examples:
  
- rem ** turn border to black ** +  rem ** turn border to black ** 
- poke 53280, 0 +  poke 53280, 0 
-  +    
- rem ** unsigned conversion ** +  rem ** unsigned conversion ** 
- let x = -5 +  let x = -5 
- poke x, 0 +  poke x, 0 
- rem ** which will effectively be the same as: +  rem ** which will effectively be the same as: 
- poke 65531,0 +  poke 65531,0 
-  +   
- rem ** values are truncated to 8 bits - the MSB is discarded ** +  rem ** values are truncated to 8 bits - the MSB is discarded ** 
- poke 53280, 65535 +  poke 53280, 65535 
- rem ** will be the same as +  rem ** will be the same as 
- poke 53820, 255+  poke 53820, 255