Offset (computer science)

Offset (computer science)

In computer science, an offset within an array or other data structure object is an integer indicating the distance (displacement) from the beginning of the object up until a given element or point, presumably within the same object. The concept of a distance is valid only if all elements of the object are the same size (typically given in bytes or words).

For example, given an array of characters A, containing abcdef, one can say that the element containing the letter 'c' has an offset of 2 from the start of A.

In computer engineering and low-level programming (such as assembly language), an offset usually denotes the number of address locations added to a base address in order to get to a specific absolute address. In this (original) meaning of offset, only the basic address unit, usually the 8-bit byte, is used to specify the offset's size. In this context an offset is sometimes called a relative address.

In IBM System/360 instructions, a 12-bit offset embedded within certain instructions provided a range of between 0 and 4096 bytes. For example within an unconditional branch instruction (X'47F0Fxxx') the xxx 12bit hexadecimal offset provided the byte offset from the base register (15) to branch to. An odd offset would cause a program check (unless the base register itself also contained an odd address) - since instructions had to be aligned on half-word boundaries to execute without a program or hardware interrupt.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Reference (computer science) — This article is about a general notion of reference in computing. For the more specific notion of reference used in C++, see Reference (C++). In computer science, a reference is a value that enables a program to indirectly access a particular… …   Wikipedia

  • Integer (computer science) — In computer science, an integer is a datum of integral data type, a data type which represents some finite subset of the mathematical integers. Integral data types may be of different sizes and may or may not be allowed to contain negative values …   Wikipedia

  • Branch (computer science) — For other uses, see Branch (disambiguation). A branch is sequence of code in a computer program which is conditionally executed depending on whether the flow of control is altered or not (at the branching point). The term can be used when… …   Wikipedia

  • Offset — The term offset may refer to: Carbon offset, a financial instrument aimed at a reduction in greenhouse gas emissions Offset agreement, trade practice in Aerospace and Defense Industry Offset (computer science), a number indicating the distance… …   Wikipedia

  • Science fiction fanzine — A science fiction fanzine is an amateur or semi professional magazine published by members of science fiction fandom, from the 1930s to the present day. They were one of the earliest forms of fanzine, and at one time constituted the primary type… …   Wikipedia

  • Computer-Chip — Integrierter Schaltkreis. Das Chip Gehäuse wurde geöffnet und ermöglicht den Blick auf den eigentlichen Halbleiter. Die erkennbaren Strukturen im Zentrum sind die realisierte elektronische Schaltung. Im Außenbereich sind die goldenen… …   Deutsch Wikipedia

  • 2D computer graphics — is the computer based generation of digital images mdash;mostly from two dimensional models (such as 2D geometric models, text, and digital images) and by techniques specific to them. The word may stand for the branch of computer science that… …   Wikipedia

  • Mars Science Laboratory — mission 2011 concept artwork Operator NASA Major contractors Boeing Lockheed Martin …   Wikipedia

  • Glossary of environmental science — This is a glossary of environmental science.Environmental science is the study of interactions among physical, chemical, and biological components of the environment. Environmental science provides an integrated, quantitative, and… …   Wikipedia

  • Chevron Science Center — Coordinates: 40°26′45″N 79°57′27″W / 40.445825°N 79.957586°W / 40.445825; 79.957586 …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”