Undefined values: Difference between revisions

(C++ entry)
Line 3:
=={{header|6502 Assembly}}==
Every operation will return some 8-bit value, so there is no <code>null</code> in 6502 or anything like that. However, it is possible for certain actions to have '''undefined behavior''', for example, attempting to read from a write-only memory-mapped port might return any value from 0-255, depending on what was last on the data bus.
 
=={{header|68000 Assembly}}==
There is no "undefined" value as every instruction that is capable of altering the contents of a register will set the value of that register equal to some number between <tt>0</tt> and <tt>0xFFFFFFFF</tt>. Whether or not that value has any actual meaning, however, depends entirely on what action was taken. It is possible for certain actions to have '''undefined behavior''' such as:
* Reading from uninitialized memory (can return some garbage data that means nothing)
* Reading from a write-only hardware port
* Indexing an array out of bounds
 
In cases like these, what you get is dependent on what is stored at the memory read, or some other hardware-based factors out of the programmer's control. This is as close to an undefined value as you can really get.
 
=={{header|ActionScript}}==
1,489

edits