Computer Architecture Lab/WS2007/Project HB Lab1

MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor with a 16-bit address bus and is known as the first CPU (1975) with a 1-step instruction pipeline.

Registers
The next table shows all registers of the 6502:

Status Register Flags
The following table contains all status flags used for arithmetical operations and branch decisions:

Instruction Set
The instruction set is grouped into compare, stack, jump, memory, transfer and arithmetic operations. In total the processor supports 56 instructions. The instructions are of 16 bit width and have different execution times, in the range of 1 to 6 cycles.

The compare instructions set or clear three of the status flags (Carry, Zero, and Negative) that can be tested with branch instructions, without altering the contents of the operand. There are three types of compare instructions, see the next table. The compare instructions subtract (without carry) an immediate value or the contents of a memory location from the addressed register, but do not save the result in the register. The only indications of the results are the states of the three status flags: Negative (N), Zero (Z), and Carry (C). The combination of these three flags indicate whether the register contents are less than, equal to (the same as), or greater than the operand "data" (the immediate value or contents of the addressed memory location.
 * Compare Operations

The processor stack has a 8 bit range and is top down accessed via LIFO principle. The instruction set provides storing and loading of the accumulator and the status register.
 * Stack Operations

The jump instructions push the actual program counter (PC) to the stack and set the PC to a new value. If the jump goes to a interrupt routine, then additionally the status register is pushed to stack, too. The return instructions are then the reversal of the jump instructions.
 * Jump Operations

Memory instructions allow the data exchange between the processors registers (index registers and the accumulator) and external memory. Additionally the content of the data sources is checked if its value is negative or zero and the status register is set, accordingly.
 * Memory Operations

These instructions enables the data exchange between the processors registers and also allows the accessing of particular stack addresses. Additionally the content of the data sources is checked if its value is negative or zero and the status register is set, accordingly.
 * Transfer Operations

For the direct access of the status register.
 * Status Register Operations

The arithmetic instructions set or clear four of the status flags (Carry, Zero, Overflow and Negative). Usually the operants of an instruction is a register and a memory address. Therefore for some of the supported operation the instruction set provides two different instructions, one for the operation on the index register and one for the operation on the accumulator.
 * Arithmetic & Logical Operations

Branch instructions increment (either +1 or +2) the PC as a function of the status register.
 * Branch Operations

Motorola 68000
The Motorola 68000 is a 16-bit Microcontroller running with 8 MHz and CISC instruction set. All internal registers are 32-bit wide, the external address-bus has a 16-bit length, the external data bus 24-bit. The 68k Series was used in high-end computers (also the first Macintosh used a 68k) in the 1980s and later as controllers of numerous systems.

ISA Characteristics
Special about the address registers is the register A7 which is used for the Stack-Pointer. In addition to the 8 data- and 8 address registers the 68000 has a status register with these flags:

The instruction set was defined to enable almost full orthogonality -> addresses may be written in every way for almost all commands. In general, the 68000 shows no special instructions worth mentioning. Arithmetic operations (ADD, SUB, MUL), jump-, interrupt- and register commands are available. Latter supports no direct load/store commands.

ARM
ARM stands for Advanced RISC Machine and is a 32 bit RISC architecture. Its the leading in 32 bit RISC CPUs and is found in nearly all modern mobile electronics. The most recent version is ARMv7M but all the newer versions of ARM include several different ISA for different applications. We will look at the original ARMv5 which has a 32bit instruction set and a 32bit address space.

Registers
These are all the registers of an ARM:

Status Register Flags
The following table contains all status flags used for arithmetical operations and branch decisions:

ISA Characteristics
All instructions have a length of 32 bit and are word aligned. Therefore the PC (r15) bits [1:0] are zero. R14 is also used to store the return address when branching. The instructions are pipelined. Branch instructions can jump up to 24 bit offset. At arithmetic/logic instructions one operant is always a register, the other is either an immediate value or a register value (optionally shifted). There is an additional multiplication instruction that can multiply 32 bit numbers with a 64 bit result. Load and store instructions can be offset addressed, pre-index or post-index addressed. More advanced functions are STM/LDM which block-transfer the GP-registers to or from the memory and SWP which exchanges the values in a register with a memory location. SWP allows atomic update of semaphores.