The document discusses the Y86 processor and instruction set architecture (ISA). It provides background on machine language and assembly language. It describes the key components of the Y86 ISA, including 8 registers, condition codes, program counter, and memory. It also explains the fetch-execute cycle and gives an example of a machine instruction in Y86 assembly language.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
82 views3 pages
116 BSCS 19
The document discusses the Y86 processor and instruction set architecture (ISA). It provides background on machine language and assembly language. It describes the key components of the Y86 ISA, including 8 registers, condition codes, program counter, and memory. It also explains the fetch-execute cycle and gives an example of a machine instruction in Y86 assembly language.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
Name Syed Adnan
Roll NO 116-BSCS-19 Assignment 01
Submitted to Prof Hafeez
The history of Y86 Processors Introduction: The CPU uses machine language to perform all its operations Machine code (pure numbers) is generated by translating each instruction into binary numbers that the CPU uses This process is called "assembling"; conversely, we can take assembled code and disassemble it into (mostly) human readable assembly language Assembly is a much more readable translation of machine language, and it is what we work with if we need to see what the computer is doing There are many different kinds of assembly languages; we'll focus on the Y86/IA32 language as defined in the text and on our system (also SPARC and MIPS) 4 Assembly Operations Perform arithmetic function on register or memory data Transfer data between memory and register Process Load data from memory into register (read) Store register data into memory (write) Transfer control Unconditional jumps to/from procedures (calls) Conditional branches (if, switch, for, while, etc) 5 ISA – Instruction Set Architecture 6 ISA-More explanations ISA – instruction set architecture Format and behavior of a machine level program Defines The processor state (see the CPU fetch-execute cycle) The format of the instructions The effect of each of these instructions on the state Abstractions Instruction executed “in sequence” – Technically defined to be completing one instruction before starting the next – Pipelining – Concurrent execution (but not really) Memory addresses are virtual addresses – Very large byte-addressable array – Address space managed by the OS (virtual physical) – Contains both executable code of the program AND its data » Run-time stack » Block of memory for user (global and heap) 7 Generic Instruction Cycle An instruction cycle is the basic operation cycle of a computer. It is the process by which a computer retrieves a program instruction from its memory, determines what actions the instruction requires, and carries out those actions. This cycle is repeated continuously by the central processing unit (CPU), from bootup to when the computer is shut down. 1. Fetching the instruction 2. Decode the instruction 3. Memory and addressing issues 4. Execute the instruction 8 Hardware abstractions Program Counter (PC)Register %eip (X86) Address in memory of the next instruction to be executed Integer Register File Working: Contains eight named locations for storing 32-bit values Can hold addresses (C pointers) or integer data Have other special duties Floating point registers Condition Code registers Hold status information About arithmetic or logical instruction executed – CF (carry flag) – OF (overflow flag) – SF (sign flag) – ZF (zero flag) Memory 9 Machine instruction example C code Add two signed integers Assembly Add 2 4-byte integers Operands X: register %eax Y: memory M[%ebp+8] T: register %eax Return function value in %eax Object code 3 byte instruction Stored at address: 0x???????? int t = x + y; addl 8(%ebp),%eax 03 45 08 10 Outline Introduction to assembly programing Introduction to Y86 Y86 instructions, encoding and execution 11 Y86: A Simpler Instruction Set IA32 has a lot more instructions IA32 has a lot of quirks Y86 is a subset of IA32 instructions Y86 has a simpler encoding scheme than IA32 Y86 is easier to reason about hardware first-time programming in assembly language 12 Y86 abstractions The Y86 has 8 32-bit registers with the same names as the IA32 32-bit registers 3 condition codes: ZF, SF, OF no carry flag interprets integers as signed a program counter (PC) a program status byte: AOK, HLT, ADR, INS memory: up to 4 GB to hold program and data The Y86 does not have floating point registers or instructions http://voices.yahoo.com/the-y86-processor-simulator-770435.html?cat=15 http://y86tutoring.wordpress.com/ 13 Y86 Memory and Stack Y86 Code Y86 Stack low address high address 1. A huge array of bytes; 2. Set the bottom of the stack far enough away from the code; 3. The location of your code should always start from 0x0. How to set up the starting point of stack and code? directive: .pos address-in-hex 14 yis and yas and the Y86 Simulator check on how to set up $PATH how to connect Linux with X display add the following variables as original value/new value pairs % ssim -g prog.yo & graphical simulator SimGuide: CC Z=1 S=0 O=0 Changes to registers: %eax: 0x00000000 0x0000001c %ecx: 0x00000000 0x0000006f %edx: 0x00000000 0x00000037 %ebx: 0x00000000 0x00000037 Changes to memory: y86prog1.ys 0x0020: 0x00000084 0x00000037 17 Y86 Simulator program code 18 Y86 Simulator displays contents of memory processor state fetch-execute loop register file status condition codes 19 Y86 Notes Y86 is an assembly language instruction set Simpler than but similar to IA32 but not as compact (as we will see) Y86 features 8 32-bit registers with the same names as the IA32 32-bit registers 3 condition codes: ZF, SF, OF no carry flag - interpret integers as signed a program counter (PC) holds the address of the instruction currently being executed a program status byte: AOK, HLT, ADR, INS state of program execution memory: up to 4 GB to hold program and data 20 Y86 Notes Y86 features 8 32-bit registers with the same names as the IA32 32-bit register different names from those in text, such as %rax, which are 64-bit F indicates no register 3 condition codes: ZF, SF, OF a program counter (PC) a program status byte: AOK, HLT, ADR, INS memory: up to 4 GB to hold program and data %eax %ecx %edx %ebx %esi %edi %esp %ebp RF: Program registers ZF SF OF CC: Condition codes PC DMEM: M