中国开发网: 论坛: 程序员情感CBD: 贴子 218802
品雪: 这个机器以前没见过,还是蛮有意思的嘛
一个栈式机器,指令集如下:

Arithmetic operators

ADD — Add top two stack operands (B := B + A or BY := BY + AY if double precision)
SUBT — Subtract (B - A)
MULT — Multiply with single or double precision result
MULX — Extended multiply with forced double precision result
DIVD — Divide with real result
IDIV — Divide with integer result
RDIV — Return remainder after division
NTIA — Integerize truncated
NTGR — Integerize rounded
NTGD — Integerize rounded with double precision result
CHSN — Change sign
JOIN — Join two singles to form a double
SPLT — Split a double to form two singles
ICVD — Input convert destructive – convert BCD number to binary (for COBOL)
ICVU — Input convert update – convert BCD number to binary (for COBOL)
SNGL — Set to single precision rounded
SNGT — Set to single precision truncated
XTND — Set to double precision
PACD — Pack destructive
PACU — Pack update
USND — Unpack signed destructive
USNU — Unpack signed update
UABD — Unpack absolute destructive
UABU — Unpack, absolute update
SXSN — Set external sign
ROFF — Read and clear overflow flip flop
RTFF — Read true/false flip flop


Comparison operators

LESS — Is B < A?
GREQ — Is B ? A?
GRTR — Is B > A?
LSEQ — Is B ? A?
EQUL — Is B = A?
NEQL — Is B ? A?
LEQV — Do B and A have exactly the same bit pattern
SAME — Same as LEQV, but checking tag as well.


Logical operators

LAND — Logical and of all bits in operands
LOR — Logical or of all bits in operands
LNOT — Logical not of all bits in operands


Branch and call operators

BRUN — Branch unconditional (offset given by following code syllables)
DBUN — Dynamic branch unconditional (offset given in top of stack)
BRFL — Branch if last result false (offset given by following code syllables)
DBFL — Dynamic branch if last result false (offset given in top of stack)
BRTR — Branch if last result true (offset given by following code syllables)
DBTR — Dynamic branch if last result true (offset given in top of stack)
EXIT — Exit current environment (terminate process)
STBR — Step and branch (used in loops)
ENTR — Execute a procedure call as given by a tag 7 PCW, resulting in an RCW at D[n] + 1
RETN — Return from current routine to place given by RCW at D[n] + 1 and remove the stack frame


Bit and field operators

BSET — Bit set (bit number given by syllable following instruction)
DBST — Dynamic bit set (bit number given by contents of B)
BRST — Bit reset (bit number given by syllable following instruction)
DBRS — Dynamic bit reset (bit number given by contents of B)
ISOL — Field isolate (field given in syllables following instruction)
DISO — Dynamic field isolate (field given in top of stack words)
FLTR — Field transfer (field given in syllables following instruction)
DFTR — Dynamic field transfer (field given in top of stack words)
INSR — Field insert (field given in syllables following instruction)
DINS — Dynamic field insert (field given in top of stack words)
CBON — Count binary ones in the top of stack word (A or AX)
SCLF — Scale left
DSLF — Dynamic scale left
SCRT — Scale right
DSRT — Dynamic scale right
SCRS — Dynamic scale right save
DSRS — Dynamic scale right save
SCRF — Scale right final
DSRF — Dynamic scale right final
SCRR — Scale right round
DSRR — Dynamic scale right round


Literal operators

LT48 — Load following code word onto top of stack
LT16 — Set top of stack to following 16 bits in code stream
LT8 — Set top of stack to following code syllable
ZERO — Shortcut for LT48 0
ONE — Shortcut for LT48 1


Descriptor operators

INDX — Index create a pointer (copy descriptor) from a base (MOM) descriptor
NXLN — Index and load name (resulting in an indexed descriptor)
NXLV — Index and load value (resulting in a data value)
EVAL — Evaluate descriptor (follow address chain until data word or another descriptor found)


Stack operators

PUSH — Push down stack register
DLET — Pop top of stack
EXCH — Exchange top two words of stack
RSUP — Rotate stack up (top three words)
RSDN — Rotate stack down (top three words)
DUPL — Duplicate top of stack
MKST —Mark stack (build a new stack frame resulting in an MSCW on the top,
— often followed by parameter and local variable pushes and then ENTR)
IMKS — Insert an MSCW in the B register.
VALC — Fetch a value onto the stack as described above
NAMC — Place an address couple (IRW stack address) onto the stack as described above
STFF — Convert an IRW as placed by NAMC into an SIRW which references data in another stack.
MVST — Move to stack (process switch only done in one place in the MCP)


Store operators

STOD — Store destructive (if the target word has an odd tag throw a memory protect interrupt,
— store the value in the B register at the memory addressed by the A register.
— Delete the value off the stack.
STON — Store non-destructive (Same as STOD but value is not deleted – handy for F := G := H := J expressions).
OVRD — Overwrite destructive, STOD ignoring read-only bit (for use in MCP only)
OVRN — Overwrite non-destructive, STON ignoring read-only bit (for use in MCP only)


Load operators

LOAD — Load the value given by the address (tag 5 or tag 1 word) on the top of stack.
— Follow an address chain if necessary.
LODT — Load transparent – load the word referenced by the address on the top of stack


Transfer operators

These were used for string transfers usually until a certain character was detected in the source string. All these operators are protected from buffer overflows by being limited by the bounds in the descriptors.

TWFD — Transfer while false, destructive (forget pointer)
TWFU — Transfer while false, update (leave pointer at end of transfer for further transfers)
TWTD — Transfer while true, destructive
TWTU — Transfer while true, update
TWSD — Transfer words, destructive
TWSU — Transfer words, update
TWOD — Transfer word, overwrite destructive
TWOU — Transfer words, overwrite update
TRNS — Translate – transfer a source buffer into a destination converting characters as given in a translate table.
TLSD — Transfer while less, destructive
TLSU — Transfer while less, update
TGED — Transfer while greater or equal, destructive
TGEU — Transfer while greater or equal, update
TGTD — Transfer while greater, destructive
TGTU — Transfer while greater, update
TLED — Transfer while less or equal, destructive
TLEU — Transfer while less or equal, update
TEQD — Transfer while equal, destructive
TEQU — Transfer while equal, update
TNED — Transfer while not equal, destructive
TNEU — Transfer while not equal, update
TUND — Transfer unconditional, destructive
TUNU — Transfer unconditional, udpate


Scan operators

These were used for scanning strings useful in writing compilers. All these operators are protected from buffer overflows by being limited by the bounds in the descriptors.

SWFD — Scan while false, destructive
SISO — String isolate
SWTD — Scan while true, destructive
SWTU — Scan while true, update
SLSD — Scan while less, destructive
SLSU — Scan while less, update
SGED — Scan while greater or equal, destructive
SGEU — Scan while greater or equal, update
SGTD — Scan while greater, destructive
SGTU — Scan while greater, update
SLED — Scan while less or equal, destructive
SLEU — Scan while less or equal, update
SEQD — Scan while equal, destructive
SEQU — Scan while equal, update
SNED — Scan while not equal, destructive
SNEU — Scan while not equal, update

CLSD — Compare characters less, destructive
CLSU — Compare characters less, update
CGED — Compare characters greater or equal, destructive
CGEU — Compare characters greater or equal, update
CGTD — Compare character greater, destructive
CGTU — Compare character greater, update
CLED — Compare characters less or equal, destructive
CLEU — Compare characters less or equal, update
CEQD — Compare character equal, destructive
CEQU — Compare character equal, update
CNED — Compare characters not equal, destructive
CNEU — Compare characters not equal, update


System

SINT — Set interval timer
EEXI — Enable external interrupts
DEXI — Disable external interrupts
SCNI — Scan in – initiate IO read, this changed on different architectures
SCNO — Scan out – initiate IO write, this changed on different architectures
STAG — Set tag (not allowed in user-level processes)
RTAG — Read tag
IRWL — Hardware pseudo operator
SPRR — Set processor register (highly implementation dependent, only used in lower levels of MCP)
RPRR — Read processor register (highly implementation dependent, only used in lower levels of MCP)
MPCW — Make PCW
HALT — Halt the processor (operator requested or some unrecoverable condition has occurred)


Other

VARI — Escape to extended (variable instructions which were less frequent)
OCRX — Occurs index builds an occurs index word used in loops
LLLU — Linked list lookup – Follow a chain of linked words until a certain condition is met
SRCH — Masked search for equal – Similar to LLLU, but testing a mask in the examined words for an equal value
TEED — Table enter edit destructive
TEEU — Table enter edit, update
EXSD — Execute single micro destructive
EXSU — Execute single micro update
EXPU — Execute single micro, single pointer update
NOOP — No operation
NVLD — Invalid operator (hex code FF)
User operators — unassigned operators could cause interrupts into the operating system so that algorithms could be written to provide the required functionality


Edit operators

These were special operators for sophisticated string manipulation, particularly for business applications.

MINS — Move with insert – insert characters in a string
MFLT — Move with float
SFSC — Skip forward source character
SRSC — Skip reverse source characters
RSTF — Reset float
ENDF — End float
MVNU — Move numeric unconditional
MCHR — Move characters
INOP — Insert overpunch
INSG — Insert sign
SFDC — Skip forward destination character
SRDC — Skip reverse destination characters
INSU — Insert unconditional
INSC — Insert conditional
ENDE — End edit

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录