United States Patent5201039
SakamuraApril 6, 1993

Title

Multiple address-space data processor with addressable register and context switching

Abstract

Two or more address spaces are provided in a data processor. One of the address spaces comprises control registers so that the control registers can be accessed using instructions having an address in the second address space. High-speed context switching can be accomplished by allotting the context-saving area to the second address space. The context can be saved in various formats specified by a context format register.


Inventors:Sakamura; Ken (Tokyo, JP)
Assignee:Mitsubishi Denki Kabushiki Kaisha (Tokyo, JP)
Appl. No.:569758
Filed:August 20, 1990
Foreign Application Priority Data

Sep 30, 1987 [JP] 62-247418

Current U.S. Class:711/201 711/202 712/228 
Field of Search:395/425,400,375,650

U.S. Patent Documents
3614742October 1971Watson et al.
4093986June 1978Bodner
4484274November 1984Berenbanm et al.
4500962February 1985Lemaire et al.
4574349March 1986Rechtschaffen
4608632August 1986Kummer
4654819March 1987Stiffler et al.
4731736March 1988Mothersole et al.
4761733August 1988McCrocklin et al.
Foreign Patent Documents
62-189537Aug., 1987JP
Other References
Caspers et al. "Cache-Resident Processor Registers", IBM TDB, vol. 22, No. 6, Nov. 1979, pp. 2317-2318. .
VAX Architecture Handbook, Digital Equipment Corp., 1981, Chap. 8, pp. 125-129, Chap. 10, p. 163..~
Primary Examiner: Lee; Thomas C.
Assistant Examiner: Harrity; Paul
Attorney, Agent or Firm:Townsend and Townsend

Parent Case Text



This is a continuation of application Ser. No. 07/173,501, filed Mar. 24, 1988, now abandoned.

Claims


What is claimed is:
1. In a data processor for processing data according to a program which includes a plurality of executable instructions, the data processor having a plurality of registers, apparatus for storing information comprising:
a first portion of byte-addressable memory for storing data and programs, at least some of the byte-addresses for said first portion of byte-addressable memory forming a first address space in which programs and data are mapped, each address in said first address space is either an operand address or an instruction address of at least one of said plurality of instructions; and
a second portion of byte-addressable memory, at least some of the byte-addresses for said second portion forming a second address space different from said first address space, at least some addresses of said second address space being addresses which also occur in said first address space, wherein at least a first of said registers has a byte address, said first register being mapped by said byte address to said second address space such that said first register is accessible using a second instruction which has an operand address in said second address space, said byte address of said first register in said second address space being identical to said operand address or instruction address of said one of said instructions in said first address space
whereby said data processor accesses said operand address or said instruction address in said first address space by executing said one of said instructions having said operand address or said instruction address in said first address space; and
whereby said data processor accesses said first register in said second address space by executing said second instruction having said operand address in said second address space.

2. The apparatus as set forth in claim 1, wherein:
at least one of said plurality of instructions is an instruction to save a context of said data processor into said second address space; and
at least one of said plurality of instructions is an instruction to restore a context from said second address space.

3. The apparatus as claimed in claim 2, wherein said context includes the contents of at least a first of said registers.

4. The apparatus as set forth in claim 1, wherein said first register is mapped to a first address in said second address space and wherein said first register comprises a plurality of independent fields, at least one of said independent fields of said first register being mapped to a second address in said second address space different from said first address of said first register.

5. The apparatus as claimed in claim 1, wherein all of said plurality of registers are mapped to said second address space.

6. Apparatus, as claimed in claim 1, wherein substantially all addresses in said second space occur in said first address space.

7. In a data processing system for processing data according to a program which includes a plurality of executable instructions, the data processing system having a main processor and a co-processor, said main processor having at least a first associated register and said co-processor having at least a second associated register, apparatus for storing information, comprising:
a first portion of byte-addressable memory for storing data and programs, at least some of the byte addresses for said first portion of byte-addressable memory forming a first address space, each address in said first address space is either an operand address or an instruction address of at least one of said plurality of instructions; and
a second portion of byte-addressable memory, at least some of the byte addresses for said second portion of byte-addressable memory forming a second address space, different from said first address space, at least some addresses of said second address space being addresses which also occur in said first address space, at least said first register associated with said main processor having a first byte address and said second register associated with said co-processor having a second byte address, said first and second registers being mapped to said second address space by said first and second byte addresses, said first and second registers being accessible using a respective second of said plurality of instructions which has an operand address in said second address space, at least one of said first and second byte addresses of said first and second registers in said second address space being identical to said operand address or instruction address of a respective one of said plurality of instructions in said first address space
whereby said main processor and said co-processor access a respective said operand address or said instruction address in said first address space by executing said respective one of said plurality of instructions having said operand address or said instruction address in said first address space; and
whereby said main processor and said co-processor access said first and second registers in said second address space by executing said respective second of said plurality of instructions having said operand address in said second address space.

8. In a data processor for processing data according to a program which includes a plurality of executable instructions, apparatus for storing information comprising:
a first portion of byte-addressable memory for storing data and programs, at least some of the byte-addresses for said first portion of byte-addressable memory forming a first address space in which programs and data are mapped, each address in said first address space is either an operand address or an instruction address of at least a first of said plurality of instructions;
a second portion of byte-addressable memory, at least some of the byte-addresses for said second portion forming a second address space different from said first address space, at least some addresses of said second address space being addresses which also occur in said first address space;
the data processor executing at least a first of said plurality of instructions to save a context of said data processor into said second address space;
the data processor executing at least a second of said plurality of instructions, different from said first instruction, to restore said context from said second address space;
the data processor executing at least a third of said plurality of instructions, different from said first instruction, to save a context of said data processor into said first address space; and
the data processor executing at least a fourth of said plurality of instructions, different from said second instruction, to restore said context from said first address space.

9. The apparatus as set forth in claim 8, further comprising:
register means for specifying a format for storage of said context.

10. The apparatus as claimed in claim 8, further comprising:
means for specifying a format from among at least three formats for storage of a context block;
wherein said first instruction is an instruction to save a context according to the format specified in said means for specifying a format; and
wherein said second instruction is an instruction to restore a context according to the format specified in said means for specifying a format.

11. In a data processor for processing data according to a program which includes a plurality of executable instructions, including instructions for saving and restoring a context, apparatus for storing information comprising:
a first portion of byte-addressable memory for storing data and programs, at least some of the byte-addresses for said first portion of byte-addressable memory forming a first address space in which programs and data are mapped, each address in said first address is space is either an operand address or an instruction address of at least a first of said plurality of instructions;
a second portion of byte-addressable memory, at least some of the byte addresses for said second portion forming a second address space different from said first address space, at least some addresses of said second address space being addresses which also occur in said first address space, said second address space being accessible using said instructions for saving and restoring a context;
means for specifying into which address space a context block is to be stored according to one of said plurality of instructions;
the data processor executing at least a first of said plurality of instructions to save the context of a process into said address space specified by said means for specifying; and
the data processor executing at least a second of said plurality of instructions, different from said first instruction, to restore said context from the address space specified by said means for specifying.

12. In a data processor for processing data according to a program which includes a plurality of executable instructions, the data processor having a plurality of registers, a method for storing information comprising:
providing a first portion of byte-addressable memory for storing data and instructions, at least some of the byte-addresses for said first portion of byte-addressable memory forming a first address space in which data and instructions are mapped;
accessing at least a first address in said first address space by executing at least one of said instructions having an operand address in said first address space;
providing a second portion of byte-addressable memory, at least some of the byte-addresses for said second portion forming a second address space different from said first address space wherein at least a first of said registers is mapped by a byte address to said second address, at least some addresses of said second address space being addresses which also occur in said first address space; and
accessing said first register by executing a second of said instructions having an operand address in said second address space, said address of said first register in said second address space being identical to a data address or instruction address of said at least one instruction in said first address space.

13. The method as set forth in claim 12, further comprising:
executing an instruction to save a context in said data processor into said second address space; and
executing an instruction to restore a context from said second address space.

14. In a data processing system for processing data according to a program, which includes a plurality of executable instructions, the data processing system having a main processor and a co-processor, said main processor having at least a first associated register and said co-processor having at least a second associated register, a method for storing information, comprising:
providing a first portion of byte-addressable memory for storing data and programs, said byte-addressable memory having a plurality of storage locations addressable by a plurality of byte addresses at least some of the byte addresses for said first portion of byte-addressable memory forming a first address space;
executing at least one of said instructions, stored at an instruction address and having an operand address in said first address space;
providing a second portion of byte-addressable memory, at least some of the byte addresses for said second portion of byte-addressable memory forming a second address space, different from said first address space, at least some addresses of said second address space being addresses which occur in said first address space, at least said first register associated with said main processor having a first byte address and said second register associated with said co-processor having a second byte address, said first and second registers being mapped to said second address space by said first and second byte addresses;
accessing at least one of said first and second registers by executing a second of said plurality of instructions having an operand address in said second address space, the byte address of said one register in said second address space being identical to said operand address or instruction address of said one of said instructions in said first address space.

15. In a data processor for processing data according to a program which includes a plurality of executable instructions, including instructions for saving and restoring a context, a method for storing information comprising:
providing a first portion of byte-addressable memory for storing data and programs, at least some of the byte-addresses for said first portion of byte-addressable memory forming a first address space in which data and programs are mapped, each address in said first address space is either being usable as an operand address or an instruction address of at least a first of said plurality of instructions;
providing a second portion of byte-addressable memory, at least some of the byte-addresses for said second portion forming a second address space different from said first address space, said second address space being accessible using said instructions for saving and restoring a context, at least some addresses of said second address space being addresses which also occur in said first address space;
specifying, in a first of said plurality of instructions, into which address space a context block is to be stored;
saving the context of a process into said specified address space in response to said first instruction; and
restoring said context from the specified address space in response to a second instruction, different from said first instruction.

16. The method as claimed in claim 15, further comprising:
specifying a format from among at least three formats for storage of a context block;
wherein said step of saving includes saving a context according to said specified format; and
wherein said step of restoring includes restoring a context according to said specified format.

Description

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a data processor.

2. Description of the Prior Art

The address space at the conventional data processor, as shown in FIG. 1, comprises a memory storing therein programs and data; Internal registers in the processor are not mapped in the address space. In this case, it is required in accessing each register to use a particular instruction or specify the register, thereby not controlling each register in a unified manner and creating a problem in expansibility (problem 1).

Context switching of the conventional data processor is operated between the processor and a saving area in an external memory. In this case context switching takes much time. If the saving area is allotted to a particular high-speed memory to avoid this problem, the linearity of address space is deteriorated as shown in FIG. 2-(B) (problem 2).

Furthermore, in the conventional data processor, context switching is operated in batch with respect to all the contexts, thereby creating a problem in that even a register needless of switching is switched (problem 3).

SUMMARY OF THE INVENTION

In order to solve the above problems, the present invention has been designed. The first object thereof is to provide a data processor which is provided with an address space comprising control registers, thereby enabling all the control registers to be accessed in batch by addressing.

The second object of the invention is to provide a data processor which enables byte address with respect to the address space of the control register, thereby enabling the register and memory to be accessed by the same addressing method and facilitating the correspondence to extension, such as variation in register width.

The third object of the invention is to provide a data processor which adds a memory stored in a main processor to the address space comprising the control register, thereby enabling a high speed space for particular use to be obtained.

The fourth object of the invention is to provide a data processor which allots the context saving area at the processor to said space, thereby enabling high speed context switching.

The fifth object of the invention is to provide a data processor which makes the context variable so as to effectively utilize the restricted space.

The sixth object of the invention is to provide a data processor which makes the context variable so as to omit needless context switching, thereby providing context switching at high speed.

The data processor of the present invention is first characterized in that it has a first address space which byte-addresses a memory storing therein programs and data and a second address space different from the first address space so that a register is mapped by byte address at part of the second address space, thereby accessing the register by the byte address. The data processor of the present invention can similarly address-specify the register and memory, thereby enabling the unified control by software.

The data processor of the present invention is secondly characterized in that it has a main processor, a co-processor, a first address space which byte-addresses a memory storing therein programs and data, and a second address space different from the first address space, so that a register is mapped by byte address in part of the second address space, the register is accessed by the byte address, and registers at the co-processor are mapped, by a byte address, to the second address space.

The data processor of the present invention is thirdly characterized in that it has a third address space which byte-address a memory storing therein programs and data and a fourth address space different from the third address space, and by having an instruction to save the context of the processor to the fourth address space and the same to restore the context from the fourth address space.

The data processor present invention is fourthly characterized in that it has a third address space which byte-addresses a memory storing therein programs and data and a fourth address space different from the third address space, and further has an instruction to save the context of the processor to the fourth address space, the same to restore the context from the fourth address space, the same to selectively specify the third or fourth address space so as to save the context at the processor, and the same to selectively specify the third or fourth address space to restore the context.

Furthermore, the data processor of the present invention is fifthly characterized in that it has an instruction to save the context at the processor and the same to restore the context, thereby specifying the format of the context to be variable.

The above and further objects and features of the invention will more fully be apparent from the following detailed description with accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an illustration of address space of the conventional data processor,

FIG. 2-(A) and 2(B) are illustrations of the conventional context switching,

FIG. 3 and 4 are illustrations of address spaces at a data processor of the present invention,

FIG. 5 is an illustration of the context at the data processor of the present invention, and

FIG. 6 is an illustration of operation of PSW at the data processor of the present invention,

FIG. 7 is an illustration of a register set of the same,

FIG. 8 is an illustration of data type of bits of the same,

FIG. 9 is an illustration of data type as to a bit field of the same,

FIG. 10 is an illustration of data type as to the bit field of unsigned number of the same,

FIG. 11 is an illustration of data type as to the integer of the same,

FIG. 12 is an illustration of data type as to the decimal number of the same,

FIG. 13 is an illustration of data type as to a string of the same,

FIG. 14 is an illustration of data type as to a queue at the same,

FIG. 15 is an illustration exemplary of description of the instruction format of the same,

FIG. 16 shows a bit pattern thereof,

FIG. 17 shows an instruction format of the data processor of the invention respectively,

FIG. 18 shows an instruction format of the data processor of the invention respectively,

FIG. 19 shows an instruction format of the data processor of the invention respectively,

FIG. 20 shows an instruction format of the data processor of the invention respectively,

FIG. 21 shows an instruction format of the data processor of the invention respectively,

FIG. 22 shows an instruction format of the data processor of the invention respectively,

FIG. 23 shows an instruction format of the data processor of the invention respectively,

FIG. 24 shows an instruction format of the data processor of the invention respectively,

FIG. 25 shows an instruction format of the data processor of the invention respectively,

FIG. 26 shows an instruction format of the data processor of the invention respectively,

FIG. 27 shows an instruction format of the data processor of the invention respectively,

FIG. 28 shows the format of the addressing mode of the data processor of the present invention,

FIG. 29 shows the format of an addressing mode of the data processor of the present invention,

FIG. 30 shows the format of an addressing mode of the data processor of the present invention,

FIG. 31 shows the format of an addressing mode of the data processor of the present invention,

FIG. 32 shows the format of an addressing mode of the data processor of the present invention,

FIG. 33 shows the format of an addressing mode of the data processor of the present invention,

FIG. 34 shows the format of an addressing mode of the data processor of the present invention,

FIG. 35 shows the format of an addressing mode of the data processor of the present invention,

FIG. 36 shows the format of an addressing mode of the data processor of the present invention,

FIG. 37 shows the format of an addressing mode of the data processor of the present invention,

FIG. 38 shows the format of an addressing mode of the data processor of the present invention,

FIG. 39 shows the format of an addressing mode of the data processor of the present invention,

FIG. 40 is an illustration exemplary of arrangement of local variations of the same,

FIG. 41 shows the format of the addressing mode of the same,

FIG. 42 shows the format of the addressing mode of the same,

FIG. 43 shows the format of the addressing mode of the same,

FIG. 44 shows the format of the addressing mode of the same,

FIG. 45 is an illustration of cautioun at the instruction MOV,

FIG. 46 shows the format of PSW,

FIG. 47 shows the format of PSS,

FIG. 48 shows the format of PSH,

FIG. 49 shows the format of description example of the instruction set,

FIG. 50-(a) shows the format of instruction MOV,

FIG. 50-(b) is an illustration of status flags thereof,

FIG. 51 shows the format of instruction MOVU,

FIG. 52 is an illustration of the flag change thereof,

FIG. 53 shows the format of instruction PUSH,

FIG. 54 is an illustration of the flag change thereof,

FIG. 55 shows the format of instruction POP,

FIG. 56 is an illustration of the flag change,

FIG. 57 shows the format of the instruction LDM,

FIG. 58 is an illustration of the flag change thereof,

FIG. 59 is an illustration of bit map specifying,

FIG. 60 shows the format of an instruction STM,

FIG. 61 is an illustration of flag change thereof,

FIG. 62 is an illustration of the bit map specifying,

FIG. 63 is an illustration of the bit map specifying,

FIG. 64 shows the format of the instruction MOVA,

FIG. 65 is an illustration of flag change thereof,

FIG. 66 shows the format of instruction PUSHA,

FIG. 67 is an illustration of flag change thereof,

FIG. 68 shows the format of instruction CMP,

FIG. 69 is an illustration of flag change thereof,

FIG. 70 shows the format of instruction CMPU,

FIG. 71 is an illustration of flag change thereof,

FIG. 72 shows the format of instruction CHK,

FIG. 73 is an illustration of flag change thereof,

FIG. 74 is an illustration of operation by the instruction CHK,

FIG. 75 shows the format of instruction ADD,

FIG. 76 is an illustration of flag change,

FIG. 77 shows the format of instruction ADDU,

FIG. 78 is an illustration of flag change thereof,

FIG. 79 shows the format of instruction ADDX,

FIG. 80 is an illustration of flag change thereof,

FIG. 81 shows the format of instruction SUB,

FIG. 82 is an illustration of flag change thereof,

FIG. 83 shows the format of instruction SUBU,

FIG. 84 is an illustration of flag change thereof,

FIG. 85 shows the format of instruction SUBX,

FIG. 86 is an illustration of flag change thereof,

FIG. 87 shows the format of instruction MUL,

FIG. 88 is an illustration of flag change thereof,

FIG. 89 shows the format of instruction MULU,

FIG. 90 is an illustration of flag change thereof,

FIG. 91 shows the format of instruction MULX,

FIG. 92 is an illustration of flag change thereof,

FIG. 93 shows the format of instruction DIV,

FIG. 94 is an illustration of flag change thereof,

FIG. 95 shows the format of instruction DIVU

FIG. 96 is an illustration of flag change thereof,

FIG. 97 is a view showing the format of instruction DIVX,

FIG. 98 is an illustration of flag change thereof,

FIG. 99 is a view of format of instruction REM,

FIG. 100 is an illustration of flag change thereof,

FIG. 101 is a view of the format of instruction REMU,

FIG. 102 is an illustration of flag change thereof,

FIG. 103 is a view of the format of instruction NEG,

FIG. 104 is an illustration of flag change thereof,

FIG. 105 is a view of the format of instruction INDZX,

FIG. 106 is an illustration of flag change thereof,

FIG. 107 is a view of the format of instruction AND,

FIG. 108 is an illustration of flag change thereof,

FIG. 109 is a view of the format of instruction OR,

FIG. 110 is an illustration of flag change thereof,

FIG. 111 is a view of the format of instruction XOR,

FIG. 112 is an illustration of flag change thereof,

FIG. 113 is a view of the format of instruction NOT,

FIG. 114 is an illustration of flag change thereof,

FIG. 115 is a view of the format of instruction SHA,

FIG. 116 is an illustration of flag change thereof,

FIG. 117 is an illustration of the left-side shift,

FIG. 118 is an illustration of the right-side shift,

FIG. 119 is a view of the format of instruction SHL,

FIG. 120 is an illustration of flag change thereof,

FIG. 121 is an illustration of the left-side shift,

FIG. 122 is an illustration of the right-side shift,

FIG. 123 is a view of the format of instruction ROT,

FIG. 124 is an illustration of flag change thereof,

FIG. 125 is an illustration of counterclockwise rotation,

FIG. 126 is an illustration of clockwise rotation,

FIG. 127 is a view of the format of instruction SHXL,

FIG. 128 is an illustration of flag change thereof,

FIG. 129 is a view of the format of instruction XHXL,

FIG. 130 is an illustration of flag change thereof,

FIG. 131 is a view of the format of instruction SHXR,

FIG. 132 is a view of the format of instruction SHXR,

FIG. 133 is a view of the format of instruction RVBY,

FIG. 134 is an illustration of flag change thereof,

FIG. 135 is a view of the format of instruction RVBI,

FIG. 136 is an illustration of flag change thereof,

FIG. 137 is an illustration of bit operation instruction,

FIG. 138 is an illustration of bit operation instruction,

FIG. 139 is a view of the format of instruction BTST,

FIG. 140 is an illustration of flag change thereof,

FIG. 141 is a view of the format of instruction BSET,

FIG. 142 is an illustration of flag change thereof,

FIG. 143 is a view of the format of instruction BCLR,

FIG. 144 is an illustration of flag change thereof,

FIG. 145 is a view of the format of instruction BNOT,

FIG. 146 is an illustration of flag change thereof,

FIG. 147 is a view of the format of instruction BSCH,

FIG. 148 is an illustration of flag change thereof,

FIG. 149 is an illustration of fixed length bit field operation instruction,

FIG. 150(a) and 150(b) are a view of the format of instruction of bit field instruction,

FIG. 151 is a view of the format of instruction BFEXT,

FIG. 152 is an illustration of flag change thereof,

FIG. 153 is a view of the format of instruction BFEXTU,

FIG. 154 is an illustration of flag change thereof,

FIG. 155 is a view of the format of instruction BFINS,

FIG. 156 is an illustration of flag change thereof,

FIG. 157 is a view of the format of instruction BFINSU,

FIG. 158 is an illustration of flag change thereof,

FIG. 159 is a view of the format of instruction BFCMP,

FIG. 160 is an illustration of flag change thereof,

FIG. 161 is a view of the format of instruction BFCMPU,

FIG. 162 is an illustration of flag change thereof,

FIG. 163(a) and 163(b) are a view of the format of instruction BVSCH,

FIG. 164 is an illustration of flag change thereof,

FIG. 165 is a view of the format of instruction BVMAP,

FIG. 166 is an illustration of flag change thereof,

FIG. 167 is a view of format of instruction BVMAT,

FIG. 168 is a view of format of instruction BVMAT,

FIG. 169 is a view of format of instruction BVMAT,

FIG. 170 is a view of the format of instruction BVCPY,

FIG. 171 is an illustration of flag change thereof,

FIG. 172 is a view of the format of instruction BVPAT,

FIG. 173 is an illustration of flag change thereof,

FIG. 174 is a view of the format of instruction ADDDX,

FIG. 175 is an illustration of flag change thereof,

FIG. 176 is a view of the format of instruction SUBDX,

FIG. 177 is an illustration of flag change thereof,

FIG. 178 is a view of the format of instruction PACKss,

FIG. 179 is an illustration of flag change thereof,

FIG. 180 is a view of the format of instruction UNPKss,

FIG. 181 is an illustration of flag change thereof,

FIG. 182 is an illustration of instruction UNPKss,

FIG. 183 is an illustration of termination condition,

FIG. 184 is a view of the format of instruction SMOV,

FIG. 185 is an illustration of flag change thereof,

FIG. 186 is an illustration of instruction SCMP,

FIG. 187 is an illustration of flag change thereof,

FIG. 188 is an illustration of flag change thereof.

FIG. 189 is a view of the format of instruction SSCH,

FIG. 190 is an illustration of the flag change thereof,

FIG. 191 is a view of the format of the instruction SSTR,

FIG. 192 is an illustration of the flag change thereof,

FIG. 193 is a view of the format of instruction QINS,

FIG. 194 is an illustration of the flag change thereof,

FIG. 195 is an illustration of the instruction QINS,

FIG. 196 is an illustration of the instruction QINS,

FIG. 197 is an illustration of the instruction QINS,

FIG. 198 is a view of the format of instruction QDEL,

FIG. 199 is an illustration of the flag change thereof,

FIG. 200 is an illustration of the instruction QDEL,

FIG. 201 is an illustration of the instruction QDEL,

FIG. 202 is an illustration of the instruction QDEL,

FIG. 203(a) and 203(b) are a view of the format of instruction QSCH,

FIG. 204 is an illustration of the flag change thereof,

FIG. 205(a) and 205(b) are an illustration of the instruction QSCH,

FIG. 206 is an illustration of the instruction QSCH,

FIG. 207 is an illustration of the instruction QSCH,

FIG. 208 is a view of the format of instruction BRA,

FIG. 209 is an illustration of the flag change thereof,

FIG. 210 is a view of the format of instruction Bcc,

FIG. 211 is an illustration of the flag change thereof,

FIG. 212 is an illustration of the detail and mnemonic of the portions,

FIG. 213 is a view of the format of instruction BSR,

FIG. 214 is an illustration of the flag change thereof,

FIG. 215 is a view of the format of instruction JMP,

FIG. 216 is an illustration of the flag change thereof,

FIG. 217 is a view of the format of instruction JSR,

FIG. 218 is an illustration of the flag change thereof,

FIG. 219 is a view of the format of instruction ACB,

FIG. 220 is an illustration of the flag change thereof,

FIG. 221 is a view of the format of instruction SCB,

FIG. 222 is an illustration of the flag change thereof,

FIG. 223 is a view of the format of instruction ENTER,

FIG. 224 is an illustration of the flag change thereof,

FIG. 225 is an illustration of the instruction ENTER,

FIG. 226 shows the format of instruction EXITD,

FIG. 227 is an illustration of the flag change thereof,

FIG. 228 is an illustration of the instruction EXITD,

FIG. 229 is a view of the format of instruction RTS,

FIG. 230 is an illustration of the flag change thereof,

FIG. 231 is a view of the format of instruction NOP,

FIG. 232 is an illustration of the flag change thereof,

FIG. 233 is a view of the format of instruction PIB,

FIG. 234 is an illustration of the flag change thereof,

FIG. 235 is a view of the format of instruction BSETI,

FIG. 236 is an illustration of the flag change thereof,

FIG. 237 is a view of the format of instruction BCLRI,

FIG. 238 is an illustration of the flag change thereof,

FIG. 239 is a view of the format of instruction CSI,

FIG. 240 is an illustration of the flag change thereof,

FIG. 241 is a view of the format of instruction LDC,

FIG. 242 is an illustration of the flag change thereof,

FIG. 243 is a view of the format of instruction STC,

FIG. 244 is an illustration of the flag change thereof,

FIG. 245 is a view of the format of instruction LDPSB,

FIG. 246 is an illustration of the flag change thereof,

FIG. 247 is a view of the format of instruction LDPSM,

FIG. 248 is an illustration of the flag change thereof,

FIG. 249 is a view of the format of instruction STPSB,

FIG. 250 is an illustration of the flag change thereof,

FIG. 251 is a view of the format of instruction STPSM,

FIG. 252 is an illustration of the flag change thereof,

FIG. 253 is a view of the format of instruction LDP,

FIG. 254 is an illustration of the flag change thereof,

FIG. 255 is a view of the format of instruction STP,

FIG. 256 is an illustration of the flag change thereof,

FIG. 257 is a view of the format of instruction JRNG,

FIG. 258 is an illustration of the flag change thereof,

FIG. 259 is an illustration of the instruction

FIG. 260 is an illustration of the instruction JRNG,

FIG. 261 is an illustration of the instruction JRNG,

FIG. 262 is an illustration of the instruction JRNG,

FIG. 263 is an illustration of the instruction JRNG,

FIG. 264 is an illustration of the instruction JRNG,

FIG. 265 is a view of the format of instruction RRNG,

FIG. 266 is an illustration of the flag change thereof,

FIG. 267 is an illustration of the instruction RRNG,

FIG. 268 is an illustration of the instruction RRNG,

FIG. 269 is an illustration of the instruction RRNG,

FIG. 270 is a view of the format of instruction TRAPA,

FIG. 271 is an illustration of the flag change thereof,

FIG. 272 is a view of the format of instruction TRAP,

FIG. 273 is an illustration of the flag change thereof,

FIG. 274 is a view of the format of instruction REIT,

FIG. 275 is an illustration of the flag change thereof,

FIG. 276 is an illustration of the instruction REIT,

FIG. 277 is a view of the format of instruction WAIT,

FIG. 278 is an illustration of the flag change thereof,

FIG. 279 is a view of the format of instruction LDCTX,

FIG. 280 is an illustration of the flag change thereof,

FIG. 281 is a view of the format of instruction STCTX,

FIG. 282 is an illustration of the flag change thereof,

FIG. 283 is a view of the format of instruction ACS,

FIG. 284 is an illustration of the flag change thereof,

FIG. 285 is a view of the format of instruction MOVPA,

FIG. 286 is an illustration of the flag change thereof,

FIG. 287 is a view of the format of instruction MOVPA,

FIG. 288 is a view of the format of instruction MOVPA,

FIG. 289 is an illustration of instruction LDATE,

FIG. 290 is an illustration of the flag change thereof,

FIG. 291 is an illustration of the flag change thereof,

FIG. 292 is a view of the format of instruction STATE,

FIG. 293 is an illustration of the flag change thereof,

FIG. 294 is an illustration of the flag change thereof,

FIG. 295 is a view of the format of instruction PTLB,

FIG. 296 is an illustration of the flag change thereof,

FIG. 297 is a view of the format of instruction PSTLB,

FIG. 298 is an illustration of the flag change thereof,

FIG. 299 is an illustration of an AT field,

FIG. 300 is an illustration of an AT field,

FIG. 301 shows the memory map relative to the logical address extension of the invention.

FIG. 302 shows the memory map relative to the logical address extension of the invention,

FIG. 303 is an illustration of the flag change in the data transfer instruction,

FIG. 304 is an illustration of the flag change in the comparison test instruction,

FIG. 305 is an illustration of the flag change of the arithmetic operation instruction,

FIG. 306 is an illustration of the flag change in the logical operation instruction,

FIG. 307 is an illustration of the flag change in the shift instruction,

FIG. 308 is an illustration of the flag change in the bit control instruction,

FIG. 309 is an illustration of the flag change in the fixed table bit field instruction,

FIG. 310 is an illustration of the flag change in the fixed table bit field construction,

FIG. 311 is an illustration of the flag change in the free table bit field,

FIG. 312 is an illustration of the flag change in the decimal number operation instruction,

FIG. 313 is an illustration of the flag change in the string instruction,

FIG. 314 is an illustration of the flag change in the queue control instruction,

FIG. 315 is an illustration of the flag change in the jump instruction,

FIG. 316 is an illustration of the flag change in the multiprocessor instruction,

FIG. 317 is an illustration of the flag change in the control space and physical space control instruction,

FIG. 318 is an illustration of the flag change in the OS relevant instruction,

FIG. 319 is an illustration of the flag change in the MMU relevant introduction,

FIG. 320 is an illustration of subroutine call,

FIG. 321 is an illustration of stack frame,

FIG. 322 is an illustration of instruction sequence,

FIG. 323 is an illustration of instruction sequence,

FIG. 324 is an illustration showing a program example,

FIG. 325 is an illustration of subroutine call,

FIG. 326 is an illustration of control space,

FIG. 327 is a view of the format of PSW,

FIG. 328 is a view of the format of IMASK,

FIG. 329 is a view of the format of SMRNG,

FIG. 330 is a view of the format of CTXBB,

FIG. 331 is a view of the format of DI,

FIG. 332 is a view of the format of CSW,

FIG. 333 is a view of the format of DCE,

FIG. 334 is a view of the format of CTXBFM,

FIG. 335 is a view of the format of EITVB,

FIG. 336 is a view of the format of JRNGVB,

FIG. 337 is a view of the format of SP0 to SP3,

FIG. 338 is a view of the format of SP1,

FIG. 339 is a view of the format of 10ADDR and 10MASK,

FIG. 340 is a view of the format of UATB,

FIG. 341 is a view of the format of SATB,

FIG. 342 is a view of the format of LSID,

FIG. 343 is a view of the format of CTXB,

FIG. 344 is a view of the format of CTXBFM,

FIG. 345 is a view of the format of EITVTE,

FIG. 346 is an illustration of stack frame,

FIG. 347 is a view of the stack format of EIT,

FIG. 348 is a view of the stack format of EIT,

FIG. 349 is a view of the format of 10 INF,

FIG. 350(a), 350(b), 350(c), and 350(d) are a vector table of EIT,

FIG. 351 is an illustration of JRNG,

FIG. 352 is an illustration of EIT,

FIG. 353 is an illustration of EIT,

FIG. 354 is an illustration of IMASK,

FIG. 355 is an illustration of system call,

FIG. 356 is an illustration of system call,

FIG. 357 is an illustration of DCE,

FIG. 358 shows comparison of DCE, DI and EI with each other,

FIG. 359 is an illustration of an example of the use of DCE,

FIG. 360(a), 360(b), 360(c), 360(d), 360(e), 360(f), 360(g), 360(h), 360(i), 360(j), 360(k), 360(l), 360(m), 360(n), and 360 (o) are a view of bit allocation,

FIG. 361(a), 361(b), 361(c), 361(d), and 361(e) show an index of operand field names,

FIG. 362 shows the cccc allocation,

FIG. 363 shows eeee allocation,

FIG. 364 is an illustration of M-flag,

FIG. 365 is a view of operation code of the BVMAP instruction,

FIG. 366(a), 366(b), 366(c), 366(d), and 366(e) are a view correspondent to the addressing mode.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The characteristic of the data processor of the invention will be summarized as below.

The data processor having the first and second characteristics of the present invention, as shown in FIG. 3, has a first address space for byte-addressing a memory storing therein programs and data and a second address space which maps an internal register at the processor of the present invention and can specify the address in units of bytes. The register and memory can similarly specify addresses and control them in a unified manner. Also, it facilitates adding to the register and corresponds to expansion of the co-processor to be housed in the main processor, thereby solving problem 1.

Next, the data processor of the present invention having the third and fourth characteristics, as shown in FIG. 4, has the first address space which byte-addresses a memory storing therein programs and data and a third address space, separate from the first address space, for mapping a context saving area by byte address, and has an instruction to selectively specify the third address space to save and restore the context. Hence, for example, a memory containing therein chips is mapped in the third space and the third space is specified as the context saving area to save or restore the context, thereby enabling high speed context switching, in which there is no need at all for limiting the first space. The reason for enabling the space at the context saving area to be byte-addressed is that mismatching in addressing caused by a difference between the spaces is avoided and that correspondence to expansion of the width of each register forming the context is considered. Thus, the second problem can be solved by the data processor of the present invention.

The data processor of the present invention having the fifth characteristic, as shown in FIG. 5, has an instruction for dividing the context of the processor into plural parts so as to selectively save and restore each part. The selected context structure is called the context format, which is adapted to be specified through disposition of the bits in registers. In the example shown, the context is divided into three: a control register context, a general purpose register context, and a co-processor context. In this example, bits relating to the control register context and general purpose register context are turned-on at a register for specifying context format and the bit relating to the co-processor is off at that register.

Thus, the data processor of the present invention can solve the third problem, thereby providing context switching at high speed and restriction of the saving area.

Furthermore, accessing a particular field at the control register, must be carried out while preserving values of other fields, whereby when access is frequent, the load may increase. Therefore, the data processor of the present invention maps the particular field of the control register onto a separate register to thereby make access to the particular field effective and safe.

PSW is shown in FIG. 6 as an example of a control register and an explanation will be given of the operation of changing its particular field. An IMASK field, often separately accessed is picked up from the PSW registers to form a separate IMASK register. When the IMASK field at PSW is intended to change, PSW can be changed only by writing into the IMASK register, by the MOV instruction, the content of memory having an objective bit array at the objective bit field or the content of a register as shown in the drawing. In this way, when the IMASK register is accessed, fields other than the IMASK field at PSW are protected.

The data processor of the present invention will be fully explained in detail hereunder.

As the following description is voluminous, a table of contents is attached thereto and the matters requiring detailed description are entered in the appendix, the subject of the invention being detailed in the appendix 7.

CONTENTS

1. Features of The Data Processor of the Present Invention

1-1 Basic Design Concept

1-2 OS Oriented Architecture

1-3 Instruction Set Being Tuned

1-4 Instruction Set for Compiler

2. The Data Processor 32 of the Present Invention and Data Processor 64 of the Present Invention

3. Classification of The Data Processor Specifications of the Present Invention.

4. Register Set

5. Data Type

5-1 Bit

5-2 Bit Field

5-3 Integer

5-4 Floating Point

5-5 Decimal

5-6 String

5-7 Queue

6. Instruction Format

6-1 Two-Operand Short Format

6-1-1 Register and Memory (S-Format and L-Format)

6-1-2 Between Registers (R-Format)

6-1-3 Between Literal and Memory (Q-Format)

6-1-4 Between Immediate and Memory (I-Format)

6-2 One-Operand General Type (G1-Format)

6-3 Two-Operand General Type

6-3-1 First Operand for Memory Read (G-Format)

6-3-2 First Operand for 8-Bit Immediate (E-Format)

6-3-3 First Operand for Address Calculation (GA-Format)

6-3-4 Other Two-Operand Instructions

6-4 Short Branch

6-5 Others

7. Addressing Mode

7-1 P Bit

7-2 Symbols Used in Format

7-3 Register Direct

7-4 Register Indirect

7-5 Register Relative Indirect

7-6 Immediate

7-7 Absolute

7-8 PC Relative Indirect

7-9 Stack Pop

7-10 Stack Push

7-11 Register Relation Additional Mode

7-12 PC Relative Additional Mode

7-13 Absolute Additional Mode

7-14 FP Relative Indirect

7-15 SP Relative Indirect

7-16 Format of Additional Mode

7-17 Levels of Additional Mode Specification

8. Description Relating to Implementation

8-1 Supporting Virtual Storage

8-2 Rewrite of Instruction

9. EIT Processing

10. Structure of PSW

10-1 Structure of PSS

10-2 Structure of PSH

10-3 Flag Change

11. Instruction Set Description Format

11-1 Outline of Descriptive Format

11-2 Instruction Bit Pattern and Assembler Syntax

11-3 Field Name

11-4 Operand Field Name

11-5 Restrictions for Addressing Mode

11-6 Notes for Description

12. Instruction Set of The Data Processor of the Present Invention

12-1 Data Transfer Instructions

12-2 Comparison and Test Instructions

12-3 Arithmetic Instructions

12-4 Logical Instructions

12-5 Shift Instructions

12-6 Bit Manipulation Instructions

12-7 Fixed-Length Bit Field Operation Instructions

12-8 Variable-Length Bit Field Operation Instructions

12-9 BCD Arithmetic Instructions

12-10 String Manipulation Instructions

12-11 Queue Manipulation Instructions

12-12 Control Transfer Instructions

12-13 Multiprocessor Support Instructions

12-14 Control Space, Address Space Operation Instructions

12-15 OS-Support Instructions

12-16 MMU Support Instructions

Appendix 1: Instruction Set Reference of The Data Processor of the Present Invention

Appendix 2: Assembler Syntax of The Data Processor of the Present Invention

Appendix 3: Memory Management System of The Data Processor of the Present Invention

Appendix 4: Flag Change of The Data Processor of the Present Invention

Appendix 5: Operation between Different Size Data Sets

Appendix 6: Subroutine Calls for High Level Languages

Appendix 7: Control Registers and Control Space

Appendix 8: CTXB of The Data Processor of the Present Invention

Appendix 9: EIT Processing of The Data Processor of the Present Invention

Appendix 10: Instruction Bit Pattern of The Data Processor of the Invention

Appendix 11: Detail Specification of High Level Instructions and Register Values in End State

1. Features of The Data Processor of the Present Invention (The Data Processor of the Present Invention)

1-1 Basic Design Concept

The data processor of the present invention is not RISC. The first target of The data processor of the present invention is to execute basic instructions at a high speed. In addition, high level instructions are added.

The data processor 32 of the present invention, which is a 32-bit microprocessor, and the data processor 64 of the present invention, which is a 64-bit microprocessor, have been developed at the same time as a series. From the beginning, the expandability to 64-bit addressing has been considered.

The data processor of the present invention series has been developed along with the OS, so that I-TRON (industrial-TRON), which is a real time OS, and B-TRON (business-TRON), which is a work-station type OS, can be executed at a high speed. The data processor of the present invention meets the data processor of the present invention <<L1R>> specification. In particular, it is focused on the high-speed processing in a real storage environment, i.e., virtual memory is not supported.

The data processor of the present invention is a microprocessor which will become the core of an ASIC LSI.

1-2 OS Oriented Architecture

Bit Map Operation Supporting Instructions:

Instructions which serve to move and operate the bit map necessary for B-TRON

Context Switch Instructions:

Instructions which serve to switch tasks for I-TRON at a high speed

Queue Operation Instructions:

Instructions which serve to operate the ready queue and wait queue for I-TRON

Memory Management Using 2-Level Ring Protection:

Extra 2-level ring is provided for future expansion.

1-3 Instruction Set Being Tuned

The instruction set is tuned so that frequently used instructions and addressing modes can be described in a short format:

Shortening the length of the instructions for operation between registers and of those for the literal operation.

1-4 Instruction Set for Compiler

Instruction set being orthogonalized

16 general-purpose registers used for various purposes such as storing data, addresses and index values.

Sophisticated addressing mode:

Additional mode allows index addition and indirect reference in any level.

Arithmetic operations between different size data sets: Different sizes can be specified for the source operand and destination operand.

Sophisticated jump instructions suitable for high level languages

2. The Data Processor 32 of the Present Invention and The Data Processor 64 of the Present Invention

The data processor of the present invention has a 32-bit version, the data processor32 of the present invention, and a 64-bit version, the data processor64 of the present invention. From the beginning, expandability to the 64-bit version has been considered. The data processor of the present invention64 can handle 64-bit integers in addition to the data types handled by the data processor 32 of the present invention.

The 32-bit mode/64-bit mode of the data processor64 of the present invention is switched in the following manner:

Data Size of Operand

The 32-bit mode/64-bit mode is selected using the size specification bit which exists in each instruction and operand. It is also possible to use an 8-bit mode or a 16-bit mode. The data size is selected from the four types from a two bit field.

The data processor 32 of the present invention does not handle 64-bit data. Consequently, if the 64-bit data size is specified, the instruction in use is treated as an error.

Size of Pointer

Normally, the data processor 32 of the present invention uses a 32-bit pointer, while the data processor 64 of the present invention uses a 64-bit pointer. However, since the data processor 64 of the present invention executes an object code for the data processor 32 of the present invention, it provides a mode which changes the pointer size to 32 bits. Since this mode is specified in PSW, it is possible to use a 32-bit type program and 64-bit type program in a context (process or task).

As an extension bit for 64-bit addressing, a reserved bit named "P bit" is provided every operand which accesses the memory.

Due to the following reasons, the 32-bit size/64-bit size of the pointer is switched by the mode rather than every instruction.

It is difficult to use pointers which differ in size, because they serve to identify the location. If there is a 64-bit size pointer together with a 32-bit size pointer, the location cannot be identified unless the size of all the pointers in 64
bits. Therefore, even if a 32-bit pointer and 64-bit pointer are switched in each instruction, the same specification is repeated in each context. Therefore, its efficiency is low. In such a situation, it is suitable to switch the bit size of the pointer by using the mode, rather than in each instruction.

When the bit size of the pointer is switched between 32 bits and 64 bits using the mode bit, a question about the compatibility between the data processor 32 of the present invention and the data processor 64 of the present invention may arise. However, in the structure where the bit size of the pointer defaults to 32 bits and the mode is changed whenever the 64-bit address is used, a program for the data processor 32 of the present invention can be directly executed in the data processor 64 of the present invention. Even if the bit size of the pointer is switched in each instruction rather than by the mode, OS will know whether the bit size of each context is 32 bits or 64 bits to set the stack and to determine whether the bit size of the system call parameters is 32 bits or 64 bits. A bit size of 32 bits or 64 bits is determined by observing the mode in PSW (which is stored in the stack).

3. Classification of The Data Processor Specifications of the Present Invention

The data processor of the present invention provides optional implementations to meet various needs such as expandability to the 64bit version, serialization, adaptability to many applications, and so forth. To clarify the optional functions of the data processor of the present invention, the specifications of the data processor of the present invention are classified as follows.

<<L0>> Specification (Level 0)

The minimum specification which will satisfy as the data processor of the present invention requirements: For example, the programming model viewed from the user program (most of ISP, general purpose registers and PSH), bit pattern in machine language, and so forth. Unless otherwise specified, the specification is <<L0>>.

<<L1>> Specification (Level 1)

This specification should usually be implemented, however, when a processor does not have special requirements the <<L1>> specification may not always need to be implemented. <<L1>> specification includes high level functional instructions such as string instructions, additional modes, queue operation instructions, and bit map instructions. The details of <<L1>> instructions will be described separately.

<<L1R>> Specification (Level 1 Real)

The <<L1R>> specification excludes the instruction rerun function and MMU related functions from the <<L1>> specification. This <<L1R>> specification is used to effectively operate I-TRON and micro-BTRON with real memory. The instruction set for <<L1R>> is nearly the same as that for <<L1>>, so the compiler and user program can be used in common with <<L1>>. However, part of the instructions relating to MMU (MOVPA and so forth) and OS (JRNG and so forth) may not be supported.

<<L2>> Specification (Level 2)

This specification will be introduced in accordance with an increase of hardware amount in future:

<<L2>> includes the specification which serves to enhance the symmetry of instructions and are newly added instructions to <<L0>>, <<L1>> or <<L1R>> for high speed operation.

The former includes the "/B" option of the BVSCH instruction, complicated termination conditions of the string instruction, additional mode in indefinite stages, while the latter includes the INDEX instruction.

The <<L2>> specification is represented as "<<L2>>".

<<LX>> Specification (Extension)

This specification will be introduced for the expansion to the data processor of the present invention 64. Although it has the same content as <<L2>>, it is treated as a different class because of the expandability to the data processor64 of the present invention.

The <<LX>> specification is represented as "<<LX>>".

<<LU>> Specification (Undefined)

The specification which will be introduced for the future extension:

At present, the specification details have not been determined.

<<LV>> Specification (Variable)

The specification which can be freely determined by each manufacturer:

The <<LV>> specification includes the pin assignment of the chip, specification relating to the level and performance of the pipeline, bit pattern assigned to each manufacturer, usage of control registers and so forth. The bit patterns of the instructions assigned to each manufacturer are represented with LV reserved in the bit pattern reference.

<<LA>> Specification (Alternative)

Although the <<LA>> specification describes the standard specification for the data processor of the present invention (or will describe it), if necessary, it may be changed. However, if the specification is changed, the compatibility may be lost. In other words, the <<LA>> specification does not assure the compatibility of the data processor of the present invention.

The <<LA>> specification mainly includes the as memory management system, control registers, and part of the privileged instructions. The data processor of the present invention aims at high speed processing in a real storage environment without an MMU. Thus, the data processor of the present invention does not support most of the <<LA>> specification relating to the memory management.

4. Register Set 12: see FIG. 7.

The data processor 32 of the present invention provides 16 32-bit general purpose registers, while the data processor 64 of the present invention provides 16 64-bit general purpose registers.

The stack pointer (SP) and frame pointer (FP) are included in the general purpose registers. SP and FR are R15 and R14, respectively.

The program counter (PC) is not included in the general purpose registers.

The general purpose registers serve to store data and base addresses as well as serving as an index register which can be used for many purposes.

A processor status word (PSW) register is provided to store the status of the processor.

SP is switched according to the context (ring number or interrupt processing).

PSW consists of four bytes; the low-order first byte (processor status byte, or PSB) is used to indicate the status, the low-order second byte (processor status half word, or PSH, which is used along with PSB) is used to set the user mode, and the two high-order bytes are used to indicate the system status.

The data processor of the present invention is called a "big-endian" chip. It assigns 8-bit and 16-bit data in the register starting with the LSB side. Thus, an absolute bit number, irrespective of the data size, cannot be defined. A bit number can only defined along with the data size.

8-bit data in the register is assigned 0, 1, . . . , 7 starting with the MSB side. In addition, 16-bit data in the register is assigned 0, 1, . . . , 15 starting with the MSB side. 32-bit data in the register is assigned 0, 1, . . ., 31
starting with the MSB side. Consequently, bit position 7 of 8-bit data, bit position 15 of 16-bit data, and bit position 31 of 32-bit data all correspond to the same bit.

In instructions where the register is used as the destination operand, when the data size of the register is 8 bits or 16 bits, the high-order bytes are not influenced. They are not changed to comply with the specification of the operation in the memory. To influence the high-order bits, use a different data size operation.

Example

______________________________________ MOV #H'12345678, R0.W MOV #H'aa, R0.B ______________________________________

When the above instructions are performed, R0 becomes H'123456aa.

When 8-bit data and 16-bit data are placed in a register, they are assigned from the LSB side. For example:

______________________________________ MOV.W #H'12345678,R0 MOV.B #H'aa,R0 MOV.W #R0,R1 ______________________________________

The result of the above instructions is R1=H'123456aa.

When the same operation is performed for the memory with the following instructions,

______________________________________ MOV.W #H'12345678, @R0 MOV.B #H'aa, @R0 MOV.W @R0, R1 ______________________________________

the 8-bit data and 16-bit data are assigned from the MSB side, resulting in R1=H'aa345678. Note that the result in the register differs from that in the memory.

5. Data Type

The data processor of the present invention uses "big-endian". In other words, when the byte address or bit number is assigned, the smaller number (address) is MSB (most significant bit/byte).

In the big-endian structure, the address of some data in the memory differs depending on whether it is treated as 8-bit data or 16(32)-bit data. For example, when

______________________________________ address: N N+1 N+2 N+3 data: 0 0 0 H'12 ______________________________________

although the content of the address N as 32-bit data is H'00000012, (where H' represents hexadecimal notation), when the data of the same content is treated as 8-bit data, it is necessary to refer to the address N+3.

However, since 8-bit data and 16-bit data in the register are assigned from the LSB side, they can be treated as different size data. For example,

______________________________________ MOV #0, R0.W MOV #H'12, R0.B MOV R0.W, R1.W ______________________________________

The result becomes R1=H'00000012. (For the meaning of the instructions, see the related chapter.)

On the other hand, when the same operation is performed for the memory.

______________________________________ MOV #0, @R0.W MOV #H'12, @R0.B MOV @R0.W, R1.W ______________________________________

cause the 8-bit data H'12 and MSB of the 32-bit data to be matched, resulting in R1=H'12000000.

The data types that the data processor of the present invention supports are as follows.

5-1 Bit

The relates bit 14 is indicated in FIG. 8. In the case of the bit operation in the memory, offset can be freely used.

In the case of the bit operation in the register, offset can be limited in one register (the upper bits of the offset is ignored).

The bit is assigned using a set of base.sub.-- address, size of base.sub.-- address and offset.

When a bit in the memory is assigned, MSB of the memory address represented by base.sub.-- address is the bit of offset=0. At the time, the assignment of the size of base.sub.-- address does not influence the bit which is actually operated. For the bit operation instruction, to assign the access size for the read-modify-write operation for the memory, the size of base.sub.-- address is assigned. However, the access size does not depend on the bit actually operated.

On the other hand, when a bit in the register is assigned, MSB in the data size which is assigned as the size of base.sub.-- address is the bit of offset=0. The bit actually operated depends on the size of base.sub.-- address.

5-2 Bit Field

Signed bit field

The related bit field 16 is indicated in FIG. 9.

0<width.ltoreq.32 (<<LX>>0<width.ltoreq.64)

S: Signed bit

The distance between MSB of base.sub.-- address and that of the related bit field (signed bit) is offset. In the case of the bit field operation in the memory using the BF:G instruction, offset can be freely used. In the case of the bit field operation in the memory using the BF:E instruction or the bit field operation in a register, the operation in the bit field which exceeds the one word (1-long word) of base.sub.-- address is not assured.

Unsigned bit field

The related bit field 18 is indicated in FIG. 10.

0<width.ltoreq.32 (<<LX>>0<width.ltoreq.64)

The distance between MSB of base.sub.-- address and that of the related bit field is offset.

In the case of the bit field operation in the memory using the BF:G instruction, offset can be freely used. In the case of the bit field operation in the memory using the BF:E instruction or the bit field operation in a register, the operation in the bit field which exceeds the one word (1-long word) of base.sub.-- address is not assured.

Unfixed length bit field

Both offset and width can be freely assigned in the condition of width>0.

5-3 Integer

The data type of integer 20 is indicated in FIG. 11.

5-4 Floating Point

The floating point operation is processed by a co-processor. The format of the floating point is specified by IEEE standard. The details of the floating point will be separately specified.

Single precision 32-bit floating point <<Co-processor>>

Double precision 64-bit floating point <<Co-processor>>

80-bit floating point <<Co-processor>>

5-5 Decimal

The addition, subtraction, multiplication and division in multiple length decimal notation are processed by a co-processor. The main processor of the data processor of the present invention only processes unsigned fixed-length PACKED format decimal numbers and signed PACKED format decimal numbers. However, all the instructions which process the signed PACKED format decimal numbers are <<L2>>. The data type 22 is shown in FIG. 12.

5-6 String

In the string case, the data type 24 is showin in FIG. 13.

5-7 Queue

The data type of linear list 26 connected by double links is shown in FIG. 14.

6. Instruction Format

Any instruction is written in variable length every 16 bits. However, instructions whose length is odd bytes are not permissible.

Instructions with two operands are classified into two types: one is the general type, which has 4 bytes+extension portion and can use all the addressing modes (Ea), and another is the abbreviation type, which can use only frequently used instructions and the addressing mode (Sh). Depending on the instruction function and code size being required, the suitable type can be selected.

Although the instruction format of the data processor of the present invention can be classified into many types, we will roughly classify and describe the the types of the instruction format so that the user can easily understand it. For detail types of the instruction format, see Appendix 10.

These are the abbreviations used for the codes described with the format.

- Portion where an operation code is placed

# Portion where a literal or immediate value is placed.

Ea General type addressing mode specified with 8 bits (General Format)

Sh Abbreviation type addressing mode specified with 6 bits (Short Format)

Rn Portion where the register is specified

The format is described assuming that the right side is LSB and the high-order address (big-endian).

Example of Format Description 28 is shown in FIG. 15. The instruction format can be determined by the two bytes of the address N and address N+1, because any instruction is fetched and decoded every 16 bits (2 bytes).

In any format, the extension portion of Ea or Sh of each operand should be located just after the half word containing the basic portion of Ea or Sh. It has higher precedence than the immediate data which is implicitly specified by an instruction and than the extension portion of an instruction. Therefore, the operation code of an instruction consisting of 4 bytes or more may be separated by the extension portion of Ea.

If extra extension portion is added to the extension portion of Ea in the additional mode, the extra extension portion has higher precedence than the operation code of the next instruction.

For example, consider a 6-byte instruction which consists of the first half word containing Ea1, the second half word containing Ea2, and the third half word. Since the additional mode is used for Ea1, the extension portion for the addition mode is also added as well as the conventional extension portion. At the time, the real instruction bit pattern is assigned in the following order.

First half word of the instruction (including the basic portion of Ea1)

Extension portion of Ea1

Extension portion of Ea1 in the additional mode

Second half word of the instruction (including the basic portion of Ea2)

Extension portion of Ea2

Third half word of the instruction

When only 8 bits of the 16-bit field are used depending on the alignment, they are placed in the low order (to the higher address). It is applied when the #imm.sub.-- data mode is specified to EaR and ShR while the operand size is 8 bits, when the operand size is 8 bits in the I- format, or when BRA:G, Bcc:G, BSR:G and SS=00.

For example, in the following case,

The first byte is an operation code of MOV:I.B.

The second byte is used to specify both part of the operation code and ShW(@RO).

The third byte is 0.

The fourth byte is H'12.

The bit pattern 29 is represented in FIG. 16.

In this case, the upper (lower address) 8 bits of the 16-bit field should be filled with 0. When the upper 8 bits are not 0, the data is unstable depending on the implementation. In other words, in the case of I-Format or #imm.sub.-- data mode, the operand depends on the implementation, while in the case of the instructions of BRA:G,Bcc:G and BSR:G, the destination to be jumped becomes unstable. In any case, they are not treated as EIT (exception).

6-1 Two Operand Short Format

6-1-1 Register and Memory (S-format,L-format) 30: an example is shown in FIG. 17.

There are two types of instructions in the L-format and S-format: one type is where the size can be specified (MOV:L, MOV:S, CMP:L) and another type is where the size cannot be specified (ADD:L, SUB:L).

For instructions where the size can be specified, the specification of the size by RR and the like is only applied to the memory and the size of the memory is fixed to 32 bits. If the size of the register differs from that of the memory while the size of the source is smaller than another, sign extension is performed. If the size of the source is smaller than another, the high-order byte is truncated and overflow check is performed.

On the other hand, for the instructions of ADD:L and SUB:L where the size cannot be specified, both the operand sizes of the register and memory are fixed to 32 bits.

Since there is a rule for the data processor of the present invention where data in the register is usually treated as a 32-bit signed integer, the size of the register is fixed to 32 bits. This rule is also applied to the bit field instructions and instructions with advanced functions where an operand is placed in the register as well as the instructions in the L-format and S-format.

6-1-2 Between Registers (R-Format) 31: an example is shown in FIG. 18.

6-1-3 Between Literal and Memory (Q-Format) 32: an example is shown in FIG. 19.

6-1-4 Between Immediate and Memory (I-Format) 33: an example is shown in FIG. 20.

The size of the immediate value in the I-format is 8, 16, 32 and 64 bits which are in common with the size of the destination operand. The zero extension and sign extension are not performed.

6-2 One Operand General Type (G1-Format) 34: an example is shown in FIG. 21.

6-3 Two Operand General Type

Instructions which have two operands in the general type addressing mode and which are specified with 8 bits. Occasionally, the total number of operands becomes 3.

6-3-1 First Operand for Memory Read (G-Format) 35: an example is shown in FIG. 22.

6-3-2 First Operand for 8-Bit Immediate (E-Format) 36: an example is shown in FIG. 23.

Although the function of this format is similar to that between the immediate and memory (I-format), their concepts remarkably differ. Since the E-format is a derivation of the 2-operand general type (G-format), the size of the source operand is fixed to 8 bits and the size of the destination operand is selected from 8/16/32/64 bits. In other words, supposing the different size operation, for scr consisting of 8 bits, the zero extension or sign extension is performed in accordance with the size of dest.

On the other hand, in the I-format, the immediate pattern which is frequently used in MOV and CMP is changed to the short type and the size of the source is the same as that of the destination.

6-3-3 First Operand for Address Calculation (GA-Format) 37: an example is shown in FIG. 24.

6-3-4 Other Two-Operand Instructions 38: an example is shown in FIG. 25.

6-4 Short Branch 39: an example is shown in FIG. 26.

6-5 Others 40: except above described, there are examples shown in FIG. 27.

7. Addressing Mode

The data processor of the present invention provides two addressing modes: the short format (Sh), which assigns the address for the memory and registers with a 6 bits field and the general format (Ea), which specifies with an 8 bits field.

If an addressing mode which has not been defined or an improper combination of addressing modes is specified, a reserved instruction exception (RIE) occurs like an execution of the undefined instruction and it causes the exception processing to start. It may occur when the destination is in the immediate mode or when the immediate mode is used for an instruction which calculates the address.

7-1 P Bit

The data processor of the present invention can assign a one-bit optional function assignment bit for accessing the memory. This bit is named the P bit. The P bit is used to add some additional capability whenever the memory is accessed.

The P bit is independently assigned whenever the memory is accessed. Therefore, in case of the register indirect addressing mode, absolute addressing mode, and the like, one P bit is assigned in accordance with the operand. In case of the multiple level indirect addressing mode where the additional mode is used, the P bit should be used for the number of times corresponding to the number of levels. The P bit is expected for tag checking, logical space switching, and switching between
32-bit addressing and 64-bit addressing for future expansion. Therefore, in the current specification, the P bit is reserved. In the description of the P bit, the position of the P bit is represented with `P`. However, it should always be "0". If the P bit is not "0", a reserved instruction exception (RIE) will occur.

The function of the P bit should conform to the <<LU>> specification.

7-2 Symbols Used in Format

Rn: Assign the register.

P: P bit (always "0")

mem[EA]: Content of the memory at the address represented with EA

The portion surrounded by dotted lines represents the extension portion.

7-3 Register Direct

Assembler syntax 41: Rn

Operand: Rn

Format: shown in FIG. 28.

7-4 Register Indirect

Assembler syntax 42: @Rn

Operand: mem[Rn]

Format: shown in FIG. 29.

7-5 Register Relative Indirect

______________________________________ Assembler syntax 43: @(disp,Rn) @(disp:16,Rn) @(disp:32,Rn) ______________________________________

Operand: mem[disp+Rn]

Format: shown in FIG. 30.

disp should be treated as a signed operand.

7-6 Immediate

Assembler syntax 44: #imm.sub.-- data

Operand: imm.sub.-- data

Format: shown in FIG. 31. The size of imm.sub.-- data is assigned in an instruction as the operand size.

7-7 Absolute

______________________________________ Assembler syntax 45: @abs @abs:16 @abs:32 @abs:64 <<LX>> ______________________________________

Operand: mem[abs]

Format: shown in FIG. 32.

In the 32-bit addressing mode, the address specified is extended to the 32-bit signed address. On the other hand, in the 64-bit addressing mode, the address assigned by abs:16, abs:32 is extended to the 64-bit signed address.

7-8 PC Relative Indirect

______________________________________ Assembler syntax 46: @(disp,PC) @(disp:16,PC) @(disp:32,PC) ______________________________________

Operand: mem[disp+PC]

Format: shown in FIG. 33.

The PC value being referenced in the PC relative indirect mode is the beginning address of the instruction which includes the operand. Thus, an endless loop can be produced by the following instruction.

When the PC value in the additional mode is referenced, the beginning address of the instruction is used as the reference value of the PC relative indirect mode.

7-9 Stack Pop 47

Assembler syntax: @SP+

______________________________________ Operand: mem[SP] SP is incremented. ______________________________________

Format: shown in FIG. 34

In the @SP+ mode, SP is incremented in accordance with the operand size. For example, when the data processor 64 of the present invention processes 64-bit data, SP is updated by +8. It is also possible to specify @SP+ for an operand which is the size of B and H, so that SP is updated for +1 and +2, respectively. However, it causes the stack alignment to be disordered, resulting in a slower processing speed.

If the @SP+ mode is not used for the operand, a reserved instruction exception (RIE) occurs. Actually, a reserved instruction exception occurs when @SP+ is used for the write operand and read-modify-write operand.

7-10 Stack Push 48

Assembler syntax: @-SP

______________________________________ Operand: SP is decremented. mem[SP] ______________________________________

Format: shown in FIG. 35

In the @-SP mode, SP is decremented in accordance with the operand size. For example, when the data processor of the present invention64 processes 64-bit data, SP is updated by -8. It is also possible to specify @-SP for an operand which is the size of B and H, so that SP is updated for -1 and -2, respectively. However, it causes the stack alignment to be disordered, resulting in a slower processing speed.

If the @-SP mode is not used for the operand, a reserved instruction exception (RIE) occurs. Actually, a reserved instruction exception occurs when @-SP is used for the read operand and read-modify-write operand.

7-11 Register Relation Additional Mode 49

Additional mode processing

Format: shown in FIG. 36.

For details of the additional mode, see section 7-16.

7-12 PC Relative Additional Mode 50

Operand: PC==>tmp

Additional mode processing

Format: shown in FIG. 37.

7-13 Absolute Additional Mode 51

Operand: 0==>tmp

Additional mode processing

Format: shown in FIG. 38.

7-14 FP Relative Indirect 52

______________________________________ Assembler syntax: @(disp,FP) @(disp:4,FP) Operand: mem[d4 * 4 + FP] (disp = d4 * 4) ______________________________________

Format: shown in FIG. 39.

The prescaled displacement, d4, it treated as a signed operand. It should be used by multiplying by 4 irrespective of the size. Thus, the memory address of the multiples of 4 in the range from (FP-8*4) to (FP+7*4) can be referenced. When the address is described in the assembler representation, the value multiplied by 4 should be described for displacement. This addressing mode is <<L2>>. Since the data processor of the present invention does not provide the FP relative indirect mode, when this mode is specified, a reserved instruction exception (RIE> occurs.

Since this addressing mode cannot be used in the short format, for example,

becomes 4 bytes as follows.

Thus, the code is ambiguously selected, so that the mode is <<L2>>. This mode is expected to effectively use the short format when the rate of usage of the abbreviations is decreased in the data processor64 of the present invention. In the modes of @(d4:4,FP) and @(d4:4,SP) d4 is used by multiplying by 4 irrespective of the operand size. Therefore, if the modes of @(d4:4,FP) and @(d4:4,SP) are used with variables of 8 bits, 16 bits and 32 bits lengths in the stack frame at the same time, it is necessary to left justify each variable to the word boundary, since the data processor of the present invention is big-endian.

Example of allocation of local variables for using modes of @(d4:4,FP) and @(d4:4,SP) 53 is shown in FIG. 40.

7-15 SP Relative Indirect 54

______________________________________ Assembler syntax: @(disp,SP) @(disp:4,SP) Operand: mem[d4 * 4 + SP] (disp = d4 * 4) ______________________________________

Format: shown in FIG. 41.

The prescaled displacement, d4, is treated as a signed operand. It should be used by multiplying by 4 irrespective of the size. However, the operation where d4 is negative is not described. Thus, the memory address of the multiples of 4 in the range from (SP) to (SP+7*4) can be referenced. When the address is described in the assembler syntax, the value multiplied by 4 should be described for displacement. This addressing mode is <<L2>>. Since the data processor of the present invention does not provide the FP relative indirect mode, when this mode is specified, a reserved instruction exception (RIE) occurs.

Like @(disp:4,FP), this mode is expected to effectively use the short format when the rate of usage of the abbreviations is decreased in the data processor 64 of the present invention.

7-16 Format of Additional Mode

Complicated addressing can basically be separated into a combination of operations of addition and indirect reference. Therefore, when assigning the operations of addition and indirect reference as primitives of addressing, and combining them freely, any complicated addressing mode can be obtained.

The additional mode will be used for such a purpose. A complicated addressing mode is especially useful for data reference between modules and processing systems for artificial intelligent languages.

However, when the addressing mode is widely used for the data processor of the present invention, the processing speed may decrease. Thus, care should be taken to use the memory indirect addressing mode.

The additional mode is specified every 16 bits and repeated for the number of times required. With only one occurrence of the additional mode, the following operations are performed.

Addition of constant (displacement)

Scalling (x1, x2, x4 and x8) and addition of index register

Memory indirect reference

With the additional mode in n levels, the indirect reference of up to (N+1) levels can be performed. Processes of basic additional modes:

______________________________________ tmp + Rx * scale + d4 * 4 .fwdarw. tmp when I=0 and D=0 tmp + Rx * scale + displx .fwdarw. tmp when I=0 and D=1 mem[tmp + Rx * scale + d4 * 4] .fwdarw. tmp when I=1 and D=0 mem[tmp + Rx * scale + dispx] .fwdarw. tmp when I=1 and D=1 ______________________________________

Basic format 55: shown in FIG. 42.

EI=00 Absence of indirect reference; continuation of additional mode

EI=01 Indirect reference; continuation of additional mode

EI=10 Indirect reference; completion of additional mode

EI=11 Dual indirect reference; completion of additional mode

M=0 <Rx> is used as an index.

M=1 Special index

<Rx>=0: The indexes are not added. (Rx=0)

<Rx>=1: PC is used as the index Rx. (Rx=PC)

<Rx>=2 or more: reserved

D=0 4-bit d4 in the additional mode is multiplied by 4, treated as disp, and then added. d4 should always be multiplied by 4 and used irrespective of the operand size.

D=1 dispx (16/32/64 bits) specified by the extension portion in the additional mode is treated as disp and then added. The size of the extension portion is specified by the d4 field.

d4=0001: dispx is 16 bits.

d4=0010: dispx is 32 bits.

d4=0011: dispx is 64 bits. <<LX>>

XX Scale of index (scale=1/2/4/8)

S Size of index register

S=0 <Rx> is extended to signed 32 bits.

S=1 <Rx> is 64 bits <<LX>>

P P bit <<LU>>

The P bit is placed in each level of the additional mode.

The P bit can be specified independent from all the memory references.

Whether the indirect reference is performed or not can be selected.

The level which does not perform the indirect reference is used for addition of the base register and index register with multiple levels (such as mem[R1+R2+R3]). It may be used for the relocation base register, etc. by the user.

Size of index register

Since 32-bit data will be frequently used even with a 64-bit address, 32/64-bit address size can be switched in each level of the additional mode.

@(disp:64,Rn) of the register relative indirect and the addressing mode of the memory indirect can be obtained by using the additional mode.

If the scaling of x2, x4 and x8 for PC is performed, the temporary value (tmp) after the processing of the level is completed, the value, depends on the hardware implementation. The effective address obtained by the additional mode cannot be predicted. However, an exception does not occur.

Variation of format 56, 57: shown in FIG. 43, 44, respectively.

7-17 Levels of Additional Mode Specification

The additional mode is used for normal indirect reference, as a table reference for external variables for modular object codes, and execution of AI oriented instructions. In particular, the applications of AI may use the indirect reference in many levels. However, the normal applications use it in 4 or less levels.

When the additional mode in any number of levels can be used, the classification by the number of levels in the compiler is not required, thus reducing the load of the compiler. Even if the frequency of the indirect reference in many levels is very small, the compiler should always generate correct codes.

However, from the point of view of implementation, if executing interrupts are accepted in any number of levels, the load on the compiler becomes heavy. Therefore, it is necessary to restrict the number of levels.

The versions of the data processor of the present invention which can use the additional mode with up to only 4 levels (4 basic formats of the additional mode) is defined as the <<L1>> specification. Versions that can use any number of levels are defined as the <<L2>> specification. Even in the <<L1>> specification, it is possible to perform the memory indirect reference up to 5 times. For the additional mode which exceeds 5 levels (5 half words), a reserved instruction exception (RIE) occurs. However, in the format where any number of levels can be used, the number of levels will be extended.

The data processor of the present invention can use the additional mode in any number of levels. However, when the memory indirect addressing is frequently used along with the additional mode, the processing speed may decrease. Especially, if the additional mode with many levels is used in the second operand, an interrupt cannot be accepted during the processing of the additional mode.

Since the data processor32 of the present invention will use floating point, the scaling of `x8` is implemented. The scaling of `x8` is the <<L1>> specification rather than the <<LX>> specification.

8. Description Relating to Implementation

8-1 Supporting Virtual Storage

While the data processor of the present invention has provisions for virtual memory, they are not currentry implemented on the data processor of the present invention.

To provide the virtual storage, it is necessary to properly recover page faults which occur during execution of instructions. The data processor of the present invention generally uses the instruction re-execution system.

If a page fault occurs in the instruction re-execution system, the processor resets all the registers and activates the page-in process routine. Thus, even if the execution of instructions are resumed from the beginning, inconsistency does not occur.

In the instruction re-execution system, normally, it is not necessary to hold the status flags during execution. Therefore, the system is comparatively simple. When re-executing instructions, the data processor of the present invention does not use the instructions and addressing mode (such as auto-increment) which may cause side effects however, since the re-execution after the page fault may cause an unnecessary memory access. Therefore, care should be taken when OS operates the I/O device.

For example, if the first operand of a normal instruction serves to read the I/O device and the second operand causes a page fault by the re-executing the instruction, the I/O device is read again. Therefore, inconsistency may occur depending on the type of I/O device. Thus, when an I/O device causes a side effect is read and accessed, take care not to cause a page fault by another operand. Particularly, it is possible that another operand is always a register or residual page.

If the source operand and destination operand are partially overlapped, inconsistency will occur when a simple execution is performed.

Example: Moving 2-byte data for 1 byte.

The destination is located at the page boundary: shown in FIG. 45.

In FIG. 45, if the MOV.H instruction causes [N-2:N-1] to be moved to [N-1:N], the write cycle of the destination is separated with two sessions. First, the data of [N-2] 58 is written to [N-1] 59 and the former [N-1] is written to [N]. If page M-1 60 has a fault while the data is written to [N-1], after the page-in operation, [N-2:N-1]->[N-1:N] is retried. Since the content of N-1 has been rewritten, inconsistency will occur.

For an instruction such as LDM which serves to transfer data in multiple sessions, if the source and destination are overlapped, care should be taken that inconsistency does not occur during re-execution of the instruction. For example, in the following case,

when R8 is read after loading R6 and R7, if a page fault occurs, R6 has been rewritten upon re-execution. Thus, if the instruction is re-executed from the beginning, inconsistency will occur. To avoid that, it is necessary to take the following countermeasures.

Check that a page fault has not occurred at the beginning of the instruction.

Save the temporary value which represents the address which is transferred during page fault to the stack (a kind of instruction continuous execution system).

Store the initial value of R6 and restore it if a page fault occurs.

These countermeasures should be applied to STM and other instructions.

To re-execute instructions without inconsistency, LDM, STM and LDCTX prohibit the additional mode. On the other hand, ENTER, EXIT and JRNG prohibit all the addressing modes which access the memory.

8-2 Rewrite of Instruction

Generally, a computer which has the stored program system can rewrite the instruction program to be executed by itself through a program. However, when an instruction is rewritten in the current high performance processors which provide prefetch and instruction cache functions and the operation must be assured, the load on the hardware is remarkably increased. The necessity of this function is not high and it is not suitable for software training. Therefore, the data processor of the present invention normally prohibits the instruction codes to be rewritten by software. If the instruction code is rewritten, its operation will not be assured.

In some special applications, instruction codes are produced by a user program and they are executed. Therefore, when some conditions are met, it is necessary to assure the execution operation of instruction codes being rewritten.

To do that, the data processor of the present invention has PIB instruction which informs the processor that instruction codes have been rewritten. By executing this instruction, the execution operation of the instruction codes being rewritten are assured. This instruction serves to inform the processor that the instruction codes to be executed have been probably rewritten (after the processor has been reset or the former PIB instruction has been executed). This instruction will serve to purge the pipeline, instruction queue and instruction cache.

9. EIT Processing

EIT stands for the initial letters of Exception (exceptional interrupt), Interrupt (external interrupt) and Trap (internal interrupt).

In the data processor of the present invention, a process which is asynchronous with the flow of the execution of the program is termed an EIT process. The EIT processes are generally called exception and interrupt processes. The EIT process contains the following types.

Internal interrupt (call between rings, trap)

It is intentionally generated by the programmer when issuing a system call. It relates to the context which is executed at the time.

Exceptional interrupt (exception)

It occurs if some error is generated during execution of a conventional instruction. It relates to the context being executed at the time.

External interrupt (interrupt)

It occurs when a signal is generated by external hardware.

It does not relate to the context being executed at the time.

For details of the EIT processing, see Appendix 9.

10. Structure of PSW

PSW (Processor Status Word) of the data processor of the present invention consists of 32 bits. The lower 16 bits of PSW (PSH - Processor Status Halfword) is used for the user program. It can be freely operated by the user process. On the other hand, the upper 16 bits of PSW (PSS - Processor Status halfword for System) is used for the system. Therefore, it cannot be operated by the user program (ring 3). The upper 8 bits of PSH serves to set various modes and are named PSM (Processor Status byte for Mode). In addition, the lower 8 bits of the PSH serves to display the operation result 43, which is named PSB (Processor Status Byte): shown in FIG. 46.

10-1 Structure of PSS 62: shown in FIG. 47.

Reserved to `0`.

If `1` is written, a reserved functional exception (RFE) occurs.

SM,RNG=000 Uses the external interrupt stack pointer (SPI) at ring 0.

SM,RNG=001 reserved

SM,RNG=010 reserved

SM,RNG=011 reserved

SM,RNG=100 Uses the stack pointer for ring 0 (SP0) at ring 0.

SM,RNG=101 Reserved (for ring 1)

SM,RNG=110 Reserved (for ring 2)

SM,RNG=111 Uses the stack pointer for ring 3 (SP3) at ring 3. SM,RNG is <<LA>>. (SM: Stack Mode, RNG: Ring)

XA=0 32-bit context

XA=1 64-bit context <<LX>>

AT=00 Absence of address conversion

AT=01 Presence of address conversion (the data processor of the present invention standard MMU specification)

AT=10 Absence of address conversion, memory protection by address (<<L1R>>)

AT=11 reserved (AT: Address Translation mode)

DB=0 Context which is not currently debugged

DB=1 Context which is currently debugged

IMASK Interrupt priority which inhibits an external interrupt and DI (Delayed Interrupt).

IMASK=0000 Accepts only NMI (unmaskable interrupt of priority 0)

IMASK=0001 Masked up to priority 1 (consequently, accepts NMI only).

IMASK=0010 Masked up to priority 2. represented by IMASK.

IMASK=1110 Masked up to priority 14.

IMASK=1111 Not masked

The data processor of the present invention controls the memory by 4 levels of ring protection as the <<LA>> specification. (See Appendix.) The data processor of the present invention controls the memory by 2 levels of ring protection. The RNG field represents which rings exist in the current processor. Even if the ring protection is not performed, this field is used to switch between the supervisor mode and the user mode.

The XA bit of the data processor of the present invention32 is reserved. If `1` is written to the bit, an exception occurs.

Since it is difficult to standardize the debug information such as trace in detail, it is stored in a different control register (DCR - Debug Control Register). However, only the information which represents the debugging condition is stored in PSW as DB.

The lower priority external interrupts of the data processor of the present invention are represented with higher numbers. The priority of the external interrupts consist of seven levels from 0 to 7. The priority 0 is the unmaskable interrupt (NMI).

Since it is difficult to completely standardize the control information of the cache and MMU, it is separated from PSW.

Since AT (address translation specified field) is placed in PSW, it is possible to convert the address any context, change the memory protection method, and temporarily stop the address translation only during execution of the EIT process handler.

When AT (address translation bit) in PSW is changed from `00` to `01` by starting LDC, REIT, LDCTX or EIT; TLB and cache purge are automatically conducted, so that TLB and matching with the logical cache is assured. In addition, when AT is changed from `01` to `00`, the matching of the cache (logical cache and physical cache) is assured.

10-2 Structure of PSH 63: shown in FIG. 48.

Reserved to `0`

If `1` is written, a reserved functional exception (RFE) occurs.

PRNG Ring number just before entering this ring. PRNG is <<LA>>.

P P-bit Error Flag <<LU>>

Set if an error relating to the P-bit function occurs.

Otherwise, it is cleared.

Reserved to `0` at present.

F General Flag

Used to detect the cause of the termination of a high level instruction.

X Extension Flag

The carry-out of a multiple length operation.

V Overflow Flag

Indicates an overflow occurence.

L Lower Flag

Indicates the contents of the first operand is smaller than those of the other operand in a comparison instruction for both signed with signed comparison and unsigned with unsigned comparison.

M MSB Flag

Indicates the MSB of the operation result is `1`.

Z Zero Flag

Indicates the operation result is `0`.

The "ring just before entering" in the PRNG field represents a "ring which is placed at one outer location" or a "ring which requests a service to the ring". Thus, when EIT occurs, PRNG changes as follows:

When EIT occurs in the return mode with the REIT instruction, PRNG changes as follows:

In the return mode, it is necessary to return from the stack rather than copying RNG. The relationship RNG.ltoreq.PRNG is always satisfied. PRNG is referenced by the ACS command. Actual ring transition uses the information of RNG. In instruction flow from compared to the conditional jump, processors other than the data processor of the present invention usually distinguish signed data and unsigned data by using a conditional jump instruction rather than a comparison instruction.

For example, unsigned integers are compared using the following instructions:

______________________________________ CMP src1,src2 BLTS next Branch Lower Than (Signed) ______________________________________

Signed integers are compared using the following instructions:

______________________________________ CMP src1,src2 BLTU next Branch Lower Than (Unsigned) ______________________________________

Thus, in this type of flag implementation, information to distinguish the size of numbers and the presence or absence of signs is required.

In the data processor of the present invention, however, the distinction between the presence or absence of a sign is made by using different compare instructions such as the CMP and CMPU instructions. On the other hand, the conditional jump instruction can be used regardless of whether the contents are signed or unsigned. Thus, the flag structure is simplified.

The carry flag used in conventional processors has two functions: one serves to compare the size of unsigned integers and another serves to represent a carry-out in multiple length operations. However, for the latter function, since the data processor of the present invention uses X.sub.-- flag, the carry flag is used only for comparing the size of integers. Thus, the carry flag of the data processor of the present invention is defined as that which represents the relationship of size and is named L.sub.-- flag (Lower Flag). In the case of an unsigned operation, this flag works as conventional carry flag. In the case of a signed operation, it represents the true size since it includes the overflow, unlike conventional carry flags.

F.sub.-- flag (general flag), which represents the termination condition of a string instruction and queue instruction, and P.sub.-- flag (P-bit error flag) which represents an error of the P bit are provided. P.sub.-- flag is reserved to `0` in the specification at present.

Although conventional processors use a carry flag which can contain the dropped bit from a shift instruction, the data processor of the present invention has L.sub.-- flag rather than a carry flag, so that the dropped bit is placed in X.sub.-- flag.

10-3 Flag Change

All the addition, subtraction, comparison and logical operation instructions are 2-operand instructions which have the following format:

If the size of dest differs from that of src, the smaller size operand is sign-extended in accordance with the larger size operand (ADDU, SUBU and CMPU are zero-extended), calculated, the result of the operation is converted into the size of dest, and then stored in dest.

In the case of CMP, CMPU, SUB and SUBU, L.sub.-- flag indicates that the size of the first operand of the previous operation is smaller. For CMPU and SUBU, which are for unsigned operations, L.sub.-- flag functions like the carry (borrow) flag of the convention processors. In a signed operation, L.sub.-- flag represents the true size because it includes the overflow, rather than just copying the M.sub.-- flag. In the ADD instruction, L.sub.-- flag indicates whether the result is negative. It also represents true positive and negative as well as overflow rather than copying the M.sub.-- flag. In the ADDU, since the result always becomes positive, L.sub.-- flag is set to `0`.

V.sub.-- flag indicates the result of the operation cannot be shown by the size being specified. In other words, when the result of an operation cannot be represented by the signed integer of the size of dest (unsigned integer for ADDU and SUBU), V.sub.-- flag is set. In the CMP and CMPU instructions, the status of the V.sub.-- flag is unchanged.

X.sub.-- flag is used to maintain the status of a carry-out in multiple length operations. The flag status is changed regardless of whether the operation is signed or unsigned. Although it functions similar to the carry flag of conventional processors, only the addition, subtraction and shift instructions change X.sub.-- flag.

In the CMP, SUB, CMPU and SUBU instructions, the status of L.sub.-- flag is changed in a similar manner. While SUB, SUBU and SUBX instructions cause X.sub.-- flag to change, CMP and CMPU instructions do not cause it to changed.

In the case of MOV, MOVU, ADD, ADDU, ADDX, SUB, SUBU and SUBX instructions, the statuses of M.sub.-- flag and Z.sub.-- flag are changed depending on the value when the operation result is converted in the size of dest. Thus, if the size of dest is smaller than that of src, even if the operation result is not 0, Z.sub.-- flag may be set. On the other hand, in the CMP and CMPU instructions, the status of Z.sub.-- flag is changed depending on the value of the operation result regardless of the size of dest.

______________________________________ Example: If @dest.B = 1 SUB #H'101.W,@dest.B .fwdarw. Although the operation result 1 H'101 is not 0, since dest becomes 0, Z.sub.-- flag is set. CMP #H'101.W,@dest.B .fwdarw. Since the operation result 1 H'101 is not 0, Z.sub.-- flag is cleared. ______________________________________

In ADDX and SUBX instructions, the flag status is irregularly changed to some extent, so that it can be used for both the unsigned integer extended operation and signed integer extended operation. In this case, although it does not completely match the mnemonic of the conditional jump instruction, since the extended operation is not frequently used, this irregularity should be permissible.

L.sub.-- flag Represents the relationship of size (SUBX) and positive and negative (ADDX) for signed operation.

V.sub.-- flag Represents an overflow for signed operation.

X.sub.-- flag In ADDX, represents a carry from the size of dest for the dest+src+X.sub.-- flag operation. In SUBX, it represents a borrow from the size of dest for the dest-src-X.sub.-- flag operation. However, if the size of src is smaller than that of dest, src is sign-extended. In SUBX, if the size of src is the same as that of dest, X.sub.-- flag consequently represents the result of the comparison as unsigned data.

When an operation between different size operands is performed with ADDX and SUBX, the smaller size operand is sign-extended. However, whether the value which is sign-extended is operated on as a signed value or an unsigned value depends on the status of the flag.

In the MOV instruction, MOVU instruction and logical operation instructions, the statuses of X.sub.-- flag and L.sub.-- flag are not changed.

In the logical operation instructions, the status of V.sub.-- flag is not changed.

The details of status flag changes are described in each instructions description. Special attention should be given descriptions marked with an astarisk.

11. Instruction Set Description Format

11-1 Outline of Descriptive Format

MNEMONIC:

Represents the same (mnemonic) of the instructions.

OPERATION:

Summarizes the function of the instruction.

OPTIONS:

Represents the types of options available for the instruction. The options of the instruction serve to change the sub-functions of the instruction and are described as `/xxx` in the assembler syntax.

INSTRUCTION FORMAT AND ASSEMBLER SYNTAX:

Represents the bit pattern, assembler syntax, size, and type of the instruction. In the data processor of the present invention, one instruction mnemonic may have multiple instruction formats such as the general format and short format, each of which is used depending on the addressing mode and size. This paragraph describes the addressing mode and size used in each instruction format.

STATUS FLAGS AFFECTED:

Shows how the status flags (PSB) are changed after the instruction is executed.

DESCRIPTION:

Describes the functions of the instruction. For details of the assembler mnemonics used in the description, see the Appendix at the end of the manual.

11-2 Instruction Bit Pattern and Assembler Syntax

The "INSTRUCTION FORMAT AND ASSEMBLER SYNTAX" portion is comprised of the mnemonic by format, operand name, operand field name and instruction bit pattern.

Example of Description 64 is shown in FIG. 49.

AND:G . . . Mnemonic-every-Format

Represents the mnemonic-every-format of the instruction bit pattern to be described (see Appendix).

src,dest . . . Operand Name

Variable which is used to describe the function of the instruction. This variable is referenced by the "OPERATION" and "DESCRIPTION". The order of the operands described in this description is that of the assembler.

Ear,EaM . . . Operand Field Name

Represents the relationship of the bit pattern, available operand size, available addressing mode, memory access method, and other restricted information. The letters which represent operand field names relate to their meanings so that various meanings can be simply represented.

Portion surrounded by lines . . . INSTRUCTION BIT PATTERN

The "INSTRUCTION BIT PATTERN" represents the operand field, size specified field position, and operation code of the instruction.

The bit represented by `*` is the don't care bit. 0 and 1 of this bit do not effect the instruction decoding.

The bits represented by `-`, `+`, `=` and `#` are currently not used to distinguish the instruction function and operand. However, the portio