CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 91
Текст из файла (страница 91)
To input an instruction with its function code, press FUN, the function code, andthen WRITE. Refer to the pages listed programming and instruction details.CodeMnemonicName—ANDAND—AND LDAND LOAD—AND NOTAND NOT—CNTCOUNTER—LDLOAD—LD NOTLOAD NOT—OROR—OR LDOR LOAD—OR NOTOR NOT—OUTOUTPUT—OUT NOTOUTPUT NOT—RSET—FunctionPageLogically ANDs status of designated bit with execution condition.Logically ANDs results of preceding blocks.346Logically ANDs inverse of designated bit with executioncondition.A decrementing counter.346Used to start instruction line with the status of the designatedbit or to define a logic block for use with AND LD and OR LD.Used to start instruction line with inverse of designated bit.346Logically ORs status of designated bit with execution condition.Logically ORs results of preceding blocks.346Logically ORs inverse of designated bit with execution condition.Turns ON operand bit for ON execution condition; turns OFFoperand bit for OFF execution condition.Turns operand bit OFF for ON execution condition; turns operand bit ON for OFF execution condition (i.e., inverts operation).346RESETTurns the operand bit OFF when the execution condition isON, and does not affect the status of the operand bit whenthe execution condition is OFF.348SETSETTurns the operand bit ON when the execution condition isON, and does not affect the status of the operand bit whenthe execution condition is OFF.348—TIMTIMERON-delay (decrementing) timer operation.35900NOPNO OPERATIONNothing is executed and program moves to next instruction.35101ENDEND35102ILINTERLOCK03ILCINTERLOCK CLEAR040506JMPJME(@)FAL07FALS08STEPJUMPJUMP ENDFAILURE ALARM ANDRESETSEVERE FAILUREALARMSTEP DEFINERequired at the end of the program.If interlock condition is OFF, all outputs are turned OFF andall timer PVs reset between this IL(02) and the next ILC(03).Other instructions are treated as NOP; counter PVs aremaintained.If jump condition is OFF, all instructions between JMP(04)and the corresponding JME(05) are ignored.09SNXTSTEP START10SFT11KEEP1213Generates a non-fatal error and outputs the designated FALnumber to the Programming Console.Generates a fatal error and outputs the designated FALSnumber to the Programming Console.When used with a control bit, defines the start of a new stepand resets the previous step.
When used without N, definesthe end of step execution.347364346347347347351351353353355355356356SHIFT REGISTERUsed with a control bit to indicate the end of the step, resetthe step, and start the next step.Creates a bit shift register.KEEPDefines a bit as a latch controlled by set and reset inputs.349CNTRREVERSIBLECOUNTERIncreases or decreases PV by one whenever the incrementinput or decrement input signals, respectively, go from OFFto ON.365DIFUDIFFERENTIATE UPTurns ON the designated bit for one cycle on the rising edgeof the input signal.350374531Appendix AProgramming InstructionsCodeMnemonicNameFunctionPage14DIFDDIFFERENTIATEDOWNTurns ON the bit for one cycle on the trailing edge.35015TIMHHIGH-SPEED TIMERA high-speed, ON-delay (decrementing) timer.36016(@)WSFTWORD SHIFTShifts data between starting and ending words in word units,writing zeros into starting word.37517 to 19For expansion instructions.20CMPCOMPARECompares the contents of two words and outputs result toGR, EQ, and LE Flags.40221(@)MOVMOVECopies source data (word or constant) to destination word.38222(@)MVNMOVE NOTInverts source data (word or constant) and then copies it todestination word.38223(@)BINBCD TO BINARYConverts four-digit, BCD data in source word into 16-bitbinary data, and outputs converted data to result word.40924(@)BCDBINARY TO BCDConverts binary data in source word into BCD, and outputsconverted data to result word.41025(@)ASLARITHMETIC SHIFTLEFTShifts each bit in single word of data one bit to left, with CY.37526(@)ASRARITHMETIC SHIFTRIGHTShifts each bit in single word of data one bit to right, with CY.37627(@)ROLROTATE LEFTRotates bits in single word of data one bit to left, with CY.37628(@)RORROTATE RIGHTRotates bits in single word of data one bit to right, with CY.37729(@)COMCOMPLEMENTInverts bit status of one word of data.45030(@)ADDBCD ADDAdds two four-digit BCD values and content of CY, and outputs result to specified result word.42731(@)SUBBCD SUBTRACTSubtracts a four-digit BCD value and CY from another fourdigit BCD value and outputs result to the result word.42832(@)MULBCD MULTIPLYMultiplies two four-digit BCD values and outputs result tospecified result words.43033(@)DIVBCD DIVIDEDivides four-digit BCD dividend by four-digit BCD divisor andoutputs result to specified result words.43134(@)ANDWLOGICAL ANDLogically ANDs two 16-bit input words and sets corresponding bit in result word if corresponding bits in input words areboth ON.45135(@)ORWLOGICAL ORLogically ORs two 16-bit input words and sets correspondingbit in result word if one or both of corresponding bits in inputdata are ON.45136(@)XORWEXCLUSIVE ORExclusively ORs two 16-bit input words and sets bit in resultword when corresponding bits in input words differ in status.45237(@)XNRWEXCLUSIVE NORExclusively NORs two 16-bit input words and sets bit in resultword when corresponding bits in input words are same instatus.45338(@)INCBCD INCREMENTIncrements four-digit BCD word by one.45339(@)DECBCD DECREMENTDecrements four-digit BCD word by one.45440(@)STCSET CARRYSets carry flag (i.e., turns CY ON).42741(@)CLCCLEAR CARRYClears carry flag (i.e., turns CY OFF).42746(@)MSGMESSAGEDisplays a 16-character message on the Programming Console display.46847 & 48For expansion instructions.50(@)ADBBINARY ADDAdds two four-digit hexadecimal values and content of CY,and outputs result to specified result word.43751(@)SBBBINARY SUBTRACTSubtracts a four-digit hexadecimal value and CY from another four-digit hexadecimal value and outputs result to the result word.43852(@)MLBBINARY MULTIPLYMultiplies two four-digit hexadecimal values and outputs result to specified result words.44053(@)DVBBINARY DIVIDEDivides four-digit hexadecimal dividend by four-digit hexadecimal divisor and outputs result to specified result words.440532148148Appendix AProgramming InstructionsCodeMnemonicName54(@)ADDLDOUBLE BCD ADD55(@)SUBL56(@)MULL57(@)DIVLDOUBLE BCDSUBTRACTDOUBLE BCDMULTIPLYDOUBLE BCD DIVIDE58(@)BINLDOUBLE BCD TODOUBLE BINARY59(@)BCDLDOUBLE BINARY TODOUBLE BCD60 to 69For expansion instructions.70(@)XFERBLOCK TRANSFER71(@)BSETBLOCK SET73(@)XCHGDATA EXCHANGE74(@)SLD75(@)SRD76FunctionPageAdds two eight-digit values (2 words each) and content of CY,and outputs result to specified result words.Subtracts an eight-digit BCD value and CY from anothereight-digit BCD value and outputs result to the result words.Multiplies two eight-digit BCD values and outputs result tospecified result words.Divides eight-digit BCD dividend by eight-digit BCD divisorand outputs result to specified result words.Converts BCD value in two consecutive source words intobinary and outputs converted data to two consecutive resultwords.
(CPM2A only)433Converts binary value in two consecutive source words intoBCD and outputs converted data to two consecutive resultwords. (CPM2A only)411434436436410148Moves content of several consecutive source words to consecutive destination words.Copies content of one word or constant to several consecutive words.Exchanges contents of two different words.383Left shifts data between starting and ending words by onedigit (four bits).Right shifts data between starting and ending words by onedigit (four bits).Converts up to four hexadecimal digits in source word intodecimal values from 0 to 15 and turns ON, in result word(s),bit(s) whose position corresponds to converted value.378(@)MLPXONE DIGIT SHIFTLEFTONE DIGIT SHIFTRIGHT4-TO-16 DECODER77(@)DMPX16-TO-4 ENCODER41478(@)SDEC80(@)DIST81(@)COLL7-SEGMENTDECODERSINGLE WORDDISTRIBUTEDATA COLLECT82(@)MOVBMOVE BIT83(@)MOVDMOVE DIGIT84(@)SFTR85(@)TCMPREVERSIBLE SHIFTREGISTERTABLE COMPARE86(@)ASCASCII CONVERTDetermines position of highest ON bit in source word(s) andturns ON corresponding bit(s) in result word.Converts hexadecimal values from source word to data forseven-segment display.Moves one word of source data to destination word whoseaddress is given by destination base word plus offset.Extracts data from source word and writes it to destinationword.Transfers designated bit of source word or constant to designated bit of destination word.Moves hexadecimal content of specified four-bit source digit(s) to specified destination digit(s) for up to four digits.Shifts data in specified word or series of words to either leftor right.Compares four-digit hexadecimal value with values in tableconsisting of 16 words.Converts hexadecimal values from the source word to eightbit ASCII code starting at leftmost or rightmost half of startingdestination word.87 to 89For expansion instructions.91(@)SBSSUBROUTINE ENTRYCalls and executes subroutine N.45592SBNMarks start of subroutine N.45793RETSUBROUTINEDEFINERETURN45797(@)IORFI/O REFRESH99(@)MCROMACROMarks the end of a subroutine and returns control to mainprogram.Refreshes all I/O words between the start and end words.Cannot be used with the SRM1(-V2).Calls and executes a subroutine replacing I/O words.384385378412416385387389390379403419148469457533Appendix AProgramming InstructionsExpansion InstructionsThe following table shows the instructions that can be treated as expansion instructions in the CPM2A, CPM2C,and SRM1(-V2) PCs.