Address constant
Encyclopedia
In IBM/360  an address constant or "adcon" is an Assembly language
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

 data type
Data type
In computer programming, a data type is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of...

 whose value refers directly to (or "points to") another value stored elsewhere in the computer memory
Computer memory
In computing, memory refers to the physical devices used to store programs or data on a temporary or permanent basis for use in a computer or other digital electronic device. The term primary memory is used for the information in physical systems which are fast In computing, memory refers to the...

 using its address
Memory address
A digital computer's memory, more specifically main memory, consists of many memory locations, each having a memory address, a number, analogous to a street address, at which computer programs store and retrieve, machine code or data. Most application programs do not directly read and write to...

. An address constant can be one, two, three or four bytes long (for IBM/360 architecture). It is defined using an assembler language "DC" statement using a type of A (or V if the adcon refers to an address outside of the current program module).

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 an aligned label of implicit length 4 (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 (* means 'here')
DC S(SUBRTNA) a 2 byte, aligned base+dislacement address of the program label "SUBRTNA"
DC X'47F0',S(SUBRTNA) an unconditional branch instruction (built using an S-type address constant)
DC SL2(SUBRTNA) a 2 byte, UNALIGNED base+dislacement address of the program label "SUBRTNA"
STAB DC SL2(SUBRTNA,SUBRTNB,SUBRTNC,.etc.) AN ARRAY OF unaligned S-TYPE ADCONS to several program labels
*
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
DC AL1(-1) a one byte negative value (= x'FF'), often used as a table de-limiter
.
SUBRTNA DS 0H start of (internal) sub-routine A
. instructions go here
.
TABLES DS 0H base address for tables section (halfword aligned)
LENGTHS DC Al2(5,27,56,83,127,32563) an arbitrary array of 6 x 2 byte hex lengths (defined by their decimal values)
PARMLIST DC A(HERE,THERE,EVWHERE,-1) an array of 3 x 4 byte aligned pointers to various field labels/entrypoints with additional negative value end-pointer (=X'FFFFFFFF').
.
ZERO_255 DC 256AL1(ZERO_255-*) an array of 256 single byte hex values 00-FF
* ---------end of adcon examples ---------------- *
FIELDA DC C'ABCDEFGHIJKLMNOPQRSTUVWXYZ' a field containing a character string (not an adcon) = A-Z
.

External references

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK