RosettaCodeData/Task/Create-an-object-at-a-given-address/BBC-BASIC/create-an-object-at-a-given-address.basic
2023-07-01 13:44:08 -04:00

19 lines
621 B
Text

REM Create an integer object:
anInteger% = 12345678
PRINT "Original value =", anInteger%
REM Print the machine address of the object:
address% = ^anInteger%
PRINT "Hexadecimal address = ";~address%
REM Take the address of the object and create
REM another integer object at this address:
!address% = 87654321
REM Print the value of this object to verify
REM that it is same as one of the origin:
PRINT "New value =", anInteger%
REM Change the value and verify it again:
anInteger% = 55555555
PRINT "Final value =", !address%