JPH02306339A - Bit addressing system - Google Patents

Bit addressing system

Info

Publication number
JPH02306339A
JPH02306339A JP2030697A JP3069790A JPH02306339A JP H02306339 A JPH02306339 A JP H02306339A JP 2030697 A JP2030697 A JP 2030697A JP 3069790 A JP3069790 A JP 3069790A JP H02306339 A JPH02306339 A JP H02306339A
Authority
JP
Japan
Prior art keywords
address
bit
field
addressing
bits
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2030697A
Other languages
Japanese (ja)
Inventor
Hiroaki Suzuki
宏明 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2030697A priority Critical patent/JPH02306339A/en
Publication of JPH02306339A publication Critical patent/JPH02306339A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain address calculation at a short time by providing a displacement field and a base address field in an addressing operand. CONSTITUTION:An address 501 in byte unit is obtained from the base address field 4021 in the addressing operand 402 of a bit string extraction instruction 400. On the other hand, an address 503 in bit unit obtained from the field 4022 is shifted to a side lower by three bits in a shifter/code expansion unit 504 and high-order bits are supplied to an adder 502. It generates the effective address 505 of bytes, which include target bits, and three bits which are not supplied from the shifter/code expansion device 504 to the adder turn into bit offsets 506. Thus, the effective byte address and the bit offsets can simultaneous ly be obtained and therefore, the address calculation time is shortened.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、情報処理装置におけるアドレシング方式、特
にビット単位のアクセスを行なうビットアドレシング方
式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an addressing method in an information processing device, and particularly to a bit addressing method that performs bit-by-bit access.

〔従来の技術〕[Conventional technology]

一般に、コンピュータを使用してデータを処理する場合
には、データがどこに、どのような形で存在しているか
の約束を決めている。どこにあるかの指定方法をアドレ
シングと言い、どのような形で存在するかの約束をデー
タ参タイプと言う。
Generally, when a computer is used to process data, it is determined where and in what form the data exists. The method of specifying where something is located is called addressing, and the promise of how it exists is called data reference type.

これらの約束に応じて記述された命令にしたがって、デ
ータがアクセスされ、データの内容が解釈−演算・転送
される。
Data is accessed, and the contents of the data are interpreted, operated on, and transferred in accordance with instructions written according to these conventions.

メモリに対するアドレシングの最小単位は、通常1バイ
ト(8ビツト)である。すなわち、メモリは単なるバイ
トの列として定義され、データはそのバイト会アドレス
によってアクセスされる。
The minimum unit of addressing for memory is usually one byte (8 bits). That is, memory is defined as simply a string of bytes, and data is accessed by its byte group address.

バイト・アドレスとは、バイトの位置を一意的に指定す
る値である。
A byte address is a value that uniquely specifies the location of a byte.

命令形式は、一般にオペレーションを示す命令コードと
、命令操作の対象となるオペレーションデータを指定す
るアドレシング・オペランドとの並びからなる。アドレ
シング・オペランドは複数のフィールドを有し、これら
の組み合わせで様々なアドレシング・モードが指定され
る。アドレシング・オペランドの一つのフィールドはベ
ース・アドレス参フィールドとして割り当てられ、オペ
レーション・データ指定のためのベース・アドレスが直
接記述されているか又は同アドレスをストアしているレ
ジスタを指定する情報が記述されている。他のフィール
ドはディスプレースメント・フィールドとしてベース・
アドレスに対する変位情報が記述されている。ディスブ
レースメン)−フィールドの代わりにインデクスφフィ
ールドが用いられる場合があり、同フィールドは」二記
変位情報をストアしているインデクス・レジスタを指定
する情報が記述されている。さらには、ディスプレース
メント・フィールドとインデクス・フィールドとの両方
を含む場合もあれば、二つのディスブレースメンド・フ
ィールドを含む場合もある。これらのフィールドによっ
て得られるアト1/ス情報から、指定されたアドレシン
グ・モードに従ってオペレーションデータアクセスのた
めの実効アドレスが生成されるわけであるが、いずれの
モードにおいても実効アドレスの最小単位は前述のよう
にバイト・アドレスとなっている。
An instruction format generally consists of a sequence of an instruction code indicating an operation and an addressing operand specifying operation data to be manipulated by the instruction. The addressing operand has multiple fields, and various addressing modes are specified by combinations of these fields. One field of the addressing operand is assigned as a base address reference field, in which the base address for specifying operation data is directly written, or information specifying the register storing the same address is written. There is. Other fields are used as displacement fields.
Displacement information for the address is described. An index φ field may be used instead of the displacement field, and this field describes information specifying the index register storing the displacement information. Furthermore, it may include both a displacement field and an index field, or it may include two displacement fields. From the address information obtained from these fields, an effective address for operation data access is generated according to the specified addressing mode, but in any mode, the minimum unit of the effective address is the above-mentioned address. This is a byte address.

一方、情報処理装置(マイクロプロセッサ)が実行する
命令の中にはビット単位のアドレシングを必要とするも
のがある。その典型的な例がビット・フィールド命令で
ある。この命令はメモリ中の任意の位置にある(したが
ってバイト境界にあるとは限らない)ビットを先頭ビッ
トとする任意の長さのビット列(ビット・フィールド)
に対し、抽出、挿入、比較等の操作を実行する命令であ
る。例えば、ビット列抽°出命令はメモリ中の指定され
たビットを先頭として指定された長さのビット列のデー
タを抽出し指定されたレジスタに転送するものであり、
ビット列挿入命令は指定されたレジスタの中の指定され
た長さのビット列のデータをメモリ中の指定されたビッ
トを先頭ビットとして対応する長さのビット列に挿入す
るものである。したがって、ビット拳フィールド命令の
実行にあたってはメモリ中の任意のビットをアドレシン
グする必要がある。
On the other hand, some instructions executed by an information processing device (microprocessor) require bit-by-bit addressing. A typical example is a bit field instruction. This instruction creates a bit string (bit field) of arbitrary length, starting with a bit located at an arbitrary location in memory (and therefore not necessarily on a byte boundary).
These are instructions that perform operations such as extraction, insertion, and comparison. For example, a bit string extraction instruction extracts a bit string of a specified length starting from a specified bit in memory and transfers it to a specified register.
The bit string insertion instruction inserts data of a bit string of a specified length in a specified register into a bit string of a corresponding length in memory, with the specified bit as the leading bit. Therefore, when executing a bit field instruction, it is necessary to address an arbitrary bit in memory.

ところが、前述のようにアドレシング・オペランドによ
って生成される実効アドレスの最小単位はバイト・アド
レスとなっているため、ビット・フィールド命令のアド
レシング−オペランドは操作すべきビット列の先頭ビッ
トを有するバイト・データのバイト・アドレスしか指定
できない。このためビット拳フィールド命令の中に、操
作すべきビット列の先頭ビットの位置を指定するための
情報を有するビット拳オフセット・オペランドをさらに
設ける必要がある。例えば、ビット列抽出命令のフォー
マットを第4図に示すにうに、同命令200は、ビット
列抽出命令であることを示す命令コード201、アドレ
シング・オペランド202、抽出すべきビット長情報を
示すレングス・オペランド204、および抽出したデー
タの格納先情報を示すデスティネーシヨン・オペランド
205のほかに、アドレシング・オペランド202の情
報を使って生成される実効アドレスの最小単位が抽出す
べきビット列の先頭ビットを含むバイトφデータの境界
であるためにその境界から抽出すべき先頭ビットまでの
オフセット情報を示すビット・オフセット拳オペランド
203をさらに有している。これら二つのオペランド2
02.203を用いて抽出すべき先頭ビットの実効アド
レスを生成し、ビット・アドレシングを行なっている。
However, as mentioned above, the minimum unit of the effective address generated by the addressing operand is the byte address, so the addressing operand of the bit field instruction is the byte data containing the first bit of the bit string to be manipulated. Only byte addresses can be specified. For this reason, it is necessary to further provide a bitwise offset operand having information for specifying the position of the first bit of the bit string to be manipulated in the bitwise field instruction. For example, as shown in FIG. 4, the format of a bit string extraction instruction 200 includes an instruction code 201 indicating that it is a bit string extraction instruction, an addressing operand 202, and a length operand 204 indicating bit length information to be extracted. , and the destination operand 205 indicating the storage location information of the extracted data, the minimum unit of the effective address generated using the information of the addressing operand 202 is the byte φ containing the first bit of the bit string to be extracted. Since this is a data boundary, it further includes a bit offset operand 203 that indicates offset information from the boundary to the first bit to be extracted. These two operands 2
02.203 is used to generate the effective address of the first bit to be extracted, and bit addressing is performed.

ハードウェア上でのかかるアドレシングについて第5図
を参照して説明する。メモリからフェッチされたビット
列抽出命令200の命令コード201は命令デコーダに
よって解読され、一方、アドレシング・オペランド20
2は実効アドレス生成装置(図示せず)に転送される。
Such addressing on hardware will be explained with reference to FIG. The instruction code 201 of the bit string extraction instruction 200 fetched from memory is decoded by the instruction decoder, while the addressing operand 20
2 is transferred to an effective address generation device (not shown).

同装置は、アドレシング・オペランド202内の前述し
たベース会アドレス参フィールドとディスプレースメン
ト・フィールドおよび/またはインデクス争フィールド
との情報にもとづき、抽出すべきビット列の先頭ビット
を含むバイト。データのパイ)拳7)’tzスヲ示ス実
効バイト・アドレス301を生成する。このアドレス3
01によってメモリがアクセスされ、データがプロセッ
ザ内に取り込まれる。
The device extracts the byte containing the first bit of the bit string to be extracted based on the information of the base address reference field, displacement field, and/or index conflict field in the addressing operand 202. Generate an effective byte address 301 indicating the data pie7)'tz. this address 3
01 accesses memory and retrieves data into the processor.

ビット・オフセット舎オペランド203も実効アドレス
生成装置に送られ、ビット争オフセットの実効アドレス
302が生成される。実効アトi/ス302は、実効ア
ドレス301によってロードされたデータの先頭から目
的のビットまでの距離を示す。なお、レングスφオペラ
ンド204で指定される値は、抽出すべきデータの長さ
303を表す。
The bit offset operand 203 is also sent to the effective address generator to generate the bit conflict offset effective address 302. The effective address 302 indicates the distance from the beginning of the data loaded by the effective address 301 to the target bit. Note that the value specified by the length φ operand 204 represents the length 303 of the data to be extracted.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来のアドレシングでは、二つのオペランド(アドレシ
ング・オペランド202およびビット・オフセット・オ
ペランド203)を用いる2アドレシング・モードでビ
ット・アドレシングが行なわれるので、アドレス計算に
時間がかがる。
In conventional addressing, bit addressing is performed in a two-addressing mode using two operands (addressing operand 202 and bit offset operand 203), so that address calculation takes time.

すなわち、アドレシング・オペランド202により実効
バイト・アドレス301が生成され、必要な処理が行な
われる。その後、ビット・オフセット・オペランド20
3によりビット位置の実効アドレス302が生成される
。したがって、ビット・オフセット・オペランド203
による処理は、アドレシング壷オペランド202による
処理が終わるまで、行なえず、全体としてアドレス計算
に時間がかかる。
That is, an effective byte address 301 is generated by the addressing operand 202, and necessary processing is performed. Then bit offset operand 20
3 generates the effective address 302 of the bit position. Therefore, the bit offset operand 203
The processing cannot be performed until the processing by the addressing urn operand 202 is completed, and it takes a long time to calculate the address as a whole.

また、オペランド毎にそれぞれアドレシング・モードが
指定できる場合に、バイト−アドレスとビット・オフセ
ットとがそれぞれ別のオペランドで指定されるとき、ビ
ット・オフセットは自由にアドレシング・モードが選択
できるが、その用途や特性から、実際に用いられるのは
数種類にすぎず、冗長な機能が多いことになる。
In addition, when an addressing mode can be specified for each operand, and byte-address and bit offset are specified by separate operands, the addressing mode for bit offset can be freely selected, but its purpose is Due to their characteristics, only a few types are actually used, and many of them have redundant functions.

更に、ビット・オフセットがデータ・バス幅より大きい
値、あるいは負の値を取ることが許されると、目的とす
るデータはロードされたデータ中になく、無効なデータ
をアクセスしたことになる。ビット・オフセットの値は
O以上データーバス幅によって決まる値未満に制限せざ
るをえない。
Furthermore, if the bit offset is allowed to take a value larger than the data bus width or a negative value, the target data is not in the loaded data and invalid data is accessed. The value of the bit offset must be limited to O or more and less than the value determined by the data bus width.

したがって、本発明の目的は、アドレス計算が短時間に
できるビット・アドレシング方式を提供することである
SUMMARY OF THE INVENTION Therefore, it is an object of the present invention to provide a bit addressing scheme that allows address calculation to be performed in a short time.

〔課題を解決するための手段〕[Means to solve the problem]

本発明によるビット・アドレシング方式においては、ア
ドレシング・オペランドだけで目的とするビットの実効
アドレスが生成される。すなわち、実行すべき命令がビ
ット・フィールド命令のようなビット・アドレシングを
必要とする命令のときは、アドレシング・オペランド中
のインデクス◆フィールドおよびディスプレースメント
・フィールドで指定される値は、ベース・アドレス6フ
イールトで指定すれるベース拳アドレスのバイト境界か
ら目的とするビットまでの距離を2の補数表現で示され
た値とされる。この値をその下位ビット方向にMビット
シフトし、シフトした値ヲベース・アドレス・フィール
ドで指定されるベース拳アドレスに加算して、実効バイ
ドパドレスと目的とするビットのビット争オフセットと
を生成する。
In the bit addressing scheme according to the present invention, the effective address of the desired bit is generated using only the addressing operand. In other words, when the instruction to be executed requires bit addressing, such as a bit field instruction, the values specified in the index field and displacement field in the addressing operand are based on the base address 6. The distance from the byte boundary of the base address specified by the field to the target bit is expressed as a value expressed in two's complement. This value is shifted M bits in the direction of its lower bits, and the shifted value is added to the base address specified in the base address field to generate an effective bid pad address and a bit conflict offset for the target bit.

したがって、一つのオペランドで目的とするビットを有
するバイトの実効バイト争アドレスと、このベース−ア
ドレスからの目的とするビットまでの変位であるビット
Φオフセットとの二つの実効アドレスを同時に生成でき
る。ビット・オフセットの指定範囲は  2N−1ピッ
 トから(+2N−’−1)ビットであり、ビット・ア
ドレスとして2N4Mビットの範囲を指定することがで
きる。
Therefore, one operand can simultaneously generate two effective addresses: an effective byte conflict address of a byte having a target bit, and a bit Φ offset that is the displacement from this base address to the target bit. The specified range of the bit offset is from 2N-1 bits to (+2N-'-1) bits, and a range of 2N4M bits can be specified as the bit address.

〔実施例〕〔Example〕

次に、本発明の一実施例を示した図面を参照して、本発
明の詳細な説明する。
Next, the present invention will be described in detail with reference to the drawings showing one embodiment of the present invention.

第1図Aを参照すると、本発明の一実施例としてビット
−フィールド命令の中の特にビット列抽出命令400の
フォーマットが示されている。
Referring to FIG. 1A, the format of a bit string extraction instruction 400 among bit-field instructions is shown as an embodiment of the present invention.

この命令400は、アドレシング・オペランド402、
抽出すべきビット列の長さ情報を示すレングス拳オペラ
ンド403、および抽出されたビット列のデータの転送
先情報を示すデスティネーシロン会オペランド404を
有しており、第4図のようにビット・オフセット−オペ
ランド203を有していない。アドレシング・オペラン
ド402は、第1図Bのようにベース・アドレス壷フィ
ールド4021とディスプレースメントφフィールド4
022とを有する。ビット−アドレシングが不要な命令
の場合は、これら二つのフィールド4021.4022
によって決定されるアドレス情報は前述のとおりバイト
単位のアドレス情報であり、これらによって生成された
実効アドレスの最小単位はバイト・アドレスとなる。
This instruction 400 includes addressing operands 402,
It has a length operand 403 indicating the length of the bit string to be extracted, and a destination operand 404 indicating the transfer destination information of the data of the extracted bit string, and as shown in FIG. It does not have an operand 203. Addressing operand 402 includes base address urn field 4021 and displacement φ field 4 as shown in FIG. 1B.
022. For instructions that do not require bit-addressing, these two fields 4021.4022
The address information determined by is address information in bytes as described above, and the minimum unit of the effective address generated by these is a byte address.

一方、ビット・フィールド命令の場合は、フィールド4
022によって決定される値は、ベース争アドレス・フ
ィ・−ルド4021によって決定されるバイト単位のベ
ース争アドレスから目的とするビットまでの距離を2の
補数表現で示した値とみなされ、目的とするビットを含
むバイトの実効バイト・アドレスとそのアドレスの先頭
ビットから目的とするビットまでの実効オフセッl−−
アドレスが同時に生成される。本例においては、ベース
・アドレス拳フィールド4021によってバイト単位の
アドレスが決定されるので、フィールド4022で示さ
れるデータの下位3ビツトは上記実効オフセット−アド
レスとして利用され、残りのビットで決定される情報は
フィールド4021によって指定される情報と組み合わ
せて、目的とするビットを含むバイトの実効バイト拳ア
ドレスを生成する。
On the other hand, in the case of a bit field instruction, field 4
The value determined by 022 is regarded as a value indicating the distance from the base contention address in bytes determined by the base contention address field 4021 to the target bit in two's complement representation, and is determined by the base contention address field 4021. The effective byte address of the byte containing the bit to be processed and the effective offset from the first bit of that address to the desired bit.
Addresses are generated at the same time. In this example, since the address in bytes is determined by the base address field 4021, the lower three bits of the data shown in the field 4022 are used as the effective offset address, and the information determined by the remaining bits is used as the effective offset address. is combined with the information specified by field 4021 to generate the effective byte address of the byte containing the desired bit.

すなわち、ビット列抽出命令400がメモリからフェッ
チされると、その命令コード401はデコーダ(図示せ
ず)で解読され、一方、アドレシング・オペランド40
2は第2図に示す実効アドレス生成装置に供給される。
That is, when a bit string extraction instruction 400 is fetched from memory, its instruction code 401 is decoded by a decoder (not shown) while addressing operand 40
2 is supplied to the effective address generation device shown in FIG.

アドレシング・オペランド402内のベース−アドレス
拳フィールド4021から32ビツトのバイト単位アド
レス501が得られ、加算器502の左入力に供給され
る。一方、アドレシング・オペランド402内のフィー
ルド4022から得られるアドレス情報はビット単位の
アドレス503として用いられ、シフタ/符号拡張器5
04に供給される。このシフタ/符号拡張器504は、
ビット単位アドレス503を3ビツト下位側にシフトし
、かつアドレス503の最上位ビット、すなわち符号ビ
ットと同じデータを3ビツト分上位側に付加して計35
ビットのアドレス情報を生成する。かくして生成された
アドレスの上位32ビツト(ビット番号34乃至3)は
加算器502の右入力に供給される。加算器502は左
右両人力を加算し、32ビツトのアドレス505を生成
する。したがって、アドレス505は、目的とするビッ
トを含むバイトの実効アドレスとなる。シフタ/符号拡
張器504から加算器502に供給されない3ビツト(
ビット番号2乃至O)は目的とするビットの実効バイト
−アドレスに対するオフセット506となる。かくして
、一つのアドレシング・オペランド402から実効アド
レスとビット・オフセットとが同時に得られ、ビット−
アドレシングが可能となる。レングス・オペランド40
3の情報はアドレシングされたビットを先頭ビットとし
て抽出すべきビット列の長さを指定する。
A 32-bit byte-wise address 501 is derived from the base-address field 4021 in addressing operand 402 and provided to the left input of adder 502. On the other hand, the address information obtained from the field 4022 in the addressing operand 402 is used as a bit-wise address 503 and
04. This shifter/sign extender 504 is
Shift the bit unit address 503 to the lower side by 3 bits, and add the same data as the most significant bit of the address 503, that is, the sign bit, to the upper side for a total of 35 bits.
Generate bit address information. The upper 32 bits (bit numbers 34 to 3) of the address thus generated are supplied to the right input of adder 502. An adder 502 adds the power of both the left and right hands and generates a 32-bit address 505. Therefore, address 505 becomes the effective address of the byte containing the desired bit. The 3 bits (
Bit numbers 2 through O) are the offset 506 to the effective byte-address of the target bit. Thus, the effective address and bit offset can be obtained simultaneously from a single addressing operand 402, and the bit-
Addressing becomes possible. length operand 40
Information 3 specifies the length of the bit string to be extracted with the addressed bit as the leading bit.

上述のアドレシング方式とメモリ上のデータとの関係を
示したのが第3図である。すなわち、バイト単位アドレ
ス501はメモリ上の所定のバイトを示すベース・アド
レスを示しており、ビット単位アドレス503は、その
ベースOアドレスの先頭ビットから目的とするビットま
での距離(すなわちビット数)を示している。したがっ
て、加算器502の出力アドレス505は、目的とする
ビットを含むバイトの実効バイト拳アドレスとなり、5
06は目的とするビットまでのビット拳オフセットとな
る。
FIG. 3 shows the relationship between the above-mentioned addressing method and data on the memory. That is, the byte unit address 501 indicates a base address indicating a predetermined byte on the memory, and the bit unit address 503 indicates the distance (i.e., the number of bits) from the first bit of the base O address to the target bit. It shows. Therefore, the output address 505 of the adder 502 is the effective byte address of the byte containing the target bit, which is 5
06 is the bit offset to the target bit.

次に、具体的な例として、メモリ上のバイト−アドレス
“OOOOOO13H“のビット番号5乃至7の3ピツ
)−データを抽出し、汎用レジスタR6に転送するビッ
ト列抽出命令を考えてみる。本例では、アドレシングφ
オペランド402のベース自アドレス舎フィールド40
21は、メモリ」二のバイト・アドレス” 00000
010H#をすでにストアしている汎用レジスタR1を
利用する。したがって、フィールド4021はベース・
アドレス・レジスタ指定フィールドとなり、汎用レジス
タR1の指定コード″00001、B#が記述される。
Next, as a specific example, consider a bit string extraction instruction that extracts data on the memory (3 bits of bit numbers 5 to 7 of the byte address "OOOOOO13H") and transfers it to the general-purpose register R6. In this example, addressing φ
Base own address field 40 of operand 402
21 is the memory “second byte address” 00000
Use general-purpose register R1 that already stores 010H#. Therefore, field 4021 is based on
This field becomes an address/register designation field, and the designation code "00001, B#" for general-purpose register R1 is written therein.

勿論、イミディエイト指定してもかまわない。フィール
ド4022はディスプレースメント・フィールドとして
用いられるため、そこには、ベース働アドレスから目的
とするビットまテ’)#m’ OOOOOOL D H
” カ記述されている。インデクス拳フィールドとして
用いられるときは、そのデータがストアされているイン
デクス・レジスタの指定コードが記述される。
Of course, you can also specify immediate. Field 4022 is used as a displacement field, so it contains the desired bit data from the base working address ')#m' OOOOOOOL D H
When used as an index field, the designation code of the index register in which the data is stored is written.

レングス・オペランド403の内容はイミディエイト指
定の場合は#00000003H“となるが、レジスタ
指定でもよい。デスティネーション拳オペランド404
は汎用レジスタR8の指定コード#0OOOOB“が記
述される。かかる情報が記述されたビット列抽出命令が
実行されると、ベース・アドレスφレジスタ指令フィー
ルド4021によって第6図に示すアドレス情報501
′がレジスタR8から読み出され加算器502の左入力
に供給される。一方、ディスプレースメントΦフィール
ド4022の内容はシフタ/符号拡張器504に供給さ
れ、その出力504′は第6図に示すようになる。その
出力の上位32ビツトは加算器502に供給されて50
1′と加算される。その加算結果は第6図の505′で
示され、目的とするビットを含む実効バイト・アドレス
” 00000013H“が得られる。そして、504
’の下位3ビツト″101B“はビット番号5を指定す
るオフセット−アドレスとなる。レングス情報507′
は“3H“である。かくして、バイト・アドレス#00
000013H“の中のビット番号5乃至7のデータが
抽出され汎用レジスタR8のビット番号5乃至7にそれ
ぞれ転送される。
The content of the length operand 403 is "#00000003H" if an immediate is specified, but a register may also be specified. Destination fist operand 404
The designation code #0OOOOB" of general-purpose register R8 is written. When the bit string extraction instruction in which such information is written is executed, the address information 501 shown in FIG.
' is read from register R8 and provided to the left input of adder 502. Meanwhile, the contents of displacement Φ field 4022 are provided to shifter/sign extender 504, whose output 504' is as shown in FIG. The upper 32 bits of that output are fed to an adder 502 and
1' is added. The result of the addition is shown at 505' in FIG. 6, and an effective byte address "00000013H" containing the target bit is obtained. And 504
The lower three bits ``101B'' of ``101B'' become an offset address specifying bit number 5. Length information 507'
is "3H". Thus, byte address #00
Data of bit numbers 5 to 7 in "000013H" are extracted and transferred to bit numbers 5 to 7 of general-purpose register R8, respectively.

フィールド4022から得られる値は2の補数表現であ
るので、ベース参バイト・アドレスに対し若いアドレス
のビットに対してもアドレシングが可能となる。例えば
、ベース参バイト・アドレスを上述のように” 0OO
OOOIOH”とし、目的とするビット列の先頭ビット
がバイト・アドレス” 0OOOOOOEH”のビット
番号4とすればフィールド4022から得られる値を7
1 F FF F F F F 4 H#とすればよい
。その結果、加算器502の出力は#0OOOOOOE
H”となり、シック504からの下位3ビツトは“10
0B#となる。
Since the value obtained from field 4022 is expressed in two's complement, it is possible to address even bits of an address smaller than the base reference byte address. For example, set the base reference byte address as ``0OO'' above.
If the first bit of the target bit string is bit number 4 of the byte address "0OOOOOOEH", then the value obtained from field 4022 is 7.
1 F FF FF FF 4 H# may be used. As a result, the output of adder 502 is #0OOOOOOOE
H”, and the lower 3 bits from chic 504 are “10”.
It becomes 0B#.

フィールド4022としては、インデクスおよびディス
プレースメントの両方が用いられる場合があり、この場
合は両フィールドから得られる値の加算値が、ベース働
アドレスから目的とするビットまでの距離とされる。二
つのディスプレースメントが用いられる場合は、ベース
eアドレス・フィールドと第一ディスプレースメント・
フィールドとから得られるバイト・アドレスのメモリの
データがベース・アドレスとして用いられ、同アドレス
から目的とするビットまでの距離を第二のディスプレー
スメント・フィールドで得られる値とされる。
Both an index and a displacement may be used as the field 4022, and in this case, the sum of the values obtained from both fields is the distance from the base working address to the target bit. If two displacements are used, the base e-address field and the first displacement
The data in the memory of the byte address obtained from the field is used as a base address, and the distance from the same address to the target bit is determined as the value obtained from the second displacement field.

そして、実行すべき命令がビット−フィールド命令のよ
うなビット・アドレシングを必要としない場合は、フィ
ールド4021および4022は両方ともバイト単位ア
ドレスとして、最小単位をバイトとするアドレシングが
行なわれる。そのアドレシング・モードとしては次のも
のがある。
If the instruction to be executed does not require bit addressing such as a bit-field instruction, fields 4021 and 4022 are both byte-unit addresses, and addressing is performed with the minimum unit being a byte. The addressing modes include:

■レジスタ間接インデクス付きモード:ベース争アドレ
スと、ベース会アドレスからのインデクス値(またはビ
ット・オフセット)の二つの値から計算される実効アド
レスにあるデータを指定するアドレシング争モードであ
る。
■Mode with register indirect index: This is an addressing contention mode that specifies data at an effective address calculated from two values: a base contention address and an index value (or bit offset) from the base address.

■ディスプレースメント・モード: ベース・アドレスとベース−アドレスからのディスプレ
ースメント(またはビット・オフセット)との二つの値
から計算される実効アドレスにあるデータを指定するア
ドレシング・モードである。
■Displacement mode: This is an addressing mode that specifies data at an effective address calculated from two values: a base address and a displacement (or bit offset) from the base address.

■ディスプレースメント・インデクス付きモードベース
・アドレスと、ベース・アドレスからのディスプレース
メントと、ベース拳アドレスからのインデクス値(また
はビット拳オフセット)との三つの値から計算される実
効アドレスにあるデータを指定するアドレシングeモー
ドである。
■Mode with displacement index Specify the data at the effective address calculated from three values: the base address, the displacement from the base address, and the index value (or bit offset) from the base address. This is the addressing e mode.

■PC相対ディスプレースメント・モード:ディスプレ
ースメント・モードと比較して、ベース会アドレスが現
在実行中の命令の先頭アドレスであることだけが異なる
(2) PC relative displacement mode: Compared to the displacement mode, the only difference is that the base address is the start address of the instruction currently being executed.

■PC相対相対ディスプレースメートンデクス付きモー
ド: ディスプレースメント・インデクス付きモードと比較し
て、ベース・アドレスが現在実行中の命令の先頭アドレ
スであることだけが異なる。
(2) Mode with PC relative relative displacement index: Compared to the mode with displacement index, this mode differs only in that the base address is the start address of the instruction currently being executed.

■ディスプレースメント間接モード: ディスプレースメント会モードと同様にレジスタが持つ
ベース・アドレスと、ベース−アドレスからのディスプ
レースメントとの二つの値から実効アドレスが計算され
るが、その計算されたアドレスが指すのがメモリ中のポ
インタである点とが異なっている。すなわち、データへ
のポインタがメモリにある(メモリ間接)場合に使われ
るアドレシング・モードである。
■Displacement indirect mode: Similar to the displacement mode, the effective address is calculated from two values: the base address of the register and the displacement from the base address, but the address pointed to by the calculated address is The difference is that is a pointer in memory. That is, this is the addressing mode used when the pointer to the data is in memory (memory indirection).

■ディスプレースメント間接インデクス付きモード  
: レジスタが持つベース曇アドレスと、ベース番アドレス
からのディスプレースメントとの二つの値から、データ
へのベース拳ポインタの実効アドレスが計算される。す
なわち、データへのベース・ポインタはメモリにあり(
メモリ間接)、さらにそのベース・ポインタにインデク
ス値(またはビット拳オフセット)を加えたちがデータ
の実効アドレスとなる場合に使われるアドレシング・モ
ードである。
■Displacement indirect index mode
: The effective address of the base pointer to the data is calculated from two values: the base address held by the register and the displacement from the base number address. That is, the base pointer to the data is in memory (
This is the addressing mode used when the effective address of the data is obtained by adding an index value (or bit offset) to the base pointer (memory indirection).

■PC相対ディスプレースメント間接モード:ディスプ
レースメント間接モードと比較して、ベース・アドレス
が現在実行中の命令の先頭アドレスであることだけが異
なる。
(2) PC relative displacement indirect mode: Compared to the displacement indirect mode, the only difference is that the base address is the start address of the instruction currently being executed.

■PCディスプレースメント間接インデクス付きモード
: ディスプレースメント間接インデクス付きモートド比較
して、ベース拳アト  レスが現在実行中の命令の先頭
アドレスであることだけ異なる。
■Mode with indirect PC displacement index: Compared to mode with indirect displacement index, the only difference is that the base address is the start address of the instruction currently being executed.

[相]二重ディスプレースメント・モード)コニつのデ
ィスプレースメント(またはディスプレースメントとビ
ット・オフセット)が指定できるメモリ間接モードで、
ベース拳レジスタと、ディスプレースメント#2と、デ
ィスプレースメント#1(またはビット争オフセット)
との三つの要素で指定される。ベース拳レジスタ中のベ
ース・アドレスとディスプレースメント#2とから計算
されるアドレスにあるデータを、新たなベース・アドレ
スとし、それとディスプレースメント#1(またはビッ
ト拳オフセット)とから計算される実効アドレスにある
データを指定する。 このアドレシング争モードは、キ
ュー構造やツリー構造等の複雑なデータ構造を操作する
ときに特に有効である。
[Phase] Double displacement mode) A memory indirect mode in which two displacements (or displacement and bit offset) can be specified.
Base fist register, displacement #2, and displacement #1 (or bit conflict offset)
It is specified by three elements. Set the data at the address calculated from the base address and displacement #2 in the base register as the new base address, and set it to the effective address calculated from it and displacement #1 (or bit offset). Specify some data. This addressing contention mode is particularly useful when manipulating complex data structures such as queue structures and tree structures.

■PC相対二重ディスプレースメントφモード二二コニ
ィスプレースメント・モードと比較して、ベース・アド
レスが現在実行中の命令の先頭アドレスであることだけ
が異なる。このアドレシング・モードも、キュー構造や
木構造等の複雑なデータ構造を操作するときに特に有効
である。
(2) PC relative double displacement φ mode Compared to the double displacement mode, this mode differs only in that the base address is the start address of the instruction currently being executed. This addressing mode is also particularly useful when manipulating complex data structures such as queue structures and tree structures.

[相]直接アドレス・インデクス付きモード):直接命
令中に持つ32ビット−ベース・アドレスと、ベース拳
アドレスからのインデクス値(またはビット・オフセッ
ト)との二つの値から計算される実効アドレスにあるデ
ータを指定するアドレシング・モードである。
[Phase] Direct address indexed mode): Located in the effective address calculated from two values: the 32-bit base address in the direct instruction and the index value (or bit offset) from the base address. This is an addressing mode that specifies data.

[相]直接アドレス間接インデクス付きモード:直接命
令中にベース・ポインタの32ビツト・アドレスを持ち
、すなわち、データへのベース・ポインタはメモリにあ
り(メモリ間接)、さらにそのベース・ポインタにイン
デクス値(またはビット・オフセット)を加えたものが
データの実効アドレスとなる場合に使われるアドレシン
グ・モードである。
[Phase] Mode with direct address indirect index: has the 32-bit address of the base pointer in the direct instruction, i.e. the base pointer to the data is in memory (memory indirect), and the index value is also attached to the base pointer. This is the addressing mode used when the effective address of the data is the addition of (or bit offset).

本実施例においては、オペランドのアドレシング指定フ
ィールドをビット・アドレシングと従来のバイト拳アド
レシングと同一にしており、その区別を命令コードの内
容に」こって行なっている。
In this embodiment, the addressing designation field of the operand is the same as that of bit addressing and conventional byte-ken addressing, and the distinction is made based on the contents of the instruction code.

したがって、アドレシング・モードの種類を増やすこと
が必要ないので、命令デコーダのハードウェアの増加が
抑えられる。
Therefore, since there is no need to increase the number of types of addressing modes, an increase in the hardware of the instruction decoder can be suppressed.

また、ビ、ント拳オフセ・ソト(直も、データ・バスの
幅にとられれることなく、指定できるので、プログラム
設計の自由度を上げることができる。
In addition, the degree of freedom in program design can be increased because it can be specified without being restricted by the width of the data bus.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、バイト境界にないデータが一つのオペ
ランドで指定できるので、エンコードの時間短縮ができ
、素早く実効アドレスが生成できる。したがって、可変
長データを多用するプログラム(例えば、ピッ)−マツ
プを用いるグラフィックス用途のプログラム)の実行速
度の高速化ができる。
According to the present invention, since data that is not on a byte boundary can be specified with one operand, encoding time can be shortened and an effective address can be generated quickly. Therefore, it is possible to increase the execution speed of a program that uses variable-length data extensively (for example, a graphics program that uses pipmaps).

ビット・オフセットの指定方法を簡略化して不要なアド
レシング・モード指定機能を除くことができるので、プ
ログラムのサイズを短縮することができる。
Since the bit offset designation method can be simplified and unnecessary addressing mode designation functions can be removed, the size of the program can be reduced.

図面の簡単な説明 第1図Aは、本発明の一実施例におけるビット・フィー
ルド命令の中のビット列抽出命令の形式を示す図、第1
図Bは第1図Aのアドレシング・オペランドの構成図、
第2図は、第1図に示したビット・フィールド命令から
実効アドレスを得る方法を示す図、第3図は、得られた
実効アドレスとメモリ上のデータとの関係を示す図、第
4図は、従来のアドレシング方式によるビット・フィー
ルド命令の形式を示す図、第5図は、従来のアドレシン
グ方式により第4図に示したビット・フィールド命令中
のオペランドから実効アドレスを得る方法を示す図、第
6図は本実施例による具体的なアドレシング方式を示す
図である。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1A is a diagram showing the format of a bit string extraction instruction among bit field instructions in an embodiment of the present invention.
Figure B is a configuration diagram of the addressing operand in Figure 1A,
FIG. 2 is a diagram showing a method of obtaining an effective address from the bit field instruction shown in FIG. 1, FIG. 3 is a diagram showing the relationship between the obtained effective address and data on memory, and FIG. 5 is a diagram showing the format of a bit field instruction according to the conventional addressing method, and FIG. 5 is a diagram showing a method for obtaining an effective address from the operand in the bit field instruction shown in FIG. 4 according to the conventional addressing method. FIG. 6 is a diagram showing a specific addressing method according to this embodiment.

401・・・命令コード、402・・・アドレシング・
オペランド、403・・・レングス・オペランド、40
4・・・デスティネーション・オペランド、501・・
・バイト単位アドレス、502・・・加算器、503・
・・ビット・単位アドレルス、504・・・シフタ、5
05・・・ベース拳アドレス、506・・・下位3ビツ
ト。
401... Instruction code, 402... Addressing
Operand, 403...Length operand, 40
4...Destination operand, 501...
・Byte unit address, 502...Adder, 503・
... Bit unit address, 504 ... Shifter, 5
05...Base fist address, 506...Lower 3 bits.

代理人 弁理士  内 原  晋 mα & 八 第1図Agent Patent Attorney Susumu Uchihara mα & Eight Figure 1

Claims (1)

【特許請求の範囲】 1、命令が命令コードとアドレシング・オペランドとを
有し、 前記アドレシング・オペランドは第一および第二のフィ
ールドを有し、 前記第一のフィールドで決定される値を2の補数表現の
ビット単位の値と見なし、その値をその下位ビット方向
にMビットシフトした値を前記第二のフィールドで決定
されるアドレスに加算して、実効・アドレスとビット・
オフセットとを生成することを特徴とするビット・アド
レシング方式。 2、前記第二のフィールドが、インデクス・フィールド
であることを特徴とする請求項1記載のビット・アドレ
シング方式。 3、前記第二のフィールドが、ディスプレースメントフ
ィールドであることを特徴とする請求項1記載のビット
・アドレシング方式。 4、前記命令コードの内容が予め定められた内容を表す
ときに、前記第二のフィールドで決定される値を前記ビ
ット単位の値と見做すことを特徴とする請求項1記載の
ビット・アドレシング方式。 5、前記ビット・オフセットの範囲が−2^N^−^1
ビットから(+2^N^−^1−1)ビットであること
を特徴とする請求項1記載のビット・アドレシング方式
。 6、前記ベース・アドレスとビット・アドレスとで表さ
れるビット・アドレスが2^N^+^Mビットの範囲で
指定されることを特徴とする請求項1記載のビット・ア
ドレシング方式。
[Claims] 1. An instruction has an instruction code and an addressing operand, the addressing operand has a first and a second field, and the value determined by the first field is set to two. Regarded as a bit-wise value in complement representation, that value is shifted by M bits in the direction of its lower bits and added to the address determined in the second field to form the effective address and the bits.
A bit addressing method characterized by generating an offset. 2. The bit addressing system according to claim 1, wherein the second field is an index field. 3. The bit addressing system according to claim 1, wherein the second field is a displacement field. 4. The bit unit according to claim 1, wherein when the contents of the instruction code represent predetermined contents, the value determined in the second field is regarded as the value in units of bits. Addressing method. 5. The range of the bit offset is -2^N^-^1
A bit addressing scheme according to claim 1, characterized in that the bits are (+2^N^-^1-1) bits. 6. The bit addressing method according to claim 1, wherein the bit address represented by the base address and the bit address is specified within a range of 2^N^+^M bits.
JP2030697A 1989-02-09 1990-02-09 Bit addressing system Pending JPH02306339A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2030697A JPH02306339A (en) 1989-02-09 1990-02-09 Bit addressing system

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP3144789 1989-02-09
JP1-31447 1989-02-09
JP2030697A JPH02306339A (en) 1989-02-09 1990-02-09 Bit addressing system

Publications (1)

Publication Number Publication Date
JPH02306339A true JPH02306339A (en) 1990-12-19

Family

ID=26369094

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2030697A Pending JPH02306339A (en) 1989-02-09 1990-02-09 Bit addressing system

Country Status (1)

Country Link
JP (1) JPH02306339A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100434502B1 (en) * 2002-05-07 2004-06-05 삼성전자주식회사 Data extraction/insertion method for digital signal processor and device thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5383537A (en) * 1976-12-28 1978-07-24 Ibm Data processing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5383537A (en) * 1976-12-28 1978-07-24 Ibm Data processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100434502B1 (en) * 2002-05-07 2004-06-05 삼성전자주식회사 Data extraction/insertion method for digital signal processor and device thereof

Similar Documents

Publication Publication Date Title
JP6339164B2 (en) Vector friendly instruction format and execution
JP3554342B2 (en) Reverse compatible computer architecture with extended word size and address space
KR100266337B1 (en) Data processing circuit, semiconductor integrated circuit device, microcomputer, and electronic equipment
US4814976A (en) RISC computer with unaligned reference handling and method for the same
US4219874A (en) Data processing device for variable length multibyte data fields
KR940009094B1 (en) Data processing system
JPH0135366B2 (en)
JPH0371337A (en) Microprocessor circuit
JPH04172533A (en) Electronic computer
JPH1091443A (en) Information processing circuit, microcomputer and electronic equipment
KR20010043826A (en) Microcontroller instruction set
US5357620A (en) Bit addressing system
US6978359B2 (en) Microprocessor and method of aligning unaligned data loaded from memory using a set shift amount register instruction
EP0764900B1 (en) Information processing apparatus for realizing data transfer to/from a plurality of registers using instructions of short word length
JP2018506094A (en) Method and apparatus for performing BIG INTEGER arithmetic operations
US6499099B1 (en) Central processing unit method and apparatus for extending general instructions with extension data of an extension register
US4611278A (en) Wraparound buffer for repetitive decimal numeric operations
US5077659A (en) Data processor employing the same microprograms for data having different bit lengths
TW201545057A (en) Apparatus and method for selecting elements of a vector computation
JP2002229778A (en) Pc relative branching method with high-speed displacement
JP2551167B2 (en) Microcomputer
JP3556252B2 (en) Data processing system and method for calculating offset total
JPS62134763A (en) Index applicator for 3 address code
JP2556182B2 (en) Data processing device
JPH02306339A (en) Bit addressing system