私はプログラミング言語の概念 (Sebesta 第 10 版) を読んでおり、テキスト内で直交性を「比較的少数のプリミティブ構造のセットを比較的少数の方法で組み合わせて、プログラミング言語の制御およびデータ構造を構築できる」という意味として定義しています。言語"。しかし、特定の言語機能を直交させるものについては混乱しています。私はおそらくテキストをそのすべての栄光で説明することはできないので:)、適切なテキストの下に含めました.
We can illustrate the use of orthogonality as a design concept by comparing
one aspect of the assembly languages of the IBM mainframe computers
and the VAX series of minicomputers. We consider a single simple situation:
adding two 32-bit integer values that reside in either memory or registers and
replacing one of the two values with the sum. The IBM mainframes have two
instructions for this purpose, which have the forms
A Reg1, memory_cell
AR Reg1, Reg2
where Reg1 and Reg2 represent registers. The semantics of these are:
Reg1 ← contents(Reg1) + contents(memory_cell)
Reg1 ← contents(Reg1) + contents(Reg2)
The VAX addition instruction for 32-bit integer values is
ADDL operand_1, operand_2
whose semantics is
operand_2 ← contents(operand_1) + contents(operand_2)
In this case, either operand can be a register or a memory cell.
The VAX instruction design is orthogonal in that a single instruction can
use either registers or memory cells as the operands. There are two ways to
specify operands, which can be combined in all possible ways. The IBM design
is not orthogonal. Only two out of four operand combinations possibilities are
legal, and the two require different instructions, A and AR.>
私の主な質問は、なぜ VAX 命令が直交するのかということです。コンストラクトの命令が少なくて済み、すべてを 1 行で完了できるという理由だけですか? VAX シリーズのコンピュータが 2 つの命令を使用し、IBM が 3 つの命令を使用する場合、VAX 言語はより直交性が高くなりますか? どんな助けでも大歓迎です。