ArticleslgStudy

computer science

Address constant

Address constant is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Address constant rather than just read about it. In short: In IBM System/360 through present day z/Architecture, an address constant or "adcon" is an assembly language data type which contains the address of a location in computer memory. An address constant can be one, two, three or four bytes long, although an adcon of less than four bytes is conventionally used to hold an expression for a small integer such as a length, a relative address, or an index value, and does not…

Key takeaways

  • Address constant belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Address constant to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Address constant from memory before moving on to harder problems.

Reference excerpt

In IBM System/360 through present day z/Architecture, an address constant or "adcon" is an assembly language data type which contains the address of a location in computer memory. An address constant can be one, two, three or four bytes long, although an adcon of less than four bytes is conventionally used to hold an expression for a small integer such as a length, a relative address, or an index value, and does not represent an address at all. Address constants are defined using an assembler language "DC" statement. Other computer systems have similar facilities, although different names may be used.

Types of address constants A adcons normally store a four byte relocatable address, however it is possible to specify the length of the constant. For example, AL1(stuff) defines a one-byte adcon, useful mainly for small constants with relocatable values. Other adcon types can similarly have length specification. V type adcons store an external reference to be resolved by the link-editor. Y is used for two byte (halfword) addresses. 'Y' adcons can directly address up to 32K bytes of storage, and are not widely used since early System/360 assemblers did not support a 'Y' data type. Early DOS/360 and BOS/360 systems made more use of Y adcons, since the machines these systems ran on had limited storage. The notation 'AL2(value)' is now usually used in preference to 'Y(value)' to define a 16 bit value. Q address constants contain not actual addresses but a displacement in the External Dummy Section – similar to the Linux Global Offset Table (see Position-independent code). A J adcon is set by the linkage editor to hold the cumulative length of the External Dummy Section, and does not actually contain an address. Other types of address constants are R which had special significance for TSS/360 to address the PSECT, and S, which stores an address in base-displacement format – a 16 bit value containing a four bit general register number and a twelve bit displacement, the same format as addresses are encoded in instructions. System z supports types AD, JD, QD, and VD, which represent 8 byte (doubleword) versions of types 'A', 'J', 'Q', and 'V' to hold 64 bit addresses.

Relocatability The nominal value of the 'DC' is a list of expressions enclosed in parentheses. Expressions can be absolute, relocatable, or complex relocatable. An absolute expression can be completely evaluated at assembly time and does not require further processing by the linkage editor. For example, DC A(4900796) has an absolute nominal value. A relocatable expression is one that contains one or more terms that require relocation by the linkage editor when the program ls linked, for example, in the following code 'ACON' has a relocatable nominal value.

LAB DC H'0' ... ACON DC A(LAB-4)

A complex relocatable expression contains terms that relate to addresses in different source modules. For example, DC A(X-Y) where 'X' and 'Y' are in different modules.

Examples All these are valid adcon's:-

ADCONS DS 0A an aligned label of implicit length 4 and actual length 0 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+displacement 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+displacement address of the program label "SUBRTNA" STAB DC SL2(SUBRTNA,SUBRTNB,SUBRTNC,.etc.) AN ARRAY OF unaligned S-TYPE ADCONS * 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 0Y start of (internal) sub-routine A . instructions go here . TABLES DS 0Y 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

See also Pointer (computer programming)

External links Assembly language DC instruction[link removed] IBM HLASM (High level assembler) on-line manual

Worked examples

Example 1 — a first encounter with Address constant

Start with the simplest possible case. Write down what Address constant claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Address constant before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Address constant ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Address constant

In research
Address constant appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Address constant in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Address constant is common in secondary-school and first-year university syllabi. It links to neighbouring topics Assembly languages, Data types, IBM software, so understanding it makes those chapters shorter.
In everyday life
Look for Address constant outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Address constant” →

How to study Address constant in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Address constant means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Address constant out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Address constant in simple terms?

In IBM System/360 through present day z/Architecture, an address constant or "adcon" is an assembly language data type which contains the address of a location in computer memory. An address constant can be one, two, three or four bytes long, although an adcon of less than four bytes is conventiona…

Why does Address constant matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Address constant?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Address constant.

Tags

  • Assembly languages
  • Data types
  • IBM software
  • Primitive types

Keep exploring