Computer Architecture Lab/Winter2006/HoeftPirkWeir/InstructionSetI

< Computer Architecture Lab < Winter2006 < HoeftPirkWeir

ARM

32-bit RISC Prozessor, der sich vor allem durch gute Energieeffizienz auszeichnet, weswegen er in einer Vielzahl von Embedded Systems seinen Einsatz findet.

Instruction Set

Im normalen Modus ist eine Instruktion 32-bit lang, es gibt aber auch den Thumb Modus der einen reduzierten 16-bit Befehlssatz aufweist. Es wird hier nur auf den 32-bit Basisbefehlssatz eingegangen.

Register

Es gibt 15 General-Purpose Register, von denen 2 als Stack bzw. Rückkehradressen genützt werden. Zur effizienteren Interrupt-Behandlung sind diese 2 Register für jeden Prozessormodus ein Mal vorhanden.

Bedingte Ausführung

Jede Instruction beinhaltet 4 Bit, die eine Ausführung abhängig vom "Program Status Register" erlauben.

Branches

Relative Sprünge um bis zu 32MB als auch absolute Sprünge zu einer Adresse in einem Register sind möglich. Es gibt auch jeweils eine Version bei der der aktualle PC ins Rückkehradressenregister geladen wird.

Datenmanipulation

Unterstützte Operationen sind logisches UND, (exklusives) ODER, Subtraktion (mit Carry), Addition (mit Carry), Invertierung.

Ein Eingangswert kommt aus dem Shifter, der geshiftete oder rotierte 8-bit immediate Werte oder Registerwerte zur Verfügung stellt. Die Anzahl der geshifteten Bits ist entweder ein direkter 5-bit Wert oder ein Registerwert. Der 2. Eingangswert (sofern vorhanden) ist immer ein Register. Das Ergebnis wird in einem Register abgelegt, für UND, exklusives ODER, Subtraktion und Addition gibt es eine Version, die nur das PSR dem Ergebnis entsprechend anpasst.

Weiters gibt es Multiply und Multiply-Accumulate Befehle, mit Varianten die 32-bit, 64-bit vorzeichenlose, 64-bit vorzeichenbehaftete Ergebnisse liefern.

Speicherzugriff

Die Adressierung erfolgt durch ein Basisregister und einen Offset. Der Offset kann ein direkter 12-bit Wert, ein Register oder ein geshiftetes Register sein. Weiters kann das Basisregister nach Zugriff durch den Wert von Basisregister+Offset ersetzt werden, um einfach über Speicherblöcke iterieren zu können. Es gibt außerdem Befehle die mehrere Worte auf einmal in beliebige Register laden/speichern.

Andere Befehle

Der Befehl SWP erlaubt Laden und Speichern eines Wertes im Speicher innerhalb einer Instruktion, wodurch Prozesse leichter synchronisiert werden können. Der Software Interrupt Befehl dient dem Zugriff von User Mode Programmen auf Priviledged Code. Ein Breakpoint Befehl ist ebenfalls vorhanden.

PowerPC 405

PowerPC 405 is a 32-bit implementation of the PowerPC embedded-environment architecutre providing up to 400 MHz and 608 DMIPS performance.

Key Features

Important Registers

General Purpose Registers

32 GPRs (r0~r31) are the source and destination of all integer operations and are the source for address operands for all load/store operations. They also provide access to SPRs.

Floating Point Registers

FPRs here refer to FPRs and Floating-Point Status and Control Register (FPSCR). 32 FPRs (FPR0 - FPR31) are the source and destination operands of all floating-point operations and can contain 32-bit and 64-bit signed and unsigned integer values, as well as single and double-precision floating-point values. They also provide access to the FPSCR.

The FPSCR captures status and exceptions resulting from floating-point operations, and the FPSCR also provides control bits for enabling specific exception types, as well as for selecting one of the four rounding modes. Access to the FPSCR is through the FPRs.

Embedded microprocessors are frequently implemented without direct hardware support for the PPC floating-point instruction set, or only provide an interface to attach floating-point hardware. Many applications have little or no need for floating-point arithmetic, and software emulation of PPC floating-point instruction execution is usually more than adequate. The chip area and power savings of not implementing floating-point in hardware can be critical.

Special Purpose Registers

SPRs give status and control of resources within the processor core.

Any CR field can be the target of an integer or floating-point comparison instruction. The CR field 0 is also set to reflect the result of a conditional store instruction (stwcx or stdcx). Certain instructions can manipulate the CR.

Instruction Set

The POWER architecture has over two hundred defined instructions. Most instructions execute in a single cycle and typically perform a single operation (such as loading storage to a register, or storing a register to memory). Similar to most of the other 32-bit RISC ISAs, all PPC instructions are four bytes long and are word aligned. Bits 0:5 contain the primary opcode. Some instruction forms define an extended opcode field for specifying additional instructions.

Four Primary Formats

Op6 Rd5 Rs15 Rs25 Opx11
Op6 Rd5 Rs15 Const16
Op6 Opx5 Rs15 Const14 Opx2
Op6 Const24 Opx2

Instruction Examples

Integer arithmetic instructions
Logical, rotate, and shift instructions
Floating-point and FPSCR manipulation instructions
Branch instructions

Uniqueness

References

A developer's guide to the POWER architecture, 03/2004
IBM Product Overview - PowerPC 405 CPU Core, 09/2006
PowerPC Processor Reference Guide, 09/2003
CA:QA, 2nd Edition, J. Jennessy & D. Patterson

PICmicro

Is a family of microcontrollers made by Microchip Technology with a reduced instruction set (RISC). It is also known as simply PIC microcontrollers.

Features

PICmicro MID-RANGE MCU FAMILY

Each midrange instruction is a 14-bit word divided into an OPCODE which specifies the instruction type and one or more operands which further specify the operation of the instruction. There are three basic categories:

All instructions are executed in one single instruction cycle, unless a conditional test is true or the program counter is changed as a result of an instruction.In these cases, the execution takes two instruction cycles with the second cycle executed as an NOP. Thus, for an oscillator frequency of 4 MHz, the normal instruction execution time is 1 us. If a conditional test is true or the program counter is changed as a result of an instruction, the instruction execution time is 2 us.

General instruction format

The possible formats for the instructions are listet in the figure.

the opcode portion of the instruction word varies from 3-bits to 6-bits of information. This is what allows the midrange instruction set to have 35 instructions.

Register manipulation

instruction set allows read and write of all file registers, including special function registers. If an instruction writes to the STATUS register, the Z, C, DC and OV bits may be set or cleared as a result of the instruction and overwrite the original data bits written. All bit manipulation instructions will first read the entire register, operate on the selected bit and then write the result back (read-modify-write (R-M-W)) the specified register.

Supported instructions

There are several groups of instrucions. Those can be divided into:

Example: Mnemonic: movf fr, d Description: Move file register Function: fr => d

Example: oprwf fr,d Mnemonic: logic / arithmetic operation with a file register and W Description: Function: fr opr W => d

Example: Mnemonic: oprlw k Description: logic / arimetic operation with a literal and W Function: k opr W => W

Example: Mnemonic: clrw Description: Clear accumulator W Function: 0 => W

Example: Mnemonic: goto addr Description: branch to addr Function: addr => PC(0:10)

Example: Mnemonic: addcf fr, d Description: Add carry to fr Function: btfsc 3,0 incf f,d


References

This article is issued from Wikiversity - version of the Saturday, August 16, 2014. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.