Instruction Set Architecture Stephen Murphy What is ISA? Aspects of the computer visible to the programmer: Data Types Registers Instructions Addressing Data Types Unsigned Integers Signed Integers Characters Floating-point Numbers Unsigned Integers Stores the integer in standard binary format 00101011 = 1 + 2 + 8 + 32 = 43 Signed Integers Stores the integer in two’s complement format to denote sign Steps to convert signed integer to base 10: Store leading bit, 1 = negative, 0 = positive Invert all bits Add 1 Characters Represented by integer values Many different character encodings exist: ASCII UNICODE UTF-8 UTF-16 Floating-point Numbers Four components in a floating-point number: Sign Mantissa Radix Exponent Registers Registers provide a variety of services: Instruction Counter Register-to-Register Operations Memory-to-Register Operations Memory-to-Memory Operations Processor Status Instruction Counter Register All von Neumann machines have an instruction counter which is a register Register-to-Register Registers Operate on one register using another register (ADD) Supported by all ISA’s Memory-to-Register Registers Operate on memory using a register (LOAD, STORE) Not supported by all ISA’s Memory-to-Memory Registers Operate on one memory location using another memory location (STRCMP) Not supported by all ISA’s Processor Status Registers A collection of registers that indicate the current state of the processor (Carry, Interrupt, Zero) Different ISA’s use different status registers Instructions Categories of instructions: Operate Memory Access Control Miscellaneous Operate Instructions Typical operations include: Arithmetic (ADD, SUB, MUL, DIV) Logical (AND, OR, NOT, XOR) Shift (ROL, ROR) Character (STRCMP) Stack (PUSH, POP) Memory Access Instructions Typical operations include: Load (LODSB) Store (STOSB) Control Instructions Conditional Branch (JZ, JC, JO, JS) Unconditional Branch (JMP) Miscellaneous Instructions Input/Output (IN, OUT) Interrupts (CLI, INT, IRET) Halt Privileged Addressing Register Addressing Memory Addressing Register Addressing When an operand is taken from a register it is called register addressing Memory Addressing Logical Address Space (sequential memory locations) Physical Address Space (many types exists: absolute addressing, indirect addressing, etc.) ISA Examples MIPS Motorola 6800 ARM SPARC PowerPC x86 IA-64 ISA Humor BOB – Branch On Bug ADN – Add Nauseam BPDI – Be Polite, Don’t Interrupt BPE – Bypass Program Error DMNS – Do what I Mean, Not what I Say DC – Divide and Conquer CDHI – Crash Disk Head Immediately References http://webster.cs.ucr.edu/AoA/Windows/HT ML/ISA.html http://www.wordiq.com/definition/Instructio n_set http://www.cs.panam.edu/~meng/Course/ CS4335/Notes/master/node22.html