JP2000029687A - Method and device for packing and unpacking data on central processing unit - Google Patents

Method and device for packing and unpacking data on central processing unit

Info

Publication number
JP2000029687A
JP2000029687A JP11076252A JP7625299A JP2000029687A JP 2000029687 A JP2000029687 A JP 2000029687A JP 11076252 A JP11076252 A JP 11076252A JP 7625299 A JP7625299 A JP 7625299A JP 2000029687 A JP2000029687 A JP 2000029687A
Authority
JP
Japan
Prior art keywords
value
byte
memory
register
memory address
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
JP11076252A
Other languages
Japanese (ja)
Inventor
Tessaroro Alexander
テッサロロ アレクサンダー
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.)
Texas Instruments Inc
Original Assignee
Texas Instruments Inc
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 Texas Instruments Inc filed Critical Texas Instruments Inc
Publication of JP2000029687A publication Critical patent/JP2000029687A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a method and a device for packing and unpacking data on a CPU with improved machine performance. SOLUTION: A memory array 120 is provided with plural memory addresses, a register 110 is provided with a most significant byte 112 and a least significant byte 114 and a pointer 150 and an index value indicate the memory address 142 provided with a high-order memory value 140 and a low-order memory value 138. In the case that the index value is an odd number (even number), a byte value is read from the high-order memory value 140 (low-order memory value 138) and stored in the most significant byte 112 (least significant byte 114) of the register and the byte value read from the register 110 is stored in the high-order memory value 140 (low-order memory value 138) of the memory address 142.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、一般に、中央処理
装置に関し、より詳細には、データをパック及びアンパ
ックする方法及び装置に関する。
FIELD OF THE INVENTION The present invention relates generally to central processing units and, more particularly, to a method and apparatus for packing and unpacking data.

【0002】[0002]

【発明が解決しようとする課題】メモリアレイ及びレジ
スタを使用してデータを取り出して格納することは、こ
の技術分野では公知であり、ほとんど全てのコンピュー
タ・アーキテクチャのアプリケーションで使用されてい
る。中央処理装置(CPU)は、演算を実行する過程で
メモリからデータを読み書きする。これらの演算は、1
6ビットまたはもっと多数のビットでアドレス指定可能
なマシンで発生することがある。しかし、演算にはバイ
ト(8ビット)・サイズのデータを必要とすることがあ
る。CPUは、メモリからバイト・サイズのデータ語を
取り出す命令を受信する。たとえば、この命令は、CP
Uで走行中のソフトウエアとそのソフトウエアを実行す
るために必要なデータとから発生する。その後、CPU
はメモリアレイから16ビット・データ語を受信する
が、そのデータが8ビットのアプリケーションで使用さ
れ得る前に、そのデータについて更に別の演算が必要に
なる。
The retrieval and storage of data using memory arrays and registers is well known in the art and is used in almost all computer architecture applications. A central processing unit (CPU) reads and writes data from and to a memory in the course of executing an operation. These operations are 1
It can occur on machines that can be addressed with 6 bits or more. However, operations may require byte (8 bit) sized data. The CPU receives an instruction to retrieve a byte-sized data word from memory. For example, this instruction
It is generated from software running in U and data necessary to execute the software. Then the CPU
Receives a 16-bit data word from the memory array, but requires additional operations on the data before it can be used in an 8-bit application.

【0003】これらの演算は、パッキング及びアンパッ
キングとして公知である。パッキングは、2つまたはそ
れ以上の文字を1グループにして1語にする演算であ
る。アンパッキングはパッキングの逆の演算であって、
1語に格納された2つまたはそれ以上の文字を分離す
る。装置はこれらの演算を実行することによって、記憶
場所から1バイトを読み出し、その1バイトとCPUレ
ジスタ内の他のバイトとをマージすることができる。し
かし、これとは逆のタスク、すなわち、所定の記憶場所
にバイトを書き込むことを実行するためには、もっと多
くの命令が必要である。
[0003] These operations are known as packing and unpacking. Packing is an operation that groups two or more characters into one word. Unpacking is the inverse operation of packing,
Separates two or more characters stored in one word. The device can perform these operations to read a byte from the memory location and merge that byte with other bytes in the CPU registers. However, more instructions are needed to perform the opposite task, writing a byte to a given storage location.

【0004】「C」のような高級言語は、演算を実行す
る場合にバイト・サイズのデータを処理する。ディスク
・ドライブなどの高度な組込アプリケーションの多く
は、16ビットのデータ型を処理する。バイト・サイズ
・データは、これらの高度な組込アプリケーションによ
って処理され得るが、非常に頻繁に処理されるわけでは
ない。システムRAMの必要条件が高度になると、必要
なバイト演算を処理する一方で、16ビットの演算に使
用可能なバイト・サイズ・データの処理を実行するた
め、更に別のソフトウエア・ルーチンが必要になる。
[0004] High-level languages such as "C" process byte-sized data when performing operations. Many advanced embedded applications, such as disk drives, handle 16-bit data types. Byte size data can be processed by these sophisticated embedded applications, but not very often. As system RAM requirements increase, additional software routines are required to perform the required byte operations while performing the processing of byte-size data available for 16-bit operations. Become.

【0005】8ビットから16ビットへの互換性の問題
に対する解決方法は、8ビット・アドレス指定可能マシ
ンの設計であった。しかし、8ビット・アドレス指定可
能マシンを使用すると、装置のアドレス範囲が小さくな
って半分になる。それだけでなく、バイト・アドレス指
定可能マシンは、すべてのオンチップ・メモリが8ビッ
ト・メモリとしてアドレス指定可能であることが必要で
ある。16ビット・マシンによって得ることができる大
きなアドレス範囲は、これらの8ビット・マシンではア
クセスできない。別の解決方法は、16ビット・メモリ
からバイト・サイズ・データを取り出す機能を実現する
ためにソフトウエアの命令を使用することであった。ソ
フトウエアの命令を使用すると、コード・サイズが大き
くなりRAMの必要条件が高度になるので、マシンの性
能が低下する。走行時間が増加すると、能率及び性能が
低下する。
[0005] The solution to the 8-bit to 16-bit compatibility problem has been the design of 8-bit addressable machines. However, using an 8-bit addressable machine reduces the device address range by half. In addition, byte addressable machines require that all on-chip memory be addressable as 8-bit memory. The large address range obtainable by 16-bit machines is not accessible on these 8-bit machines. Another solution has been to use software instructions to implement the function of retrieving byte-sized data from 16-bit memory. The use of software instructions degrades machine performance due to increased code size and increased RAM requirements. As travel time increases, efficiency and performance decrease.

【0006】[0006]

【課題を解決する手段】前述したことから、アドレス範
囲の能力を低下させずに、すなわち、システムRAMの
必要条件を高度にすることなく、中央処理装置でデータ
をパック及びアンパックする方法について必要があるこ
とが理解されるであろう。本発明によれば、従来のデー
タ処理演算に関する不利な点及び問題点を実質的に取り
除くか小さくして、中央処理装置上でデータをパック及
びアンパックする方法及び装置が提供される。
SUMMARY OF THE INVENTION From the foregoing, there is a need for a method of packing and unpacking data in a central processing unit without compromising address range capabilities, i.e., without increasing system RAM requirements. It will be understood that there is. In accordance with the present invention, there is provided a method and apparatus for packing and unpacking data on a central processing unit with substantially eliminating or reducing disadvantages and problems associated with conventional data processing operations.

【0007】中央処理装置上でデータをパック及びアン
パックする装置が開示される。この装置には、複数のメ
モリ・アドレスをもつメモリアレイが含まれており、ポ
インタとインデックス値(index value)は、このメモ
リアレイ内のメモリ・アドレスを指示する。メモリ・ア
ドレスには、上位メモリ値(high memory value)と下
位メモリ値(low memory value)とがある。この装置
は、バイト値(byte value)をさらに含み、このバイト
値は、インデックス値が奇数の場合には上位メモリ値か
ら読み出され、インデックス値が偶数の場合には下位メ
モリ値から読み出される。この装置は、最上位バイトと
最下位バイトとをもつレジスタをさらに含む。バイト値
は、中央処理装置によって命令されたときに最上位バイ
トに格納され、中央処理装置によって命令されたときに
最下位バイトに格納される。この装置は、メモリ・アド
レスからレジスタにバイト値を取り出すパッキング命令
をさらに含む。この装置は、レジスタからメモリアレイ
内のメモリ・アドレスにバイト値を読み出すアンパッキ
ング命令をさらに含む。
[0007] An apparatus for packing and unpacking data on a central processing unit is disclosed. The apparatus includes a memory array having a plurality of memory addresses, and a pointer and an index value point to a memory address in the memory array. The memory address has an upper memory value (high memory value) and a lower memory value (low memory value). The device further includes a byte value that is read from a higher memory value if the index value is odd and from a lower memory value if the index value is even. The apparatus further includes a register having a most significant byte and a least significant byte. The byte value is stored in the most significant byte when commanded by the central processing unit and in the least significant byte when commanded by the central processing unit. The apparatus further includes a packing instruction that retrieves a byte value from the memory address into a register. The apparatus further includes an unpacking instruction that reads a byte value from a register to a memory address in the memory array.

【0008】別の実施形態では、本発明による中央処理
装置上でデータをパック及びアンパックする方法は、5
つのステップを含む。第1のステップは、ポインタ及び
インデックス値を用いてメモリアレイ内のメモリ・アド
レスを指示することを含む。メモリ・アドレスは、上位
メモリ値と下位メモリ値とを有する。第2のステップ
は、メモリ・アドレスからバイト値を取り出すことを含
み、バイト値は、インデックス値が奇数の場合には上位
メモリ値から読み出され、インデックス値が偶数の場合
には下位メモリ値から読み出される。第3のステップ
は、レジスタにバイト値を書き込むことを含む。レジス
タは、最上位バイトと最下位バイトとをもつことができ
る。第4のステップは、レジスタからバイト値を読み出
すことを含む。第5のステップは、インデックス値が奇
数の場合には上位メモリ値にバイト値を格納し、インデ
ックス値が偶数の場合には下位メモリ値にバイト値を格
納することを含む。
In another embodiment, a method for packing and unpacking data on a central processing unit according to the present invention comprises:
Includes two steps. The first step involves using a pointer and an index value to indicate a memory address in the memory array. The memory address has an upper memory value and a lower memory value. The second step involves retrieving the byte value from the memory address, where the byte value is read from the upper memory value if the index value is odd and from the lower memory value if the index value is even. Is read. The third step involves writing a byte value to the register. A register can have a most significant byte and a least significant byte. The fourth step involves reading a byte value from a register. The fifth step involves storing the byte value in the upper memory value if the index value is odd, and storing the byte value in the lower memory value if the index value is even.

【0009】本発明の技術的利点は、中央処理装置上で
データをパック及びアンパックするための方法が提供さ
れることである。本発明の別の技術的利点は、8ビット
・データの能率的な処理が16ビット・アドレス指定可
能マシンで達成されることである。本発明の別の技術的
利点は、システムRAMの必要条件を高度にすることな
くまたはソフトウエア命令を追加して実行せずに、16
ビット・メモリ内の8ビット・データをパック及びアン
パックできることである。本発明の別の技術的利点は、
「C」のような高級言語を使用して8ビット・データを
一緒に処理することができることである。本発明の別の
技術的利点は、8ビット・メモリとしてアドレス指定で
きるように16ビット・メモリを変更する必要がないこ
とである。本発明の別の技術的利点は、開示された方法
が能率良く機能することである。本発明の別の技術的利
点は、中央処理装置においてパッキング及びアンパッキ
ング・タスクを実行する命令の数が減少することであ
る。本発明の別の技術的利点は、16ビットのデータ型
を処理する高度な組込アプリケーションが、バイト演算
を処理する同じアーキテクチャで走行できることであ
る。本発明の別の技術的利点は、開示された発明に既存
のアドレス指定モードが組み込まれていることである。
A technical advantage of the present invention is that a method is provided for packing and unpacking data on a central processing unit. Another technical advantage of the present invention is that efficient processing of 8-bit data is achieved on a 16-bit addressable machine. Another technical advantage of the present invention is that it does not require sophisticated system RAM requirements or execute with additional software instructions.
The ability to pack and unpack 8-bit data in bit memory. Another technical advantage of the present invention is that
The ability to process 8-bit data together using a high-level language such as "C". Another technical advantage of the present invention is that there is no need to modify 16-bit memory so that it can be addressed as 8-bit memory. Another technical advantage of the present invention is that the disclosed method works efficiently. Another technical advantage of the present invention is that the number of instructions that perform packing and unpacking tasks in a central processing unit is reduced. Another technical advantage of the present invention is that advanced embedded applications that handle 16-bit data types can run on the same architecture that handles byte operations. Another technical advantage of the present invention is that the disclosed invention incorporates existing addressing modes.

【0010】[0010]

【発明の実施の形態】本発明とその利点とを更に十分に
理解するため、添付の図面とともに以下の説明に言及す
るが、この中で似た参照番号は同じような部分を表して
いる。
BRIEF DESCRIPTION OF THE DRAWINGS For a more complete understanding of the present invention and its advantages, reference is now made to the following description taken in conjunction with the accompanying drawings, in which like reference numerals designate like parts, and in which: FIG.

【0011】本発明の実施形態及びその利点は、添付図
面の図1から図3を詳細に参照することにより、もっと
もよく理解される。図面中、似た参照番号は同じような
部分を表している。図1から図3は、本発明の一実施形
態による中央処理装置上でデータをパック及びアンパッ
クする装置及び方法を示している。
[0011] Embodiments of the present invention and its advantages are best understood by referring to the accompanying drawings in detail. In the drawings, like reference numbers indicate similar parts. 1 to 3 illustrate an apparatus and method for packing and unpacking data on a central processing unit according to an embodiment of the present invention.

【0012】図1は、中央処理装置(CPU)100を
示している。CPU100は、バイト・サイズ(8ビッ
ト)・データの処理を実行することができる16ビット
・アドレス指定可能マシンであればよい。
FIG. 1 shows a central processing unit (CPU) 100. CPU 100 may be any 16-bit addressable machine that can perform processing on byte-sized (8-bit) data.

【0013】レジスタ110及びメモリアレイ120は
CPU100上にあればよい。レジスタ110は16ビ
ット・レジスタであればよく、メモリアレイ120は、
データを16ビット語として格納する16ビット・メモ
リであればよい。これらの16ビット語は、8ビットす
なわちバイト・サイズのデータ語を2つ含む。
The register 110 and the memory array 120 may be provided on the CPU 100. The register 110 may be a 16-bit register, and the memory array 120
Any 16-bit memory that stores data as 16-bit words may be used. These 16-bit words include two 8-bit or byte-sized data words.

【0014】本発明によれば、バイト・サイズ・データ
は、メモリアレイ120に示すような16ビット・メモ
リから、レジスタ110に示すレジスタのような16ビ
ット・レジスタにパックされるとともにアンパックされ
る。レジスタ110は、最上位バイト112と最下位バ
イト114とを含むことができる。一実施形態では、最
上位バイト112は、レジスタ110の上位バイト(ビ
ット8〜15)を含む。また、最上位バイト112はバ
イト・サイズ・データ語を格納することができる。最下
位バイト114は、レジスタ110の下位バイト(ビッ
ト0〜7)を含む。最上位バイト112と同様に、最下
位バイト114はバイト・サイズ・データ語を格納する
ことができる。
In accordance with the present invention, byte size data is packed and unpacked from a 16-bit memory, such as shown in memory array 120, into a 16-bit register, such as the register shown in register 110. Register 110 may include a most significant byte 112 and a least significant byte 114. In one embodiment, the most significant byte 112 includes the upper byte (bits 8-15) of the register 110. Also, the most significant byte 112 can store a byte size data word. The least significant byte 114 contains the lower byte (bits 0-7) of the register 110. Like the most significant byte 112, the least significant byte 114 can store a byte size data word.

【0015】レジスタ110は、メモリアレイ120に
対してデータを読み書きすることができる。メモリアレ
イ120では、メモリ・アドレス124は16ビット・
メモリ・レジスタである。また、メモリ・アドレス12
8,132,136,142は、メモリアレイ120内
にあり、16ビット・メモリ・レジスタである。メモリ
・アドレス124は、ポインタ150によって指示され
ているように、メモリ・アレイ120のスタックの最上
部にある。ポインタ150は、メモリアレイ120の最
上部を指示している。ポインタ150は、レジスタと協
調して、CPU100における演算中にどのメモリ・ア
ドレスがアクセスされるべきかを指示することができ
る。
The register 110 can read and write data from and to the memory array 120. In the memory array 120, the memory address 124 is a 16-bit
It is a memory register. Also, the memory address 12
8, 132, 136, 142 are 16-bit memory registers in the memory array 120. Memory address 124 is at the top of the stack of memory array 120, as indicated by pointer 150. Pointer 150 points to the top of memory array 120. Pointer 150 can cooperate with registers to indicate which memory address is to be accessed during operation in CPU 100.

【0016】メモリ・アドレス124は、レジスタ11
0と同じように、2つのセクションに分割され得る。最
下位バイト・セクション(すなわち、下位メモリ値)
は、メモリ・アドレス124のビット0〜7を指定する
ために使用することができる。最上位バイト・セクショ
ン(すなわち、上位メモリ値)は、メモリ・アドレス1
24のビット8〜15を指定するために使用することが
できる。一緒に配置されると、上位メモリ値と下位メモ
リ値とは、メモリ・アドレス124で16ビット語を構
成する。図1に示すように、メモリ・アドレス124
は、そのレジスタに格納された語1をもつ。メモリ・ア
ドレス128,132,136も同様に、各レジスタ内
に最上位バイト及び最下位バイトを示す上位メモリ値及
び下位メモリ値をもつ。たとえば、メモリ・アドレス1
28は16ビット語2を格納することができ、メモリ・
アドレス132は16ビット語3を格納することがで
き、メモリ・アドレス136は16ビット語4を格納す
ることができる。メモリ・アドレス142は、メモリア
レイ120に格納されたN番目の16ビット語を示して
いる。このN番目の16ビット語は、下位メモリ値13
8と上位メモリ値140とから構成される。
The memory address 124 is stored in the register 11
Like 0, it can be divided into two sections. Least significant byte section (ie, lower memory value)
Can be used to specify bits 0-7 of memory address 124. The most significant byte section (ie, the upper memory value) is at memory address 1
24 can be used to specify bits 8-15. When placed together, the upper and lower memory values form a 16-bit word at memory address 124. As shown in FIG.
Has word 1 stored in its register. Memory addresses 128, 132, and 136 also have upper and lower memory values indicating the most significant byte and least significant byte in each register. For example, memory address 1
28 can store a 16-bit word 2;
Address 132 can store 16-bit word 3, and memory address 136 can store 16-bit word 4. The memory address 142 indicates the Nth 16-bit word stored in the memory array 120. This N-th 16-bit word has a lower memory value of 13
8 and an upper memory value 140.

【0017】CPU100がメモリアレイ120からデ
ータを取り出す命令を発行すると、ポインタ150は、
自身をメモリアレイ120の先頭に合わせる。CPU1
00からの命令は、所望のデータのメモリ・アドレス
(すなわち、記憶場所)を指示することができる。ポイ
ンタ150からのオフセット152は、メモリ・アドレ
スを指示して、つぎに、メモリアレイ120から読み出
される16ビット語を指示するために使用することがで
きる。オフセット152は、CPU100によって与え
られたオフセット値の2倍であるインデックス値を含
む。これに代わるものとして、CPU100は、オフセ
ット152を決定するために使用されるインデックス値
を発行することができる。一実施形態では、これらのイ
ンデックス値は、メモリ・アドレスの上位メモリ値及び
下位メモリ値を指示するために使用される。たとえば、
メモリ・アドレス124において、ビット0〜7を指示
する下位メモリ値は、“0”のインデックス値をもつ。
メモリ・アドレス124の上位メモリ値は、“1”のイ
ンデックス値をもつ。したがって、メモリ・アドレス1
24のビット8〜15は、“1”のインデックス値をも
つ。更に、16ビット語1は、“0”のインデックス値
をもつ下位メモリ値と、“1”のインデックス値をもつ
上位メモリ値とを含む。16ビット語を読み出すために
必要なオフセットを指示するため、オフセット152
は、インデックス値を“2”で割ることによって決定さ
れ得る。16ビット語は、インデックス値と相関する上
位メモリ値または下位メモリ値を含む。たとえば、CP
U100から要求されたデータが“0”のインデックス
値をもっている場合には、オフセット152は“0”を
“2”で割った値(すなわち、“0”)に等しい。した
がって、ポインタ150は、16ビット語から“0”だ
け離れている(すなわち、メモリ・アドレス124を指
している)。“1”のインデックス値が受信されると、
オフセット152は再び“0”になり、メモリ・アドレ
ス124を指示する。“2”のインデックス値は“1”
のオフセット値に等しく、これは、所望のデータが
“1”だけポインタ150から離れていること(すなわ
ち、メモリ・アドレス128を指示していること)を示
す。インデックス値が奇数でオフセット152に対して
分数になる場合には、端数を切り捨てて、オフセット1
52を“1”だけ少ない次の整数に丸めてよい。一実施
形態では、メモリ・アドレスの下位メモリ値は偶数のイ
ンデックス値をもち、メモリ・アドレスの上位メモリ値
は奇数のインデックス値をもつ。したがって、メモリ・
アドレス142では、下位メモリ値138は偶数のイン
デックス値をもち、上位メモリ値140には奇数のイン
デックス値をもつ。ポインタ150からのオフセット1
52は、メモリ・アレイ120のN番目の16ビット語
を指示する。メモリ・アドレス142内のインデックス
値は“2”で割られて、オフセット152を決定する。
When CPU 100 issues an instruction to retrieve data from memory array 120, pointer 150 becomes
Adjust itself to the top of the memory array 120. CPU1
The instructions from 00 can indicate the memory address (ie, storage location) of the desired data. Offset 152 from pointer 150 can be used to indicate a memory address and then a 16-bit word to be read from memory array 120. Offset 152 includes an index value that is twice the offset value provided by CPU 100. Alternatively, the CPU 100 can issue an index value that is used to determine the offset 152. In one embodiment, these index values are used to indicate the upper and lower memory values of the memory address. For example,
At memory address 124, the lower memory value designating bits 0-7 has an index value of "0".
The upper memory value of the memory address 124 has an index value of “1”. Therefore, memory address 1
The 24 bits 8 to 15 have an index value of “1”. Further, 16-bit word 1 includes a lower memory value having an index value of “0” and an upper memory value having an index value of “1”. Offset 152 to indicate the offset required to read the 16-bit word.
Can be determined by dividing the index value by “2”. The 16-bit word contains an upper or lower memory value that correlates with the index value. For example, CP
If the data requested by U100 has an index value of "0", then offset 152 is equal to the value of "0" divided by "2" (ie, "0"). Thus, pointer 150 is separated from the 16-bit word by "0" (ie, points to memory address 124). When an index value of “1” is received,
Offset 152 is again "0", indicating memory address 124. The index value of “2” is “1”
, Which indicates that the desired data is "1" away from pointer 150 (i.e., pointing to memory address 128). If the index value is odd and becomes a fraction with respect to the offset 152, the fraction is rounded down and the offset 1
52 may be rounded to the next integer less by "1". In one embodiment, the lower memory value of the memory address has an even index value and the upper memory value of the memory address has an odd index value. Therefore, the memory
At address 142, the lower memory value 138 has an even index value and the upper memory value 140 has an odd index value. Offset 1 from pointer 150
52 indicates the Nth 16-bit word of memory array 120. The index value in memory address 142 is divided by "2" to determine offset 152.

【0018】矢印160で示すように、CPU100に
おける演算中、データはメモリアレイ120とレジスタ
110との間を移動することができる。ソフトウエアを
走行させるなどのCPU100における演算は、オフセ
ット152及びポインタ150によって指示された場所
でメモリアレイからデータが取り出され、レジスタ11
0に移動されるように指令するであろう。特に、ユーザ
は、ソフトウエア・ルーチンで使用するためにメモリア
レイ120からレジスタ110にデータを取り出すよう
にソフトウエアの機能を書いてもよい。一実施形態で
は、メモリアレイ120内の8ビット語(すなわち、バ
イト値)を指示するインデックス値は、レジスタ110
に格納される8ビット語を取り出すために使用できる。
このバイト値は、最上位バイト112または最下位バイ
ト114のいずれかに格納できる。命令とともに受信さ
れたインデックス値は、指定されたメモリ・アドレスの
上位メモリ値または下位メモリ値を取り出すことを指示
する。オフセット152に示すように、これらの命令
は、ポインタ150からのインデックス値を16ビット
・オフセット値ではなくバイト・オフセット値として取
り扱う。必要な場合は、CPU100からの他の命令
は、16ビット・オフセットを指示するためにオフセッ
ト152を使用することができる。
As shown by arrow 160, data can move between memory array 120 and register 110 during operation in CPU 100. For operations in the CPU 100, such as running software, data is extracted from the memory array at a location indicated by the offset 152 and the pointer 150, and the register 11
Would be commanded to be moved to zero. In particular, a user may write a software function to retrieve data from memory array 120 to register 110 for use in a software routine. In one embodiment, an index value that indicates an 8-bit word (ie, a byte value) in memory array 120 is stored in register 110.
Can be used to retrieve the 8-bit word stored in.
This byte value can be stored in either the most significant byte 112 or the least significant byte 114. The index value received with the instruction indicates that the upper or lower memory value at the specified memory address is to be retrieved. As shown at offset 152, these instructions treat the index value from pointer 150 as a byte offset value rather than a 16-bit offset value. If necessary, other instructions from CPU 100 can use offset 152 to indicate a 16-bit offset.

【0019】図2を参照すると、本発明によるCPU上
でデータをパックする方法が開示されている。データを
パックすることによって、CPU100は8ビット語を
取り出し、その8ビット語と他のデータとを組み合わせ
て16ビット語を形成する。一実施形態では、メモリア
レイ120からバイト・サイズ・データを取り出す命令
がCPU100から受信される。バイト・サイズ・デー
タ(すなわち、バイト値)は、メモリアレイ120内の
メモリ・アドレス(たとえば、メモリ・アドレス12
4)に格納される。メモリ・アレイ120は、16ビッ
ト語またはその代わりに2つの8ビット語(すなわち、
2つのバイト・サイズ語)を含む16ビット・レジスタ
を含む。したがって、本発明によれば、メモリアレイ1
20内の8ビット語をレジスタ110にパックすること
ができる。
Referring to FIG. 2, a method for packing data on a CPU according to the present invention is disclosed. By packing the data, CPU 100 retrieves the 8-bit word and combines the 8-bit word with other data to form a 16-bit word. In one embodiment, an instruction to retrieve byte-size data from memory array 120 is received from CPU 100. The byte size data (ie, byte value) is stored in a memory address (eg, memory address 12) in memory array 120.
4). Memory array 120 may include a 16-bit word or, alternatively, two 8-bit words (ie,
16-bit register containing two byte-size words). Therefore, according to the present invention, the memory array 1
The 8-bit word in 20 can be packed into register 110.

【0020】ステップ210では、パッキング命令がC
PU100から受信される。この命令は、メモリアレイ
120内の指定されたメモリ・アドレスをもつことがで
きる。ステップ212では、CPU100からの命令で
受信されたメモリ・アドレスが、ポインタ150に関す
るインデックス値を決定するために使用される。このイ
ンデックス値は、パッキング演算用のデータを読み出す
メモリ・アドレスを識別するために使用される。ポイン
タ150からのオフセット152は、図1に開示されて
いるように、インデックス値を“2”で割ったものに等
しい。指定されたメモリ・アドレスを見つけると、ステ
ップ214は、インデックス値が偶数か奇数かを決定す
る。ステップ216に開示されているように、奇数のイ
ンデックス値は、指定されたレジスタの上位メモリ値が
メモリアレイ120から取り出されることを指示する。
上位メモリ値は、ステップ210で指定されたレジスタ
のビット8〜15(すなわち、最上位バイト)に等し
い。インデックス値が偶数の場合には、ステップ218
に開示されているように、指定されたレジスタの下位メ
モリ値がメモリアレイ120から取り出される。下位メ
モリ値は、ステップ210からのパッキング命令で指示
された、指定されたレジスタのビット0〜7(すなわ
ち、最下位バイト)に等しい。したがって、メモリアレ
イ120から取り出された16ビット語のアドレス・バ
イトに対して変更を行うことができる。この変更は、取
り出された16ビット語の反対バイト(opposing byt
e)の内容が変更されないように実行される「読出し−
変更−書込み」動作に相関している。さらに、ポインタ
150は依然としてメモリ・アドレス124のような1
6ビット・メモリ・アドレスを指しているので、「C」
コンパイラは上記モードを使用することができる。
In step 210, the packing instruction is C
It is received from the PU 100. This instruction can have a specified memory address in memory array 120. At step 212, the memory address received in the instruction from CPU 100 is used to determine an index value for pointer 150. This index value is used to identify a memory address from which data for packing operation is read. The offset 152 from the pointer 150 is equal to the index value divided by "2", as disclosed in FIG. Upon finding the specified memory address, step 214 determines whether the index value is even or odd. As disclosed in step 216, the odd index value indicates that the upper memory value of the specified register is fetched from memory array 120.
The high memory value is equal to bits 8-15 of the register specified in step 210 (ie, the most significant byte). If the index value is even, step 218
, The lower memory value of the specified register is retrieved from the memory array 120. The lower memory value is equal to bits 0-7 of the designated register (ie, the least significant byte), as indicated by the packing instruction from step 210. Thus, changes can be made to the 16-bit word address bytes retrieved from memory array 120. This change is caused by the opposing byte of the fetched 16-bit word.
"Read-out" executed so that the contents of e) are not changed
Corresponds to a "modify-write" operation. In addition, pointer 150 will still have one such as memory address 124.
"C" because it points to a 6-bit memory address
The compiler can use the above modes.

【0021】適切なバイト値がメモリアレイ120から
取り出されると、レジスタ110(最上位バイト112
または最下位バイト114)にこのバイト値を移動させ
ることができる。ステップ220では、取り出されたバ
イト値がレジスタ110のどこに格納されるかについ
て、決定が行われる。ステップ210においてCPU1
00から受信された命令には、バイト値が格納されるこ
とになる場所を含むことができる。バイト値が最上位バ
イト112に格納されることを命令が指示していると、
ステップ222が実行される。ステップ222は、この
バイト値をレジスタ110のビット8〜15に格納す
る。ステップ224は、レジスタ110のビット0〜7
で構成される最下位バイト114が変更されないことを
指示する。バイト値が最下位バイト114に格納される
場合には、ステップ226が実行される。ステップ22
6は、レジスタ110のビット0〜7にバイト値を格納
する。
When the appropriate byte value is retrieved from memory array 120, register 110 (most significant byte 112)
Alternatively, this byte value can be moved to the least significant byte 114). In step 220, a determination is made as to where the retrieved byte value is stored in register 110. In step 210, the CPU 1
The instruction received from 00 may include the location where the byte value will be stored. If the instruction indicates that the byte value is stored in the most significant byte 112,
Step 222 is performed. Step 222 stores this byte value in bits 8-15 of register 110. Step 224 determines whether bits 0-7 of register 110
Indicate that the least significant byte 114 composed of If the byte value is stored in the least significant byte 114, step 226 is performed. Step 22
6 stores a byte value in bits 0 to 7 of the register 110.

【0022】ステップ228では、レジスタ110の最
上位バイト112を構成するビット8〜15は“0”に
設定される。したがって、レジスタ110のバイト値
は、符号のない値として取り扱われる。本発明によれ
ば、特殊符号拡張命令(specialsign extension instru
ction:「SXTB」)を実行して、このバイト値を符
号のあるバイト値に変換することできる。したがって、
この演算により、バイト値は、符号付き値または符号の
ない値として公式に取り扱われることができる。しか
し、ステップ224に開示されているように、最上位バ
イト112にバイト値がロードされると、最下位バイト
114は変更されない。
In step 228, bits 8 to 15 constituting the most significant byte 112 of the register 110 are set to "0". Therefore, the byte value of the register 110 is treated as an unsigned value. According to the present invention, a special sign extension instruction (specialsign extension instru
ction: “SXTB”) to convert this byte value to a signed byte value. Therefore,
This operation allows byte values to be officially treated as signed or unsigned values. However, when the most significant byte 112 is loaded with a byte value, as disclosed in step 224, the least significant byte 114 remains unchanged.

【0023】バイト値がレジスタ110に格納されてし
まうと、ステップ230はCPU100に制御を戻す。
ステップ216またはステップ218から取り出された
バイト値は、ソフトウエア・コマンドを実行するような
CPU100の演算で使用することができる。
When the byte value has been stored in the register 110, step 230 returns control to the CPU 100.
The byte value retrieved from step 216 or step 218 can be used in CPU 100 operations such as executing a software command.

【0024】たとえば、CPU100は、メモリアレイ
120からバイト値を取り出してレジスタ110に格納
する命令を発行する。このバイト値は“5”のインデッ
クス値もつ。したがって、所望のバイト値も“2”のオ
フセット152をもつ。ポインタ150からのオフセッ
ト152を使用すると、所望のバイト値を格納する16
ビット語として、メモリ・アドレス132が指示され
る。このバイト値は“5”のインデックスをもつので、
メモリ・アドレス132のビット8〜15が読み出さ
れ、バイト値はこれらの8ビットから取り出される。C
PU100からの命令は、バイト値がレジスタ110の
最下位バイト114に格納されることをさらに示してい
る。したがって、メモリ・アドレス132のビット8〜
15の8ビット語が、最下位バイト114に書き込まれ
る。今度は、レジスタ132のビット8〜15がレジス
タ110のビット0〜7を含む。
For example, CPU 100 issues an instruction to take out a byte value from memory array 120 and store it in register 110. This byte value has an index value of "5". Therefore, the desired byte value also has an offset 152 of "2". Using the offset 152 from the pointer 150 stores the desired byte value 16
Memory address 132 is indicated as a bit word. Since this byte value has an index of "5",
Bits 8-15 of memory address 132 are read, and the byte value is derived from these 8 bits. C
The instruction from PU 100 further indicates that the byte value is stored in least significant byte 114 of register 110. Therefore, bits 8 to of memory address 132
Fifteen 8-bit words are written to the least significant byte 114. This time, bits 8-15 of register 132 include bits 0-7 of register 110.

【0025】図3を参照すると、本発明によるCPU1
00上でデータをアンパックする方法が開示されてい
る。データをアンパックすることによって、CPU10
0は、レジスタ110の16ビット語からバイト値を分
離して、それをメモリアレイ120に格納する。一実施
形態では、アンパッキング命令はCPU100から受信
される。アンパッキング演算は、パッキングの逆の演算
を実行するために実行される。ステップ312では、レ
ジスタ110は、そこからバイト値が読み出されるレジ
スタとして指示される。ステップ314では、最上位バ
イト112または最下位バイト114のいずれがレジス
タ110から読み出されるかが、ステップ310で受信
された命令から決定される。ステップ314で最上位バ
イト112が指示されると、ステップ316が実行され
る。ステップ316では、レジスタ110の最上位バイ
ト112を構成するビット8〜15からバイト値が取り
出される。ステップ314が最下位バイト114を読み
出すことを指示していると、ステップ318が実行され
る。ステップ318では、レジスタ110の最下位バイ
ト114を構成するビット0〜7からバイト値が取り出
される。したがって、このバイト値は、レジスタ110
から読み出されたバイト・サイズ語である。
Referring to FIG. 3, the CPU 1 according to the present invention
A method for unpacking data on 00 is disclosed. By unpacking the data, the CPU 10
A 0 separates the byte value from the 16-bit word of register 110 and stores it in memory array 120. In one embodiment, an unpacking instruction is received from CPU 100. The unpacking operation is performed to perform the inverse operation of packing. In step 312, register 110 is designated as the register from which the byte value is read. In step 314, it is determined from the instruction received in step 310 whether the most significant byte 112 or the least significant byte 114 is to be read from the register 110. If the most significant byte 112 is indicated in step 314, step 316 is executed. In step 316, a byte value is extracted from bits 8 to 15 forming the most significant byte 112 of the register 110. If step 314 indicates that the least significant byte 114 is to be read, step 318 is performed. In step 318, a byte value is extracted from bits 0 to 7 constituting the least significant byte 114 of the register 110. Therefore, this byte value is stored in register 110
Is the byte size word read from.

【0026】ステップ320では、バイト値のインデッ
クス値は、そのバイト値がメモリアレイ120のレジス
タに上位メモリ値または下位メモリ値のどちらとして格
納されるかを決定する。そのインデックス値はまた、オ
フセット152に変換されて、そのバイト値を格納する
メモリ・アドレスを指示する。ステップ320は、イン
デックス値が偶数か奇数かを決定する。インデックス値
が奇数の場合には、ステップ322が実行される。ステ
ップ322では、メモリアレイ120内のメモリ・アド
レスのビット8〜15にバイト値が格納される。ステッ
プ324では、メモリ・アドレスのビット0〜7は変更
されない。したがって、奇数のインデックス値は、ステ
ップ316またはステップ318で読み出されたバイト
値が、指定されたメモリ・アドレスの最上位バイト・セ
クションに格納されることを指示する。
In step 320, the index value of the byte value determines whether the byte value is stored in a register of memory array 120 as an upper memory value or a lower memory value. The index value is also translated to offset 152 to indicate the memory address where the byte value is stored. Step 320 determines whether the index value is even or odd. If the index value is odd, step 322 is executed. In step 322, a byte value is stored in bits 8 to 15 of the memory address in the memory array 120. In step 324, bits 0-7 of the memory address are not changed. Thus, an odd index value indicates that the byte value read in step 316 or step 318 is stored in the most significant byte section of the specified memory address.

【0027】ステップ320でインデックス値が偶数の
場合には、ステップ326が実行される。ステップ32
6は、指定されたアドレスの最下位バイトを構成するビ
ット0〜7にバイト値を格納する。ステップ328で
は、指定されたアドレスのビット8〜15は変更されな
い。したがって、偶数のインデックス値は、ステップ3
16またはステップ318で読み出されたバイト値が、
指定されたメモリ・アドレスの最下位バイト・セクショ
ンに格納されることを指示する。また、指定されたアド
レスの反対側の8ビットを変更せずに、このバイト値と
指定されたアドレスにおける16ビット語とを組み合わ
せることができる。その上、指定されたアドレスの他の
バイトは、格納されたバイト値とは異なるインデックス
値をもつ。ステップ330では、ポインタ150と
“2”で割られたインデックス値(すなわち、オフセッ
ト152)とによって指示されるとおり、指定されたア
ドレスに16ビット語が格納される。ステップ332で
は、制御がCPU100に戻る。
If the index value is an even number in step 320, step 326 is executed. Step 32
6 stores a byte value in bits 0 to 7 constituting the least significant byte of the specified address. In step 328, bits 8-15 of the specified address are not changed. Therefore, the even index value is calculated in step 3
16 or the byte value read in step 318 is
Indicates to be stored in the least significant byte section of the specified memory address. Also, this byte value can be combined with the 16-bit word at the specified address without changing the opposite 8 bits of the specified address. Moreover, the other bytes of the specified address have different index values than the stored byte values. In step 330, the 16-bit word is stored at the specified address, as indicated by pointer 150 and the index value divided by "2" (ie, offset 152). In step 332, control returns to CPU100.

【0028】たとえば、CPU100は、レジスタ11
0からメモリアレイ120のメモリ・アドレスにバイト
値を移動させる命令を発行する。この命令は、バイト値
が最上位バイト112から読み出されることを示してい
る。したがって、バイト値は、CPU100のレジスタ
110のビット8〜15に等しい。次に、このバイト値
は、そのインデックス値によって指定された場所でメモ
リアレイ120に格納される。このバイト値が“6”の
インデックス値をもっていると、このバイト値は“3”
のオフセット152をもつことになる。オフセット15
2は、ポインタ150から3つのアドレス位置だけ離れ
ている。すなわち、ポインタはメモリ・アドレス136
を指している。偶数である“6”のインデックス値は、
メモリ・アドレス136の最下位バイト・メモリにこの
バイト値が格納されることを指示している。このため、
このバイト値はビット0〜7に格納される。したがっ
て、レジスタ110のビット8〜15は、開示された方
法に従ってメモリ・アドレス136のビット0〜7に格
納される。
For example, CPU 100 stores
Issue an instruction to move a byte value from 0 to a memory address in memory array 120. This instruction indicates that the byte value is to be read from the most significant byte 112. Therefore, the byte value is equal to bits 8 to 15 of the register 110 of the CPU 100. This byte value is then stored in the memory array 120 at the location specified by the index value. If this byte value has an index value of "6", this byte value is "3"
Has an offset 152 of Offset 15
2 is three addresses away from pointer 150. That is, the pointer points to memory address 136.
Pointing to. The index value of even "6" is
This indicates that the least significant byte memory at memory address 136 stores this byte value. For this reason,
This byte value is stored in bits 0-7. Thus, bits 8-15 of register 110 are stored in bits 0-7 of memory address 136 according to the disclosed method.

【0029】このように、本発明によれば、上に説明し
た利点を満足する中央処理装置上でデータをパック及び
アンパックする装置及び方法が提供されることは明らか
である。本発明を詳細に説明してきたが、この中で各種
の変更、代替及び修正をできることは理解されるはずで
ある。たとえば、データ語は、8ビット語及び16ビッ
ト語であるとして説明されているが、処理されるデータ
語のビット・サイズは異なってもよい。他の多くの実施
形態は、当業者によって容易に確認可能であって、特許
請求の範囲によって定義される本発明の趣旨及び範囲か
ら逸脱することなく実現することができる。
Thus, it is apparent that there has been provided, in accordance with the present invention, an apparatus and method for packing and unpacking data on a central processing unit that satisfies the advantages set forth above. While the invention has been described in detail, it should be understood that various changes, substitutions, and modifications can be made therein. For example, while the data words are described as being 8-bit words and 16-bit words, the data words processed may have different bit sizes. Many other embodiments are readily ascertainable by one skilled in the art and may be made without departing from the spirit and scope of the invention as defined by the appended claims.

【0030】以上の説明に関して、更に以下の項を開示
する。 (1)中央処理装置上でデータをパック及びアンパック
する方法であって、ポインタ及びインデックス値を用い
てメモリアレイ内のメモリ・アドレスを指定するステッ
プであって、前記メモリ・アドレスが上位メモリ値及び
下位メモリ値をもつ、ステップと、前記メモリ・アドレ
スからバイト値を取り出すステップであって、前記バイ
ト値が、前記インデックス値が奇数の場合には前記上位
メモリ値から読み出され、前記インデックス値が偶数の
場合には前記下位メモリ値から読み出される、ステップ
と、レジスタに前記バイト値を書き込むステップと、前
記レジスタから前記バイト値を読み出すステップと、前
記インデックス値が奇数の場合には前記上位メモリ値に
前記バイト値を格納し、前記インデックス値が偶数の場
合には前記下位メモリ値に前記バイト値を格納するステ
ップと、を含む、方法。
With respect to the above description, the following items are further disclosed. (1) A method of packing and unpacking data on a central processing unit, wherein a memory address in a memory array is specified using a pointer and an index value, wherein the memory address is an upper memory value and Having a lower memory value, and extracting a byte value from the memory address, wherein the byte value is read from the upper memory value if the index value is odd, and If even, read from the lower memory value; write the byte value to a register; read the byte value from the register; if the index value is odd, the upper memory value The byte value is stored in the lower byte if the index value is even. Comprising storing said byte value to re values, the method.

【0031】(2)前記レジスタが最上位バイト及び最
下位バイトをさらに含む、第1項記載の方法。 (3)前記書き込みステップが前記最上位バイトに前記
バイト値を書き込むことをさらに含む、第2項記載の方
法。 (4)前記書込みステップが前記最下位バイトに前記バ
イト値を格納することをさらに含む、第2項記載の方
法。 (5)前記書込みステップが前記最上位バイトをゼロに
等しく設定することをさらに含む、第4項記載の方法。 (6)前記読出しステップが前記最上位バイトから前記
バイト値を読み出すことをさらに含む、第2項記載の方
法。 (7)前記読出しステップが前記レジスタの前記最下位
バイトから前記バイト値を読み出すことをさらに含む、
第2項記載の方法。 (8)前記メモリ・アドレスが16ビット・レジスタで
ある、第1項記載の方法。 (9)前記バイト値が8ビット語である、第1項記載の
方法。 (10)前記レジスタが16ビット・レジスタである、
第1項記載の方法。 (11)前記最上位バイト及び前記最下位バイトが8ビ
ット語を含む、第2項記載の方法。 (12)前記書込みステップが、前記レジスタの前記最
下位バイトに格納されたバイト値が符号付きバイト値に
変換されるように特殊な符号拡張命令を受信することを
さらに含む、第5項記載の方法。
(2) The method of claim 1, wherein said register further comprises a most significant byte and a least significant byte. 3. The method of claim 2, wherein said writing step further comprises writing said byte value to said most significant byte. 4. The method of claim 2, wherein said writing step further comprises storing said byte value in said least significant byte. 5. The method of claim 4, wherein said writing step further comprises setting said most significant byte equal to zero. 6. The method of claim 2, wherein said reading step further comprises reading said byte value from said most significant byte. (7) the reading step further includes reading the byte value from the least significant byte of the register;
3. The method according to claim 2. (8) The method of claim 1, wherein said memory address is a 16-bit register. (9) The method of claim 1, wherein said byte value is an 8-bit word. (10) the register is a 16-bit register;
The method of claim 1. 11. The method of claim 2, wherein said most significant byte and said least significant byte comprise an 8-bit word. 12. The method of claim 5, wherein the writing step further comprises receiving a special sign extension instruction such that a byte value stored in the least significant byte of the register is converted to a signed byte value. Method.

【0032】(13)中央処理装置上でデータをパック
及びアンパックする装置であって、複数のメモリ・アド
レスをもつメモリアレイであって、ポインタ及びインデ
ックス値が前記メモリアレイのメモリ・アドレスを指定
し、該メモリ・アドレスが上位メモリ値及び下位メモリ
値を含む、メモリアレイと、前記インデックス値が奇数
の場合には前記上位メモリ値から読み出され、前記イン
デックス値が偶数の場合には前記下位メモリ値から読み
出されるバイト値と、最上位バイト及び最下位バイトを
もつレジスタであって、前記中央処理装置によって命令
されると前記バイト値が前記最上位バイトに格納され、
前記中央処理装置によって命令されると前記バイト値が
前記最下位バイトに格納される、レジスタと、前記メモ
リ・アドレスから前記バイト値を取り出して前記レジス
タに前記バイト値を書き込むパッキング命令と、前記レ
ジスタから前記メモリ・アドレスに前記バイト値を読み
出すアンパッキング命令と、を具備する、装置。
(13) An apparatus for packing and unpacking data on a central processing unit, wherein the memory array has a plurality of memory addresses, and a pointer and an index value designate a memory address of the memory array. A memory array in which the memory address includes an upper memory value and a lower memory value; and a memory array read from the upper memory value if the index value is odd, and the lower memory if the index value is even. A register having a byte value read from the value, a most significant byte and a least significant byte, wherein when instructed by the central processing unit, the byte value is stored in the most significant byte;
A register that, when commanded by the central processing unit, stores the byte value in the least significant byte; a packing instruction that retrieves the byte value from the memory address and writes the byte value into the register; An unpacking instruction for reading the byte value from the memory address to the memory address.

【0033】(14)中央処理装置上でデータを処理す
る方法であって、ポインタ及びインデックス値を用いて
メモリアレイの上位メモリ値及び下位メモリ値をもつメ
モリ・アドレスを指定し、前記インデックス値が奇数の
場合には前記上位メモリ値から読み出され、前記インデ
ックス値が偶数の場合には前記下位メモリ値から読み出
されるバイト値を前記メモリ・アドレスから取り出し、
レジスタに前記バイト値を書き込むパッキング命令を実
行するステップと、前記レジスタから前記バイト値を読
み出して、前記インデックス値が奇数の場合には前記上
位メモリ値に前記バイト値を書き込み、前記インデック
ス値が偶数の場合には前記下位メモリ値に前記バイト値
を書き込むことによって前記バイト値を前記メモリ・ア
ドレスに格納するアンパッキング命令を実行するステッ
プと、を含む、方法。 (15)前記レジスタが最上位バイト及び最下位バイト
を含み、前記バイト値が前記最上位バイトに格納される
か前記最下位バイトに格納される、第14項記載の方
法。
(14) A method of processing data on a central processing unit, wherein a memory address having an upper memory value and a lower memory value of a memory array is designated using a pointer and an index value, and the index value is If the odd value is read from the upper memory value, and if the index value is even, the byte value read from the lower memory value is extracted from the memory address.
Executing a packing instruction to write the byte value to a register; reading the byte value from the register; writing the byte value to the upper memory value if the index value is odd; Executing an unpacking instruction that stores the byte value at the memory address by writing the byte value to the lower memory value. 15. The method of claim 14, wherein said register comprises a most significant byte and a least significant byte, and wherein said byte value is stored in said most significant byte or said least significant byte.

【0034】(16)中央処理装置上でデータを処理す
る装置であって、複数のメモリ・アドレスをもつメモリ
アレイと、該メモリアレイでポインタ及びインデックス
値によって指示される、上位メモリ値及び下位メモリ値
をもつ各メモリ・アドレスと、最上位バイト及び最下位
バイトをもつレジスタと、前記インデックス値が奇数の
場合には前記上位メモリ値に等しく、前記インデックス
値が偶数の場合には前記下位メモリ値に等しいバイト値
を前記メモリ・アドレスから取り出すとともに、前記最
上位バイトまたは前記最下位バイトに前記バイト値を格
納するパッキング命令と、前記最上位バイトまたは前記
最下位バイトから読み出された前記バイト値を前記レジ
スタから取り出すとともに、前記インデックス値が奇数
の場合には前記上位メモリ値で、前記バイト値が偶数の
場合には前記下位メモリ値で前記メモリ・アドレスに前
記バイト値を格納するアンパッキング命令と、を具備す
る、装置。
(16) An apparatus for processing data on a central processing unit, comprising: a memory array having a plurality of memory addresses; and an upper memory value and a lower memory indicated by a pointer and an index value in the memory array. A memory address having a value, a register having a most significant byte and a least significant byte, and the upper memory value if the index value is odd, and the lower memory value if the index value is even. A packing instruction for retrieving a byte value from said memory address equal to and storing said byte value in said most significant byte or said least significant byte; and said byte value read from said most significant byte or said least significant byte From the register, and when the index value is odd, the upper In memory value, anda unpacking instruction for storing the byte value in the memory address in the lower memory value when the byte value is an even number, device.

【0035】(17)中央処理装置(100)上でデー
タをパック及びアンパックする装置が開示される。この
装置は、複数のメモリ・アドレスをもつメモリアレイ
(120)を含む。メモリアレイ(120)では、ポイ
ンタ(150)及びインデックス値は、上位メモリ値
(140)及び下位メモリ値(138)を有するメモリ
・アドレス(142)を指定する。バイト値は、インデ
ックス値が奇数の場合には上位メモリ値(140)から
読み出され、インデックス値が偶数の場合には下位メモ
リ値(138)から読み出される。バイト値は、最上位
バイト(112)及び最下位バイト(114)を有する
レジスタ(110)に格納される。この装置は、メモリ
・アドレス(142)からバイト値を読み出し、そのバ
イト値をレジスタ(110)に退避させるパッキング命
令をさらに含む。この装置は、レジスタ(110)から
メモリ・アドレス(142)にバイト値を読み出すアン
パッキング命令をさらに含む。また、中央処理装置(1
00)上でデータをパック及びアンパックする方法が開
示される。この方法は、ポインタ(150)及びインデ
ックス値を用いてメモリアレイ(120)のメモリ・ア
ドレス(142)を指示するステップを含む。メモリ・
アドレス(142)は、上位メモリ値(140)及び下
位メモリ値(138)をもつ。この方法は、メモリ・ア
ドレス(142)からバイト値を取り出すステップをさ
らに含む。バイト値は、インデックス値が奇数の場合に
は上位メモリ値(140)から読み出され、インデック
ス値が偶数の場合には下位メモリ値(138)から読み
出される。この方法は、レジスタ(110)にバイト値
を書き込むステップをさらに含む。この方法は、レジス
タ(110)からバイト値を読み出すステップをさらに
含む。この方法は、インデックス値が奇数の場合には上
位メモリ値(140)にバイト値を格納し、インデック
ス値が偶数の場合には下位メモリ値(138)にバイト
値を格納するステップをさらに含む。
(17) An apparatus for packing and unpacking data on a central processing unit (100) is disclosed. The apparatus includes a memory array having a plurality of memory addresses. In the memory array (120), the pointer (150) and the index value specify a memory address (142) having an upper memory value (140) and a lower memory value (138). The byte value is read from the upper memory value (140) when the index value is odd, and is read from the lower memory value (138) when the index value is even. The byte value is stored in a register (110) having a most significant byte (112) and a least significant byte (114). The apparatus further includes a packing instruction for reading a byte value from the memory address (142) and saving the byte value to the register (110). The apparatus further includes an unpacking instruction that reads a byte value from the register (110) to the memory address (142). In addition, the central processing unit (1
00), a method for packing and unpacking data is disclosed. The method includes pointing to a memory address (142) of the memory array (120) using the pointer (150) and the index value. memory·
The address (142) has an upper memory value (140) and a lower memory value (138). The method further includes retrieving a byte value from the memory address (142). The byte value is read from the upper memory value (140) when the index value is odd, and is read from the lower memory value (138) when the index value is even. The method further includes writing a byte value to the register (110). The method further includes reading a byte value from the register (110). The method further includes storing the byte value in the upper memory value (140) if the index value is odd and storing the byte value in the lower memory value (138) if the index value is even.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施形態に従ってCPUとともに使
用するためのメモリアレイ及びレジスタの簡単なブロッ
ク図である。
FIG. 1 is a simplified block diagram of a memory array and registers for use with a CPU according to one embodiment of the present invention.

【図2】本発明の一実施形態によるCPU上でデータを
パックする方法のフローチャートである。
FIG. 2 is a flowchart of a method for packing data on a CPU according to one embodiment of the present invention.

【図3】本発明の一実施形態によるCPU上でデータを
アンパックする方法のフローチャートである。
FIG. 3 is a flowchart of a method for unpacking data on a CPU according to one embodiment of the present invention.

【符号の説明】[Explanation of symbols]

0,1,2,3 16ビット語 100 中央処理装置 110 レジスタ 112 最上位バイト(MSB) 114 最下位バイト(LSB) 120 メモリアレイ 124,128,132,136 メモリ・アドレス 138 下位メモリ値 140 上位メモリ値 142 N番目のメモリ・アドレス 150 ポインタ 152 オフセット 160 データ転送経路を示す矢印 0, 1, 2, 3 16-bit word 100 Central processing unit 110 Register 112 Most significant byte (MSB) 114 Least significant byte (LSB) 120 Memory array 124, 128, 132, 136 Memory address 138 Lower memory value 140 Upper memory Value 142 Nth memory address 150 Pointer 152 Offset 160 Arrow indicating data transfer path

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 中央処理装置上でデータをパック及びア
ンパックする方法であって、 ポインタ及びインデックス値を用いてメモリアレイ内の
メモリ・アドレスを指定するステップであって、前記メ
モリ・アドレスが上位メモリ値及び下位メモリ値をも
つ、ステップと、 前記メモリ・アドレスからバイト値を取り出すステップ
であって、前記バイト値が、前記インデックス値が奇数
の場合には前記上位メモリ値から読み出され、前記イン
デックス値が偶数の場合には前記下位メモリ値から読み
出される、ステップと、 レジスタに前記バイト値を書き込むステップと、 前記レジスタから前記バイト値を読み出すステップと、 前記インデックス値が奇数の場合には前記上位メモリ値
に前記バイト値を格納し、前記インデックス値が偶数の
場合には前記下位メモリ値に前記バイト値を格納するス
テップと、 を含む、方法。
1. A method of packing and unpacking data on a central processing unit, the method comprising: specifying a memory address in a memory array using a pointer and an index value, wherein the memory address is a higher memory. Retrieving a byte value from the memory address, the byte value being read from the upper memory value if the index value is odd; If the value is even, read from the lower memory value; writing the byte value to a register; reading the byte value from the register; if the index value is odd, the higher value Store the byte value in the memory value, and if the index value is even, Comprising storing said byte value into serial low memory value, the method.
【請求項2】 中央処理装置上でデータをパック及びア
ンパックする装置であって、 複数のメモリ・アドレスをもつメモリアレイであって、
ポインタ及びインデックス値が前記メモリアレイのメモ
リ・アドレスを指定し、該メモリ・アドレスが上位メモ
リ値及び下位メモリ値を含む、メモリアレイと、 前記インデックス値が奇数の場合には前記上位メモリ値
から読み出され、前記インデックス値が偶数の場合には
前記下位メモリ値から読み出されるバイト値と、 最上位バイト及び最下位バイトをもつレジスタであっ
て、前記中央処理装置によって命令されると前記バイト
値が前記最上位バイトに格納され、前記中央処理装置に
よって命令されると前記バイト値が前記最下位バイトに
格納される、レジスタと、 前記メモリ・アドレスから前記バイト値を取り出して前
記レジスタに前記バイト値を書き込むパッキング命令
と、 前記レジスタから前記メモリ・アドレスに前記バイト値
を読み出すアンパッキング命令と、 を具備する、装置。
2. An apparatus for packing and unpacking data on a central processing unit, comprising: a memory array having a plurality of memory addresses;
A pointer and an index value specifying a memory address of the memory array, the memory address including an upper memory value and a lower memory value, and reading from the upper memory value if the index value is odd. A byte value read from the lower memory value if the index value is an even number, and a register having a most significant byte and a least significant byte. A register stored in the most significant byte and where the byte value is stored in the least significant byte when instructed by the central processing unit; fetching the byte value from the memory address and storing the byte value in the register A packing instruction to write the byte value from the register to the memory address. An unpacking instruction to read.
JP11076252A 1998-03-20 1999-03-19 Method and device for packing and unpacking data on central processing unit Pending JP2000029687A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US7870998P 1998-03-20 1998-03-20
US078709 1998-03-20

Publications (1)

Publication Number Publication Date
JP2000029687A true JP2000029687A (en) 2000-01-28

Family

ID=22145758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11076252A Pending JP2000029687A (en) 1998-03-20 1999-03-19 Method and device for packing and unpacking data on central processing unit

Country Status (1)

Country Link
JP (1) JP2000029687A (en)

Similar Documents

Publication Publication Date Title
US7124275B2 (en) Apparatus and method for determining a physical address from a virtual address by using a hierarchical mapping regulation with compressed nodes
US4777588A (en) General-purpose register file optimized for intraprocedural register allocation, procedure calls, and multitasking performance
US6549995B1 (en) Compressor system memory organization and method for low latency access to uncompressed memory regions
US20040215852A1 (en) Active memory data compression system and method
US5381537A (en) Large logical addressing method and means
US5717910A (en) Operand compare/release apparatus and method for microinstrution sequences in a pipeline processor
JP2970821B2 (en) Data processing device
US5848436A (en) Method and apparatus for efficiently providing data from a data storage medium to a processing entity
JPH05210570A (en) Method and means extending address
JP4088418B2 (en) Computer instructions that generate multiple results of different data types to improve software emulation
JPS584368B2 (en) Data Field Hikakouchi
US4608633A (en) Method for decreasing execution time of numeric instructions
KR100463205B1 (en) Computer system embedded sequantial buffer for improving DSP data access performance and data access method thereof
US4575795A (en) Apparatus for detecting a predetermined character of a data string
JP2954178B1 (en) Variable cache method
US7676651B2 (en) Micro controller for decompressing and compressing variable length codes via a compressed code dictionary
KR960008320B1 (en) System equipped with processor and method of converting addresses in the said system
JP2000029687A (en) Method and device for packing and unpacking data on central processing unit
US7124261B2 (en) Access to bit values within data words stored in a memory
JPH087680B2 (en) Instruction counter loading device
US20040054873A1 (en) Indirect indexing instructions
US6625717B2 (en) Single cycle linear address calculation for relative branch addressing
US6321319B2 (en) Computer system for allowing a two word jump instruction to be executed in the same number of cycles as a single word jump instruction
JP2915680B2 (en) RISC processor
TW200415515A (en) System for allowing only a partial value prediction field/cache size