Jump to content

Address constant

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 86.142.120.161 (talk) at 13:10, 19 October 2009 (See also add link to external reference for DC instruction). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In IBM/360 (and through to present day z/Architecture), an address constant or "adcon" is a Assembly language data type whose value refers directly to (or "points to") another value stored elsewhere in the computer memory using its address. An address constant can be one, two, three or four bytes long for IBM/360 architecture. If the adcon is less than three bytes it is usually used to hold a 16bit integer such as a length, a relative address or some index value. If the adcon is a 'V' type, it addresses an external program entry point, resolved by the link-editor when the external module is included with the module making the reference.

IBM S/360 and z/Architecture Assembler example

All these are valid adcon's:-

ADCONS   DS    0A                     a 4 byte aligned label (for the next 4 byte address that follows it)
         DC    A(FIELDA)              a 4 byte word aligned absolute address of a variable 'FIELDA'
         DC    AL4(FIELDA)            as above but not (necessarily) aligned on a word boundary
         DC    AL3(FIELDA)            a three byte equivalent of the above (maximum 16 megabytes)
         DC    AL2(FIELDA-TABLES)     two byte offset from 'TABLES' label to start of 'FIELDA'
         DC    AL2(L'FIELDA)          a two byte length of the field called 'FIELDA' (=26 in decimal)
         DC    AL1(C'A')              hexadecimal value of the EBCDIC character 'A' (=C1 in hex)
         DC    A(FIELDA-C'A')         a 4 byte aligned absolute address 192 bytes before the start of FIELDA
         DC    A(*)                   a 4 byte aligned address of this adcon
INDIRECT DC    A(*+4)                 address of next byte after this adcon (the V-type adcon)
         DC    V(SUBRTNX)             address of an external subroutine entry point
.
SUBRTNA   DS    0H                    start of (internal) sub-routine A 
.
.
TABLES   DS    0H                     base address for tables section (halford aligned)
LENGTHS  DC    Al2(5,27,56,83,127,32563)        arbitary 2 byte hex lengths (defined by their decimal values)
FIELDA   DC    C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'    all the letters of the alphabet
ZERO_255 DC    256AL1(ZERO_255-*)               an array of 256 single byte hex values 00-FF
.

See also

Pointer (computer science)

External references