Create an object at a given address: Difference between revisions

Content added Content deleted
m (→‎{{header|Tcl}}: make a bit easier to read, add comments)
(Forth)
Line 37: Line 37:
456
456
</pre>
</pre>

=={{header|Forth}}==
As an untyped language, specific machine addresses are very easy to represent in Forth. This is usually most useful for embedded targets.
<lang forth>
$3f8 constant LPT1:

LPT1: c@ .
$3f LPT1: c!
</lang>
Some architectures may require special fetch and store operators to access ports. For example, [[Open Firmware]] defines l@ and l! for safe 32-bit port writes.


=={{header|Tcl}}==
=={{header|Tcl}}==