Anonymous user
Create an object at a given address: Difference between revisions
Create an object at a given address (view source)
Revision as of 03:24, 20 September 2023
, 8 months ago→{{header|COBOL}}: record restructure for simplicity
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
imported>Acediast (→{{header|COBOL}}: record restructure for simplicity) |
||
Line 360:
=={{header|COBOL}}==
▲{{works with|COBOL|2002}}
▲<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
▲ PROGRAM-ID. object-address-test.
77 int-space PICTURE IS 9(5) VALUE IS 12345.
▲ DATA DIVISION.
▲ LOCAL-STORAGE SECTION.
77 point
PROCEDURE DIVISION.
DISPLAY "Value of integer object : " int-space
SET point TO ADDRESS OF int-space
▲ 05 val PICTURE 9(5) VALUE ZERO.
DISPLAY "Machine address of object : " point
SET ADDRESS OF
DISPLAY "Value of referent object : " addr
MOVE
DISPLAY "New value of original : " addr
DISPLAY "New value of reference
GOBACK.
▲ END PROGRAM object-address-test.
Output:
<pre>
Value of integer object : 12345
Machine address of object : 0x0000563e11e77fd0
Value of referent object : 12345
New value of original : 65535
New value of reference : 65535
</pre>
=={{header|Commodore BASIC}}==
The <code>PEEK</code> and <code>POKE</code> commands allow the [[Commodore BASIC]] user to perform limited [[6502 Assembly]] operations.
|