Create an object at a given address: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: added syntax colouring the hard way)
No edit summary
Line 50: Line 50:


It should be noted that on the 6502 processor hardware is normally memory mapped, so this is often used for manipulating hardware.
It should be noted that on the 6502 processor hardware is normally memory mapped, so this is often used for manipulating hardware.
=={{header|68000 Assembly}}==
First, an integer object will be created at address $100000:
<lang 68000devpac>MOVE.L #$12345678,$100000</lang>

Finding the address of a given object isn't actually possible in the same way it would be on [[C]], since anything loaded from an address is just a numeric copy and is not actually related in any way to the "object." The closest way is to label a memory address and load that label as a numeric constant.
<lang 68000devpac>myVariable equ $100000
MOVE.L #myVariable,D0
JSR printLong ;some unimplemented printing routine.</lang>

Creating a new object at that location is as simple as storing a new value there.
<lang 68000devpac>MOVE.L #$FFFFFFFF,myVariable</lang>



=={{header|Ada}}==
=={{header|Ada}}==