Ada Programming/Attributes/'Address

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Ada Lovelace 1838.jpg

Contents


[edit] Description

X'Address is an Ada attribute where X is any object, subprogram, package, task, label or other entity.

'Address may be used to return the address of the first element allocated to X. 'Address may also be used to set the address of X.

[edit] Example

   -- Hardware register
   Device_Input_Value : Integer_32;
   for Device_Input_Value'Address use To_Address (16#8000_05C4#);
<<Entry_Point>>    -- Label
   for Entry_Point'Address use To_Address (16#0000_003A#);

[edit] See also

[edit] Wikibook

[edit] Ada Reference Manual