Talk:NS320xx

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computing  
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.
 


The Professor link mentioned at the bottom of the article seems highly suspect to me.

The wiki article mentions what I have heard in other contexts as well, that the NS32032 was simply unreliable, and generally detested for that reason. I do know that Atari DID consider using them for what would become the ST series, but gave up on that idea when NatSemi made it clear that they were not able to supply the numbers (low yields? related to unreliability?) nor were they willing to lower the price (another pointer to low yields).

The Sun article, on the other hand, claims the problem all along was that they aimed at the low-price-point instead of the high-performance-point. I find this difficult to believe given the Atari history, and the article's explaination of the lower prices later in its history seems rather plausible.

Of course the author goes on to claim that the Java Chip is a sure-fire winner. We all know how that turned out!

Maury 20:07, 24 October 2005 (UTC)

(I'm probably not replying to this correctly...I'm rather new to Wikipedia)
The NS32032/NS32016/NS32008 had serious issues, all well documented. As far as the Sun article, I added it only as on-topic from someone there (it is, and he was), one perspective of a complex issue (which is all it is), and interesting (I thought it was). I don't out of hand dismiss what he has to say about the market (indeed, since I was there as well, I don't myself disagree), and I further don't dismiss him about Java. A lot of really, really smart people got caught up in that one.
User:kjs3

Contents

[edit] HP FOCUS

It turns out that HP's FOCUS CPU was a fully 32-bit single-chip processor, and was released in 1982, before the release of the 32032 in 1984. If you consider a 32-bit CPU to be one with an external 32-bit data bus (which seems to be the commonly accepted definition), then HP FOCUS seems to have got there first. I tried, but I couldn't see how to work this into the article. --StuartBrady (Talk) 11:33, 4 September 2006 (UTC)

The FOCUS was predated by the BELLMAC-32A from AT&T Bell Labs (and post-divestiture, from Western Electric). The first BELLMAC-32A engineering samples were produced in 1980. --Brouhaha 21:11, 4 September 2006 (UTC)

[edit] Broken Link

I have removed the following text from the article, because the link is broken:

http://www.sun.com/microelectronics/picoJava/pioneers/vol2/professor.html has an interesting perspective on why the later 32000 series processors failed from an insider.

Before reposting this link, or a variant, we should ensure that the address is correct. --User:Wknight8111 (WB:Whiteknight) 04:14, 6 March 2007 (UTC)

It's still available at archive.org: http://web.archive.org/web/20060312110509/http://www.sun.com/microelectronics/picoJava/pioneers/vol2/professor.html 1111mol (talk) 23:38, 14 January 2010 (UTC)

[edit] Instruction set (WIP)

The NS32000 series instructions follow a consistent pattern:

  • 1 to 3 bytes of opcode, which may specify up to 1 register operand and 2 general purpose operands
  • An optional index byte for operand 1 (usually the source)
  • An optional index byte for operand 2 (usually the destination)
  • Up to 2 displacements for operand 1, or operand 1's immediate value
  • Up to 2 displacements for operand 2, or operand 2's immediate value
  • Up to 2 optional implicit displacements or 8-bit immediate constants (depending on the instruction)

A very few "quick" instructions embed a 4-bit signed immediate operand value in the instruction itself.

Addressing is generally consistently little-endian, but constants in the instruction stream (displacements and immediate constants) are stored most significant byte first.

As mentioned above, the size of the displacement is encoded in the most significant bits of the first byte of the displacement itself:

  • If the msbit of the displacement is 0, 1 byte supplies a 7-bit signed displacement (−64–63)
  • If the msbits of the displacement are 10, 2 bytes supply a 14-bit signed displacement (−8192–8191)
  • If the msbits of the displacement are 11, 4 bytes supply a 30-bit signed displacement (−536870912–536870911)

[edit] Processor registers

There are 8 general purpose registers (R0 through R7) and 4 special-purpose address registers:

  • FP (Frame pointer)
  • SP (Stack pointer)
  • SB (Static base, for global variable access)
  • PC (Program counter)

The addressing modes below refer to these address registers as A0 through A3, respectively.

Additional significant registers:

  • There are actually two stack pointers. Interrupts use the interrupt stack pointer SP0, while user-level code uses the user stack pointer SP1. The choice depends on the PSR's S bit (referred to as PSR.S).
  • The 32-bit INTBASE register points to an array of 127 interrupt vectors. The first 11 entries are assigned by hardware to non-vectored interrupts, non-maskable interrupts, and 9 traps that can be caused by instruction execution.
  • The 16-bit Processor Status Register (PSR) contains 6 or 7 user flags in the low byte, and 4 system flags in the high byte.
  • The 16-bit module register (MOD) points to the curent module descriptor; this is explained in more detail below. It is often combined with the PSR into one 32-bit word.
  • The 4- or 8-bit write-only configuration (CFG) register enables support for additional processor features:
    • CFG.I: NS32202 interrupt controller is present; use vectored interrupts.
    • CFG.F: NS32x81 floating-point coprocessor is present; allow FP instructions
    • CFG.M: NS32x82 memory-management unit is present
    • CFG.C: Custom coprocessor is present; enable format 15 instructions
    • CFG.FF: (32332+ only) FPU supports faster 32-bit protocol
    • CFG.FM: (32332+ only) MMU supports faster 32-bit protocol
    • CFG.FC: (32332+ only) Custom coprocessor supports faster 32-bit protocol
    • CFG.P: (32332+ only) MMU has page size ≥4K; makes detecting virtual aliases faster — Preceding unsigned comment added by 71.41.210.146 (talk) 22:44, 15 January 2012 (UTC)

[edit] Processor Status Register

The user flags are set implicitly by various instructions. Compared to other microprocessors, flag setting is extremely parsimonious; most instructions, including logical, shift, and multiply/divide instructions, do not modify the flags at all. Add and subtract instructions set only C (carry) and F (overflow); they do not set Z. Compares (integer, floating-point, or string) set Z, N and L. ABS, CHECK, string operations, and the bit operations set F. Other than that, only the instructions that explicitly modify the PSR modify the flags.

PSR bits 0 through 7 are user flags:

  • PSR.C: A traditional carry flag. This is a borrow flag when subtracting. It is not set by comparisons.
  • PSR.T: A status flag that enables program tracing.
  • PSR.L: A "lower flag", set only for comparison operations. It is set if the second operand is less than the first when interpreted as unsigned integers, i.e. op2−op1 generates a borrow. Most other microprocessors would use the C bit for this purpose.
  • (PSR bit 3 is unused)
  • PSR.V: In early NS32xxx processors, PSR bit 4 is unused. In later models (NS32532 and NS32GX32), this bit, called PSR.V, enables a trap on integer overflow. Note that this is different from other processors' V flags.
  • PSR.F: A general-purpose condition flag. It is set as an overflow flag by addition and subtraction operations, and bit test instructions copy the target bit to this flag. It is also set by the bounds-check instruction (to 1 if out of bounds), address validation instructions, and string instructions (to 1 if until/while condition is met). There is a special instruction which can trap if this bit is set.
  • PSR.Z: A traditional zero flag, if a comparison result is equal. It is not set by arithmetic or logical operations.
  • PSR.N: While this is called a "negative flag", it is different from other processors' negative flags; it is set only by comparison operations and indicates that the second operand is less than the first when interpreted as signed integers; i.e. op2−op1 is negative. Unlike other processors, this depends on the true result of the subtraction, before it is truncated to the destination width, and thus is not corrupted by integer overflow. Most other microprocessors would have conditional instructions that tested both N and V bits for this purpose.

PSR bits 8 through 15 are system flags, and may not be accessed in user mode:

  • PSR.U: User flag. If set, privileged instructions are forbidden.
  • PSR.S: Stack pointer select. Cleared by interrupt. This selects which SP register is used. Typically has same value as U.
  • PSR.P: Trace pending. The T flag is copied here once per instruction; it prevents repeated trace traps.
  • PSR.I: Interrupt enable. If clear, only NMI is accepted.
  • (PSR bits 12–15 are unused)

[edit] Modules and external references

The NS32000 series provides support for run-time linking of multiple independent "modules" of code. The current module is identified by the 16-bit MOD register, which points to a 3-word module descriptor located somewhere in the first 64K of memory.

One of those descriptor words is the link base (LB), which points to a "link table" of 32-bit references to other modules. Each reference to an external object in another module is assigned a slot in the link table, and only the link tables need to be adjusted to link modules together.

Link table entries are either 32-bit data pointers, or external procedure descriptors consisting of a 16-bit module and a 16-bit entry point offset.

To reference "external" data in another module, the addressing mode specifies two displacements. The first specifies an offset into the link table, and the second is the offset from the resultant data pointer. The final address is disp2 + [4×disp1 + LB] (which may also, like all addressing modes, have a scaled index added to it).

When making procedure calls between modules, things are more intricate. The "call external procedure" (CXP) instruction specifies a single displacement into the link table, and the selected word (at 4×disp + LB) contains an "external procedure descriptor" consisting of a 16-bit target module and a 16-bit entry point offset.

After saving the original module and program counter on the stack, the MOD register is loaded with the target module and the three words of the descriptor it points to are used as follows:

  • The first word is loaded into the SB register, for accessing module-local data. (The previous SB value is not saved, but will be reloaded from the module descriptor when returning.)
  • The second word is used as the new link base (LB). (NS320xx processors do not have a dedicated LB register which caches this value, but load it from the descriptor each time it is needed.)
  • The third word is the program base (PB). This is added to the 16-bit offset to produce the final PC value that control transfers to.

When returning from an external procedure (using the RXP instruction), the PC and MOD are restored from the stack, and SB is restored from the module descriptor.

Although it is possible to modify the MOD and SB registers independently using the LPR instruction, this is unwise unless interrupts are disabled; interrupt vectors also take the form of external procedure calls, restoring the SB register value from the descriptor as part of interrupt return. Thus, normally the SB register should only be updated as part of changing modules.

While some aspects of this resemble 80x86 segmentation, in particular the use of a 16-bit selector which points to an in-memory descriptor that is loaded into registers when the selector changes, and the use of separate "near" and "far" subroutine call/return instructions, there are significant differences. In particular, descriptors are part of the user address space and cannot be used to enforce protection boundaries. Also, there is only one current module, not separate segments for code, data, etc.

[edit] Addressing modes

General purpose operands are specified by a 5-bit field:

NS32000 operand encoding
Bit Meaning
4 3 2 1 0
0 0 n Register Rn (Register direct)
0 1 n disp(Rn) (Register indirect with displacement)
1 0 0 n disp2(disp1(An)) (Address register double indirect)
1 0 0 1 1 (Reserved; PC double-indirect is not supported)
1 0 1 0 0 #k (Immediate)
1 0 1 0 1 @disp (Absolute)
1 0 1 1 0 disp2(4×disp1(LB)) (External; peculiar to NS32000)
1 0 1 1 1 TOS (Top of stack, push or pop as appropriate)
1 1 0 n disp(An) (Address register indirect)
1 1 1 s base[Rn:S] (Indexed: base + 2S×Rn)

The top-of-stack mode pops the data from the stack pointer when used as a source operand, and pushes it when used as a destination. When used as both a source and a destination, it is equivalent to (but shorter than) 0(SP).

The indexed mode specifies an additional offset to be added to a base addressing mode.

A following index byte specifies (in its low 3 bits) an index register Rn, and (in its high 5 bits) a base operand. The index register is multiplied by a scale factor of 1, 2, 4 or 8 (indicated by a size letter S of B, W, D, or Q respectively), and added to the address of the base operand. Immediate and indexed modes are illegal as the base operand, and register direct modes are interpreted as register-indirect with zero displacement.

[edit] String instructions

The NS32000 includes an orthogonal series of memory-to-memory string operations. These use registers R0 to R4 for fixed purposes in a way that lets the instruction be interrupted partway and seamlessly resumed. Not all instructions use all the registers. String instructions come in byte, word, and long sizes.

  • R0: Limit count. This specifies the maximum number of bytes or words to copy, and is decremented as the operation proceeds.
  • R1: Source string. This points to the beginning of the source, and is updated as the operation proceeds.
  • R2: Destination string.
  • R3: Translation table pointer. For byte operations only, a "translated" variant can be used, where a source byte is looked up in the table pointed to be R3 before being used.
  • R4: Comparison value. String operations can be halted before R0 runs out by a byte or word in the source whose (translated) value matches this register.

Options are specified by a 4-bit field:

Bit Letter Meaning
3 U Repeat until match with R4 (also set bit 2)
2 W Repeat while match with R4 (or until if bit 3 is also set)
1 B Work backward, decrementing R1 and R2
0 T Translated. Use "T" instead of size letter "B".

The mapping of bit 2 is not explained perfectly by the above table; it is set to cause matching with R4 to be a termination condition; the polarity of bit 3 controls whether the letter to use is W (if not set, repeat while match) or U (if set, repeat until match). If this happens, the PSR.F bit is set to 1, and responsible datum is not copied.

All string instructions set the PSR.F flag; it is set to 0 if the operation is terminated by the count in R0 running out, and 1 if the operation is terminated due to comparison with R4. If the W or U options are not specified, this is the only case which ever occurs.

[edit] Bit and bit-field instructions

Bits are addressed using a 32-bit "base" byte address plus a 32-bit bit offset. These are combined in a 35-bit bit address, which is consistently little-endian. (E.g. bit 11 is bit 3 of byte 1.)

The bit manipulation instructions (test, set, clear, and invert) copy the bit to the PSR.F flag before modifying it.

Bit fields add a length field, and can be accessed using "insert" and "extract" instructions to copy a general operand to a bit field and vice-versa, respectively. Extraction is unsigned; the field is zero-extended to fit the destination. In the general case, the bit offset is a register value, and the length is a constant displacement. If the offset and length are both small constants, there are "short" forms of these instructions which pack them both into an 8-bit immediate (5 bits of length-1, followed by 3 bits of offset).

Another bit-field instruction is "find first set", FFS. This updates the offset operand to the index of the first set bit in the field and clears PSR.F, or sets PSR.F=1 if the field is all zero.

[edit] Floating point

Floating point was performed by an external coprocessor: NS32081, NS32381, or a combination of the NS32580 controller and Weitek WTL 3164 FPU. The original '081 had 8 32-bit registers, and even-numbered pairs were available for long (64-bit IEEE double) operands.

Later models provided 8 64-bit registers, L0 through L7, with the 32-bit registers aliased to the halves of the even-numbered L registers.

[edit] Instruction encoding

A trailing i represents an integer operand size letter: (B)yte, (W)ord or (D)oubleword. These are 8, 16 and 32 bits, and represented by the values 0, 1 and 3 in the size field, respectively. The value 2 is used to encode other instructions. A trailing f indicates a floating-point operand size letter, encoded using a 1-bit size field: (L)long (64-bit, size bit 0), or (F)loat (32-bit, size bit 1). Note that the terms "long" and "double" are swapped relative to the C language.

NS32000 operand size encodings
Abbrev Encoding Suffix Meaning
size 00 B Byte, 8 bit integer
01 W Word, 16 bit integer
11 D Doubleword, 32-bit integer
f 0 L Long, 64-bit floating point
1 F Float, 32-bit floating point
c 0 Q Quad word, 64-bit coprocessor value
1 D Doubleword, 32-bit coprocessor value

The most common instructions are 2 bytes long, and have the operand size in the least-significant bits of the first byte. The unused integer operand size encoding "10" is used for 1-byte instructions (whose lsbits are "010"), and 3-byte instructions (whose lsbits are "110"). 3-byte instructions encode the operand size in the lsbits of the second byte.

NS32000 series instruction size encoding
Byte 0 Description
7 6 5 4 3 2 1 0
opcode 0 0 2-byte instruction, (8-bit) byte operands
opcode 0 1 2-byte instruction, (16-bit) word operands
opcode 1 1 2-byte instruction, (32-bit) doubleword operands
opcode 0 1 0 1-byte instruction
opcode 1 1 0 3-byte instruction; size in lsbits of 2nd byte

The opcode assignments are more comprehensible if they are sorted bit-reversed, as though bit 0 were the most significant bit, so the table below lists them that way. Embedded values (such as register numbers) still have their most significant bits in higher-numbered bit positions.

NS32000 series 1-byte instructions
Byte 0 Description
7 6 5 4 3 2 1 0
opcode 0 0 1 0 Format 1 instructions: Procedure calls and returns
0 0 0 0 0 0 1 0 BSR disp (Push PC, PC += disp)
1 0 0 0 RET disp (Pop PC, then SP += disp)
0 1 0 0 CXP disp (Call external procedure; descriptor at LB + 4*disp)
1 1 0 0 RXP disp (Return from external procedure; pop PC and MOD, then SP += 2 + disp)
0 0 1 0 RETT disp (Return from trap: RETI, then SP += disp)
1 0 1 0 RETI (Return from interrupt: pop PC, pop MOD, pop PSR)
0 1 1 0 SAVE [register list] (Push multiple registers to stack, 8-bit immediate map)
1 1 1 0 RESTORE [register list] (Restore multiple registers from stack)
0 0 0 1 ENTER [register list], disp (Push FP, FP = SP, SP −= disp, push registers)
1 0 0 1 EXIT [register list] (Pop registers, SP = FP, pop FP)
0 1 0 1 NOP: No operation.
1 1 0 1 WAIT: Wait for interrupt.
0 0 1 1 DIA: Hardware breakpoint, branch to self.
1 0 1 1 FLAG (if PSR.F=1, take flag trap)
0 1 1 1 SVC (supervisor call trap)
1 1 1 1 BPT (breakpoint trap)
condition 1 0 1 0 Format 0 instructions: If condition is true, PC += disp
0 0 0 0 1 0 1 0 BEQ disp (branch if PSR.Z=1)
1 0 0 0 BNE disp (branch if PSR.Z=0)
0 1 0 0 BCS disp (branch if PSR.C=1)
1 1 0 0 BCC disp (branch if PSR.C=0)
0 0 1 0 BHI disp (branch if PSR.L=1)
1 0 1 0 BLS disp (branch if PSR.L=0)
0 1 1 0 BGT disp (branch if PSR.N=1)
1 1 1 0 BLE disp (branch if PSR.N=0)
0 0 0 1 BFS disp (branch if PSR.F=1)
1 0 0 1 BFC disp (branch if PSR.F=0)
0 1 0 1 BLO disp (branch if (PSR.L|PSR.Z) = 0)
1 1 0 1 BHS disp (branch if (PSR.L|PSR.Z) = 1)
0 0 1 1 BHI disp (branch if (PSR.N|PSR.Z) = 0)
1 0 1 1 BLS disp (branch if (PSR.N|PSR.Z) = 1)
0 1 1 1 BR disp (branch always)
1 1 1 1 B?? disp (branch never)
NS32000 series 2-byte instructions
Byte 1 Byte 0 Description
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
src dest opcode size Format 4 instructions: Common 2-operand arithmetic
src dest 0 0 0 0 size ADDi src, dest (dest += src)
src dest 1 0 0 0 size SUBi src, dest (dest −= src)
src dest 0 1 0 0 size ADDCi src, dest (dest += src + carry)
src dest 1 1 0 0 size SUBCi src, dest (dest −= src + carry)
src dest 0 0 1 0 size BICi src, dest (dest &= ~src)
src dest 1 0 1 0 size ANDi src, dest (dest &= src)
src dest 0 1 1 0 size ORi src, dest (dest |= src)
src dest 1 1 1 0 size XORi src, dest (dest ^= src)
src dest 0 0 0 1 size CMPi src, dest (dest − src, set flags only)
src dest 1 0 0 1 1 1 ADDR src, dest (dest = &src, AKA Load Effective Address)
1 0 1 1 0 dest 1 0 0 1 1 1 LXPD n,dest ("load external procedure descriptor", = ADDR EXT(n), dest)
src dest 0 1 0 1 size MOVi src, dest (dest = src)
offset base 1 1 0 1 size TBITi base, offset (F = bit at base+offset)
x 1 1 size Format 2 or 3; see below
dest k opcode 1 1 size Format 2 instructions; k is a 4-bit signed immediate constant.
dest k 0 0 0 1 1 size ADDQi #k, dest
dest k 1 0 0 size ACBi #k, dest, disp (dest += #simm4, branch to disp(PC) if non-zero)
dest k 0 1 0 size SPRi special, dest (k specifies system register)
src k 1 1 0 size LPRi special, src (k specifies system register)
src k 0 0 1 size CMPQi #k, src (src − k, set flags only)
dest k 1 0 1 size MOVQi #k, dst (dst = k)
dest cond 0 1 1 size Scondi dst (If condition is true, set dest = 1; see BEQ et. al.)
x 1 1 1 size Format 3; see below
src opcode 0 1 1 1 1 1 size Format 3 instructions: Common single-operand instructions
src 0 0 0 0 1 1 1 1 1 1 1 CXPD dest (Call external procedure using descriptor at src)
1 0 0 (Undefined, illegal instruction)
addr 0 1 0 1 1 JUMP addr (PC = addr)
addr 1 1 0 1 1 JSR addr (Push PC, PC = addr)
src 0 0 1 0 s BICPSRi src (PSR &= ~src)
src 1 0 1 size ADJSPi src (SP −= src)
src 0 1 1 0 s BISPSRi src (PSR |= src)
src 1 1 1 size CASEi src (PC += src)
x 1 1 1 1 1 1 (Undefined, illegal instruction)

For the LPR and SPR instructions, the 4-bit k value specifies the processor register as:

  • 0000 (0): User stack pointer, SP1
  • 1000 (8): FP
  • 1001 (9): SP (current SP, based on PSR.S)
  • 1010 (10): SB
  • 1101 (13): PSR (only allowed when PSR.U=0)
  • 1110 (14): INTBASE (only allowed when PSR.U=0)
  • 1111 (15): MOD

Values of 1–7, 11 and 12 are undefined


NS32000 series 3-byte instructions
Byte 2 Byte 1 Byte 0 Description
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
xxx 00110 Format 19: Undefined, illegal instruction
nnn 10110 Format 15: Custom coprocessor operations
src k x opcode size 000 10110 Format 15.0: Privileged operations
src dest opcode c size 001 Format 15.1: Conversion operations
src dest opcode x c 101 Format 15.5: General calculate/move operations
src dest opcode x c 111 Format 15.7: General calculate/move operations
— 0 — U W B T 0 0 0 opc. size 00001110 Format 5: String instructions
— 0 — U W B 0 0 0 0 0 0 size 00001110 MOVSi: move from string1 to string2
— 0 — U W B 1 0 0 0 0 0 0 0 MOVST: move translated from string1 to string2
0 k 0 0 0 1 0 size SETCFG: Set CFG register to 8-bit value k.
— 0 — U W B 0 0 0 0 0 1 size CMPSi: Compare string1 to string2
— 0 — U W B 1 0 0 0 0 1 0 0 CMPST: Compare translated string1 to string2
— 0 — U W B 0 0 0 0 1 1 size SKPSi: Skip string 1 (returns unskipped length in R0)
— 0 — U W B 1 0 0 0 1 1 0 0 SKPST: Skip translated string 1 (returns unskipped length in R0)
1 Undefined, illegal instruction
1 Undefined, illegal instruction
1 Undefined, illegal instruction
10001110 Format 18: Undefined, illegal instruction
src dest opcode size 01001110 Format 6: Additional 2-operand instructions.
src dest 0 0 0 0 size 01001110 ROTi: Rotate dest left by src.B bits (right if src is negative)
0 1 0 0 (Undefined, illegal instruction)
src dest 0 0 0 1 size ASHi: Arithmetic shift left (src always byte, right if negative)
src dest 0 1 0 1 size LSHi: Logical shift left (src always byte, right if negative)
src dest 1 0 0 0 size NEGi: dest = −src, sets C and F.
src dest 1 1 0 0 size ABSi: dest = |src|, sets F.
src dest 1 0 0 1 size NOTi: dest = !src
src dest 1 1 0 1 size COMi: dest = ~src
offset base 0 0 1 0 size CBITi: Copy bit at base+offset to F, then clear
offset base 0 1 1 0 size SBITi: Copy bit at base+offset to F, then set
offset base 0 0 1 1 size CBITIi: Clear bit, interlocked (atomic)
offset base 0 1 1 1 size SBITIi: Set bit, interlocked (atomic)
1 0 1 0 (Undefined, illegal instruction)
offset base 1 1 1 0 size IBITi: Copy bit at base+offset to F, then invert
src dest 1 0 1 1 size SUBPi (subtract packed decimal)
src dest 1 1 1 1 size ADDPi (add packed decimal)
src dest opcode size 11001110 Format 7: Additional 2-operand instructions.
src dest 0 0 0 0 size 11001110 MOVMi src, dest, len: Move multiple, length is displacement constant
src dest 0 0 0 1 size CMPMi src, dest, len: Compare multiple
src base 0 0 1 0 size INSSi base, dest, #offset3, #len5 (insert bit string short)
base dest 0 0 1 1 size EXTSi src, base, #offset3, #len5 (extract bit string short)
src dest 0 1 0 0 0 0 MOVXBW: Move byte to word, sign-extending
src dest 0 1 0 1 0 0 MOVZBW: Move byte to word, zero-extending
src dest 0 1 1 0 0 s MOVZiD: Move size to doubleword, zero-extending
src dest 0 1 1 1 0 s MOVXiD: Move size to doubleword, sign-extending
src dest 1 0 0 0 size MULi: dest *= src
src dest 1 0 0 1 size MEIi: dest[1:0] = dest[0] * src (unsigned, double-size destination)
1 0 1 0 (Undefined, illegal instruction)
src dest 1 0 1 1 size DEIi: dest[0] = dest[1:0] % src, dest[1] = dest[1:0] / src (unsigned)
src dest 1 1 0 0 size QUOi: dest /= src (signed, round to 0)
src dest 1 1 0 1 size REMi: dest %= src (signed, round to 0)
src dest 1 1 1 0 size MODi: dest %= src (signed, round to −∞)
src dest 1 1 1 1 size DIVi: dest /= src (signed, round to −∞)
src dest reg o size opc. 101110 Format 8: 3+-operand instructions.
src dest reg 0 size 00 101110 EXTi (extract bitfield: copy disp bits starting reg bits after src to dest)
src dest reg 0 size 01 CVTP: dest = ADDR(src)*8 + reg (convert to bitfield pointer)
src dest reg 0 size 10 INSi (insert bitfield: copy disp bits from src to reg bits after dest)
src bounds reg 0 size 11 CHECKi: reg = src−lower_bound, or F=1 if out of bounds
length index reg 1 size 00 INDEXi: reg = reg * (length+1) + index
src dest reg 1 size 01 FFSi: Search starting dst.B bits after src; reg is length.
src dest 0 0 1 1 size 10 MOVSUi: Move from supervisor to user space
src dest 0 1 1 1 size 10 MOVUSi: Move from user to supervisor space
1 11 (Undefined, illegal instruction)
src k 0 opcode size 00011110 Format 14: System instructions
src — 0 — 0 0 0 0 0 size 00011110 RDVALi: Test if src is readable in user mode, result in PSR.F
src — 0 — 0 0 0 0 1 size WRVALi: Test if dest is writeable in user mode, result in PSR.F
src k 0 0 0 1 0 size LMR: Load MMU reg k from src
dest k 0 0 0 1 1 size SMR: Store MMU reg k to dest
0 x 1 x (Undefined, illegal instruction)
0 1 0 0 0 (Undefined, illegal instruction)
src 0 A I D 0 1 0 0 1 1 1 CINV [flags],src: Cache invalidate. A=All (0=line containing src), D=Data, I=instruction
0 1 0 1 x (Undefined, illegal instruction)
0 1 1 x (Undefined, illegal instruction)
10011110 Format 13: Undefined, illegal instruction
01011110 Format 16: Undefined, illegal instruction
11011110 Format 17: Undefined, illegal instruction
src dest opcode f size 00111110 Format 9: Floating point conversions
src dest 0 0 0 f size 00111110 MOVif: Convert integer to floating-point
src dest 0 0 1 f 1 1 LFSR: FSR = src
src dest 0 1 0 1 0 0 MOVLF: Convert (64-bit) long float to (32-bit) float
src dest 0 1 1 0 1 1 MOVFL: Convert (32-bit) float to (64-bit) long float
src dest 1 0 0 f size ROUNDfi: Convert floating-point to integer, round to nearest
src dest 1 0 1 f size TRUNCfi: Convert floating-point to integer, round to 0
src dest 1 1 0 f 1 1 SFSR: dest = FSR
src dest 1 1 1 f size FLOORfi: Convert floating-point to integer, round to −∞
src dest opcode 0 f 10111110 Format 11: Floating-point operations
src dest 0 0 0 0 0 f 10111110 ADDf: dest += src
src dest 0 0 0 1 0 f MOVf: dest = src
src dest 0 0 1 0 0 f CMPf
src dest 0 1 0 0 0 f SUBf: dest −= src
src dest 0 1 0 1 0 f NEGf: dest = −src
src dest 1 0 0 0 0 f DIVf: dest /= src
src dest 1 1 0 0 0 f MULf: dest *= src
src dest 1 1 0 1 0 f ABSf: dest = |src|
src dest other 0 f (Opcodes 0011 & 1010 alias to CMPf, x110 to ADDf, others to MOVf)
01111110 Format 10: Undefined, illegal instruction
src dest opcode 0 f 11111110 Format 12: Floating-point extensions (not on NS32081)
src dest 0 0 0 0 0 f 11111110 REMf: dest %= src
src dest 0 0 0 1 0 f SQRTf: dest = SQRT(src) (32580 only)
src src2 0 0 1 0 0 f POLYf: Accumulate polynomial in f0 (f0 = f0 * src + src2, 32381 only)
src src2 0 0 1 1 0 f DOTf: Accumulate dot product in f0 (f0 += src * src2, 32381 only)
src dest 0 1 0 0 0 f SCALBf: dest *= 2src, src must be integer (32381 only)
src dest 0 1 0 1 0 f LOGBf: dest = unbiased exponent of src (32381 only)
0 1 1 x 0 (Undefined, illegal instruction)
1 0 0 x 0 (Undefined, illegal instruction)
src src2 1 0 1 0 0 f MACf: Multiply accumulate (f1 += src * src2, 32580 only)
1 0 1 1 0 (Undefined, illegal instruction)
src dest 1 1 0 0 0 f ATAN2f (?? listed in 32332 data sheet)
src dest 1 1 0 1 0 f SICOSf, results in dest & f0 (?? listed in 32332 data sheet)
1 1 1 x 0 (Undefined, illegal instruction)

This is being worked on here until is ready for inclusion in the article. Main reference, see e.g. page 143 et seq. Detailed instruction definitions begin on p. 1259. Also 32532 data sheet and NS32381 data sheet. 71.41.210.146 (talk) 08:40, 25 April 2010 (UTC)

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export