Meta Project

The Unofficial Meta Documentation

VOLATILE

Summary

VOLATILE Used in ATARI example. Protect against compiler optimizations for data that can be changed from outside causes.

Category

Categoryname

Refinements

This method has no refinements

Description

VOLATILE protect against compiler optimizations for data that can be changed from outside causes. Like in C, the "volatile" keyword indicates that a variable can be modified unexpectedly by external factors, and the compiler should not optimize or make assumptions about its behavior. It is often used for hardware registers, memory-mapped I/O, or shared variables accessed by multiple threads.

Example Code

Only use found so far (July 2023) is in the Atari example

; Define fixed memory addresses

Unsafe!!! constant reference volatile byte! [
	; Operating system software addresses

	...

	; Hardware addresses
	...
]

Related

CONSTANT  
REFERENCE  
UNSAFE!!!  

Back to the Meta Methods Reference index