The Y86 (pronounced "Why Eighty-Six") is a simplified version of the x86 architecture, designed specifically for educational purposes to help students understand processor architecture and instruction set design. It is often used in computer organization courses to teach the concepts behind real-world architectures without the complexity of full-fledged systems like x86 or ARM.
The Y86 architecture is intentionally stripped down to allow for easier understanding, but it still retains many of the core features that make it useful for teaching. It uses a reduced instruction set, simpler memory addressing modes, and fewer registers, compared to modern processor architectures. Let's break down the key components of the Y86 instruction set architecture (ISA) and how it works at the processor level.
The Y86 is a 32-bit processor architecture, and it is based on a RISC (Reduced Instruction Set Computing) design. This means it uses a relatively small set of instructions, with an emphasis on efficient and predictable execution. The architecture supports a set of general-purpose registers, a simple memory model, and an efficient instruction pipeline.
Some of the primary components of the Y86 architecture include:
The Y86 processor has 8 general-purpose registers. These registers are used for storing temporary data, addresses, or computation results during program execution. The registers in Y86 are:
| Register Name | Purpose |
|---|---|
%eax |
Accumulator register (general use) |
%ebx |
Base register (used for address computation) |
%ecx |
Counter register (used in loops) |
%edx |
Data register (used for I/O operations) |
%esi |
Source index (used in string operations) |
%edi |
Destination index (used in string operations) |
%esp |
Stack pointer (points to the current top of the stack) |
%ebp |
Base pointer (used in stack frames for function calls) |
In addition to these general-purpose registers, there are some condition codes that store flags about the outcome of the last operation:
These condition flags are important for making decisions during program execution, especially for conditional jumps.
The Y86 architecture uses a linear memory model, which means that memory is accessed through a flat address space. The processor’s memory is typically modeled as a large contiguous block of memory, and it can be accessed with both direct addresses and offsets (for example, using registers as pointers).
The Y86 instruction set is designed to be much simpler than the x86 instruction set, and it contains a reduced number of instructions. These instructions can be classified into several categories: data movement, arithmetic and logic, control flow, and program control.
irmovl: Immediate to register move.
irmovl $val, %reg$val) into a general-purpose register (%reg).rmmovl: Register to memory move.
rmmovl %reg, mem%reg) into memory at the specified address (mem).mrmovl: Memory to register move.
mrmovl mem, %regmem into the register %reg.addl: Integer addition.
addl %reg1, %reg2%reg1 to the value in register %reg2, storing the result in %reg2.subtl: Integer subtraction.
subtl %reg1, %reg2%reg1 from the value in %reg2, storing the result in %reg2.andl: Bitwise AND.
andl %reg1, %reg2%reg1 and %reg2, storing the result in %reg2.xorl: Bitwise XOR.
xorl %reg1, %reg2%reg1 and %reg2, storing the result in %reg2.jmp: Unconditional jump.
jmp destdest, where execution continues.jle: Jump if less than or equal (conditional jump).
jle destdest if the result of the previous arithmetic operation was less than or equal to zero (checked by the condition codes).je: Jump if equal (conditional jump).
je destdest if the result of the previous operation was zero.call: Call a subroutine (function).
call destdest.ret: Return from subroutine.
rethalt: Program halt.
haltEach Y86 instruction is made up of a single byte that specifies the operation, followed by operands (if any). The instructions are relatively simple compared to more complex instruction sets like x86, which allows for easy understanding and implementation of a processor based on Y86.
For example, the instruction irmovl $7, %eax moves the immediate value 7 into the register %eax. The instruction jmp is an unconditional jump and is followed by the address to jump to.
The Y86 processor fetches instructions from memory, decodes them, and executes them in a pipelined fashion. A simple pipeline architecture is used to process these instructions:
The Y86 instruction set architecture is a simplified educational architecture that helps students understand the basic principles of computer organization and the interaction between hardware and software. It reduces the complexity of real-world architectures while still covering key concepts like registers, memory access, and control flow. By working with Y86, students can focus on understanding the fundamental ideas behind how processors execute instructions, how data flows through the machine, and how various machine-level operations are carried out.
Open this section to load past papers