Anonymous user
Memory layout of a data structure: Difference between revisions
m
→[[Memory layout of a data structure#ALGOL 68]]: fix pre tag and update code
m (-Java) |
m (→[[Memory layout of a data structure#ALGOL 68]]: fix pre tag and update code) |
||
Line 62:
end record;</lang>
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|
{{
{{works with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d]}}
<lang algol68><lang algol68>MODE RSTWOTHREETWO = BITS;
INT ofs = bits width - 9;
INT
lwb rs232 = ofs + 1,
carrier detect = ofs + 1,
received data = ofs + 2,
transmitted data = ofs + 3,
data terminal ready = ofs + 4,
signal ground = ofs + 5,
data set ready = ofs + 6,
request to send = ofs + 7,
clear to send = ofs + 8,
ring indicator = ofs + 9,
upb rs232 = ofs + 9;
RSTWOTHREETWO rs232 bits :=
rs232 bits := bits pack((FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE));▼
▲rs232 bits := bits pack((FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE));
▲print(("received data: ",received data ELEM rs232bits))</lang>
print(("received data: ",received data ELEM rs232bits, new line))</lang>
Output:
<pre>
received data: T
</pre>
=={{header|C}}/{{header|C++}}==
|