Do-more Technical Training Instruction Set (Misc/Data Manipulation)

Slides:



Advertisements
Similar presentations
INSTRUCTION SET ARCHITECTURES
Advertisements

There are two types of addressing schemes:
TK 2633 Microprocessor & Interfacing
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Fundamentals of Strings and Characters Characters.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
What is an instruction set?
C++ for Engineers and Scientists Third Edition
Introduction to Digital Logic Design
Programmable Logic Controllers
Advanced Instructions Most PLCs now support more advanced functions such as Floating point math, Boolean operations, Shifting, Sequencing, Program control.
Programmable Logic Controllers
Computers Organization & Assembly Language
MOV,MOVM,COP,FLL,BSL,BSR, FRD,TOD
Introduction to PLC Operation
Chapter 7: Arrays. In this chapter, you will learn about: One-dimensional arrays Array initialization Declaring and processing two-dimensional arrays.
Machine Instruction Characteristics
Computer Science 111 Fundamentals of Programming I Number Systems.
1 Programming in Machine Language SCSC 311 Spring 2011.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Lecture Objectives: 1)Define the terms least significant bit and most significant bit. 2)Explain how unsigned integer numbers are represented in memory.
IT253: Computer Organization Lecture 3: Memory and Bit Operations Tonga Institute of Higher Education.
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Arrays.
C++ for Engineers and Scientists Second Edition Chapter 11 Arrays.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Computer Architecture and Organization
Computer Architecture EKT 422
MECH1500 Chapter 3.
C++ for Engineers and Scientists Second Edition Chapter 7 Completing the Basics.
Introduction to PLC Operation
Sequencers SQO,SQC,SQL.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
ECE 2110: Introduction to Digital Systems
Instruction Sets. Instruction set It is a list of all instructions that a processor can execute. It is a list of all instructions that a processor can.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
Do-more Technical Training Instruction Set (String)
Do-more Technical Training Instruction Set (Program-Looping)
Do-more Technical Training Memory Types. (1) Physical I/O (2) System Memory (3) User Memory.
Do-more Technical Training Instruction Set (Analog/Process)
Do-more Technical Training Project Management. Project File Project Saving Project Storage Project Creation Project Editing DMD.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Do-more Technical Training Instruction Set (Program Control)
Do-more Technical Training Instruction Set (Math).
Do-more Technical Training Instruction Set (Analog/Process)
BRX Technical Training
BRX Technical Training
Do-more Technical Training
Do-more Technical Training
Do-more Technical Training
Lec 3: Data Representation
Do-more Technical Training
Assembly Language Programming of 8085
Chap 7. Register Transfers and Datapaths
8086 Microprocessor.
Chapter 10 © 2011, The McGraw-Hill Companies, Inc.
Microcomputer Programming
Do-more Technical Training
Do-more Technical Training
Do-more Technical Training
BRX Technical Training
Chapter 9 Instruction Sets: Characteristics and Functions
Computer Architecture
3.
Presentation transcript:

Do-more Technical Training Instruction Set (Misc/Data Manipulation)

Instruction Set THE BASICS ▫1▫181 instructions CContact (14) CCoil/Bit Output (11) AAnalog/Process (13) DDate/Time/Calendar (7) EEthernet (5) HHardware/Device (9) HHigh Speed/CTRIO (19) MMath (5) MMisc/Data Manipulation (23) PProgram Control (20) PProgram-Looping (8) PProtocol-Custom/ASCII (7) PProtocol-Standard (10) SString (14) TTimer/Counter/Drum (16)

Instruction Set (Misc/Data Manipulation) Misc/Data Manipulation ▫BCDTO ▫DATAINFO ▫DECO ▫ENCO ▫GRAY ▫INIT ▫ISCLEAR ▫MAPIO ▫MEMCLEAR ▫MEMCOPY ▫MOVE ▫MOVEBIT ▫MOVER ▫PUBLISH ▫REFWRITE ▫ROTL ▫ROTR ▫SEG ▫SETNUMR ▫SUBSCRIB ▫SUMBITS ▫SWAPB ▫TOBCD

Instruction Set (Misc/Data Manipulation) BCDTO “BCD To Integer/Real” ▫Converts BCD to integer or real ▫Parameters:  BCD Input – location of BCD value  Output – location of converted value ▫NOTES:  If BCD Input does not contain valid BCD:  $OutOfRange (ST132) = ON  ERR = “Digit greater than 9 in BCDTO…”

Instruction Set (Misc/Data Manipulation) TOBCD “Integer/Real To BCD” ▫Converts integer or real to BCD ▫Parameters:  Input – location of integer or real number  BCD Output – location of converted BCD value ▫NOTES:  Only integer portion of real number is converted  Negative values cannot be converted  BCD Output = 0 (zero)

Instruction Set (Misc/Data Manipulation) DATAINFO “Query Information about Data memory” ▫R▫Reads the size or Schema ID of a Data Block or Heap Item ▫P▫Parameters: MMemory Type: DData Block – a list of all Data Blocks configured IInformation Type: ▫N▫Number of Elements in Block ▫N▫Number of BYTEs in Block ▫N▫Number of BITs in Block ▫D▫Data Type ID (Schema ID) HHeap Item – a list of all Heap Items configured IInformation Type: ▫N▫Number of DWORDs in Heap Item ▫D▫Data Type ID (Schema ID) OOutput – location of read value IInput Leg EEdge triggered PPower flow enabled Schema IDDescriptionSchema IDDescription 1BIT265File 2Unsigned BYTE266Program 3Signed BYTE267Device Reference 4Unsigned WORD 5Signed WORD268CTRIO 6Signed DWORD269CTRIO Counter 7REAL270CTRIO Timer 271CTRIO Pulse Catch 256Timer272CTRIO Pulse 257Counter273CTRIO Discrete 258String274CTRIO Raw 259PID 260Clock275Drum 261Task276Stream 262Peerlink277Server 263RampSoak278Packet 264Reserved279Process Simulator

Instruction Set (Misc/Data Manipulation) DECO “Decode to Set Bit” ▫S▫Sets a bit (ON) at specified bit position & resets all other bits (OFF) ▫P▫Parameters: BBit Position Value – location of bit OOutput Bit Pattern – element containing bit ▫N▫NOTES: IIf Bit Position Value > 31: OOutput Bit Pattern = 0 (zero) $$OutOfRange (ST132) = ON D0 = 0110_0000_0001_0100_0000_0000_0010_1111 “Bit Position Value” = 12 D0 = 0000_0000_0000_0000_0001_0000_0000_0000

Instruction Set (Misc/Data Manipulation) ENCO “Encode Bit Position” ▫L▫Locates the 1 st bit that is ON in memory location ▫P▫Parameters: BBit Pattern – memory location (up to 32 bits) OOutput Bit Position Value – bit position number ▫N▫NOTES: IIf >1 bit is ON, the least significant one is encoded IIf no bits are ON, Output Bit Position Value: SSigned Dword, Signed Word, Real  -1 UUnsigned Word  UUnsigned Byte  255 D0 = 0000_0011_1000_0010_0000_0000_0000_0000 D1 = 0 These bits are ignored D1 = 17

Instruction Set (Misc/Data Manipulation) GRAY “Gray Code to Integer” ▫C▫Converts 16-bit Gray code value to integer ▫P▫Parameters: IInput Value – location to be converted OOutput Value – location of conversion

INIT “Initialize Data” ▫S▫Sets each element to specified value ▫P▫Parameters: SStart – location of 1 st element in range to be initialized EEnd (optional) – location of last element in range to be initialized VValue – initialization value ▫Editing buttons:  OK – saves & closes editor  Cancel – discards changes & closes editor  Insert – inserts empty row before current row  Remove – deletes current row  Move Up – moves current row up  Move Down – moves current row down ▫NOTES:  Can have up to 50 rows

Instruction Set (Misc/Data Manipulation) ISCLEAR “Is Structure Cleared” ▫C▫Checks if all the members of a particular structure are at their initialized values EE.g. Is a string empty? ▫P▫Parameters: SStructure – the structure to check SSet if clear – bit to set ON if structure is clear

MAPIO “Map Inputs/Outputs” ▫I▫Intended to map real-world I/O to elements & vice versa ▫P▫Parameters: SSource – input location DDestination – output location ▫E▫Editing buttons: OOK - saves & closes editor CCancel – discards changes & closes editor IInsert – inserts empty row before current row RRemove – deletes current row MMove Up – moves current row up MMove Down – moves current row down ▫N▫NOTES: TTypically a pair of MAPIO instructions: ((1) Map real-world inputs  memory ((2) Map memory  real-world outputs TTypically use of $tTopOfScan & $tBottomOfScan task code blocks would be used $tTopOfScan $tBottomOfScan

Instruction Set (Misc/Data Manipulation) MEMCLEAR “Clear Memory” ▫C▫Clears a range of memory ▫P▫Parameters: SStart Struct/Numeric – 1 st element in range to be cleared NNumber of Elements – number of elements to be cleared

MEMCOPY “Copy Memory Range” ▫C▫Copies bytes from one range of memory locations to another without regard to the format of the data ▫P▫Parameters: SStart of Source – location of 1 st data byte to be copied SStart of Destination – location of 1 st data byte in destination RRange – five ways to specify the range ((1) End of Source – calculates # of bytes of by last location in source ((2) Number of Source Elements – calculates # of bytes by elements in source ((3) Number of Bytes – specifies # of bytes ((4) Number of Destination Elements – calculates # of bytes by elements in destination ((5) End of Destination – calculates # of bytes by last element in destination ▫N▫NOTES: CCan be used to copy structures

MOVE “Move Value” ▫C▫Copies single source value to a single destination ▫P▫Parameters: SSource – value to be copied (constant or variable) DDestination – location to receive data ▫N▫NOTES: CCopies a structure member, but not entire structures IIf Source & Destination are different types, data conversion is automatically done IIf Source and Destination are different sizes, data may be truncated D0 = 70000V0 = 0V0 = 4464 R0 = 1.234E+08D1 = 0D1 = CT0.Acc = 451V0 = 0V0 = 451

Instruction Set (Misc/Data Manipulation) MOVEBIT “Move Single Bit” ▫C▫Copies single bit state to a single destination ▫P▫Parameters: SSource Bit – bit to be copied DDestination – location to receive state ▫N▫NOTES: CCan copy a bit structure member

MOVER “Move Range of Values” ▫C▫Copies a range of values to a range of destinations ▫P▫Parameters: SStart of Source – location of 1 st value to be copied RRange – defines the extent of the range EEnd of source – end of the source range NNumber of Elements – size of the range SStart of Destination – location of 1 st destination in range ▫N▫NOTES: CCannot copy structures or their members IIf Source & Destination are different types, data conversion is automatically done IIf Source and Destination are different sizes, data may be truncated

PUBLISH “Translate from Do-more” ▫C▫Copies & converts ranges of data from Do-more memory to a data format to be used by external source ▫P▫Parameters: SSource – 1 st location to be translated DDestination – 1 st output location AAs – defines format conversion ## Elements – defines size of range SSwap Byte – check if needed SSwap Word – check if needed ▫E▫Editing buttons: OOK - saves & closes editor CCancel – discards changes & closes editor EEdit – edit the current row IInsert – inserts empty row before current row RRemove – deletes current row MMove Up – moves current row up MMove Down – moves current row down

SUBSCRIB “Translate to Do-more” ▫C▫Copies & converts ranges of data used by an external source to Do-more memory ▫P▫Parameters: SSource – 1 st location to be translated DDestination – 1 st output location AAs – defines format conversion ## Elements – defines size of range SSwap Byte – check if needed SSwap Word – check if needed ▫E▫Editing buttons: OOK - saves & closes editor CCancel – discards changes & closes editor EEdit – edit the current row IInsert – inserts empty row before current row RRemove – deletes current row MMove Up – moves current row up MMove Down – moves current row down

REFWRITE “Write Value Indirectly” ▫Writes value to location by indirect addressing ▫Parameters:  Value – value to be written  Reference Type – memory block type  See in Memory Configuration  For others, see Help file  Reference ID – index number of the memory block

Instruction Set (Misc/Data Manipulation) ROTL “Rotate Left” ▫R▫Rotates bits in location a specified number of bit locations to the left ▫P▫Parameters: IInput/Output – location of bits NNumber of Bits – how many bit locations to shift ▫N▫NOTES: MMost significant bits are looped back to least significant bits D0 = 0100_0000_1000_0010_0000_0000_0000_0000D0 = 1000_0001_0000_0100_0000_0000_0000_0000D0 = 0000_0010_0000_1000_0000_0000_0000_0001D0 = 0000_0100_0001_0000_0000_0000_0000_0010D0 = 0000_1000_0010_0000_0000_0000_0000_0100 # of shifts = 0 # of shifts = 1# of shifts = 2# of shifts = 3# of shifts = 4

Instruction Set (Misc/Data Manipulation) ROTR “Rotate Right” ▫R▫Rotates bits in location a specified number of bit locations to the right ▫P▫Parameters: IInput/Output – location of bits NNumber of Bits – how many bit locations to shift ▫N▫NOTES: LLeast significant bits are looped back to most significant bits D0 = 0000_1000_0010_0000_0000_0000_0000_0100D0 = 0000_0100_0001_0000_0000_0000_0000_0010D0 = 0000_0010_0000_1000_0000_0000_0000_0001D0 = 1000_0001_0000_0100_0000_0000_0000_0000D0 = 0100_0000_1000_0010_0000_0000_0000_0000 # of shifts = 0 # of shifts = 1# of shifts = 2# of shifts = 3# of shifts = 4

Instruction Set (Misc/Data Manipulation) SEG “Hex/BCD to 7 Segment Display” ▫Converts 4-digit hex value to 7-segment display ▫Parameters:  4 Digit Hex/BCD Value – location to be converted  4x8 Bit a-g Output – location of converted value

Instruction Set (Misc/Data Manipulation) SETNUMR “Set Numeric Range” ▫Sets a range of locations to the same value ▫Parameters:  Start – 1 st location of range to be set  End – last location of range to be set  Value – value to be written to range

Instruction Set (Misc/Data Manipulation) SUMBITS “Sum Bits” ▫C▫Counts number of bits in a location that are ON ▫P▫Parameters: IInput Value – location of bits OOutput Sum – value containing number of bits that are ON D0 = 0100_0000_1000_0010_0000_0000_0000_0000 D1 = D1 = 3

Instruction Set (Misc/Data Manipulation) SWAPB “Swap Bytes” ▫S▫Swaps bytes and/or words in a range of locations ▫P▫Parameters: SSource – 1 st location to be converted DDestination – 1 st location of converted value EElements – number of Source locations SSwap Byte – check if needed SSwap Word – check if needed ▫N▫NOTES: SSource & Destination don’t have to be same type