Class Notes (839,579)
Canada (511,408)
CSC258H1 (46)
Lecture

mar18ce.docx

1 Page
89 Views

Department
Computer Science
Course Code
CSC258H1
Professor
Steve Engels

This preview shows half of the first page. Sign up to view the full page of the document.
Description
ASSEMBLY LANGUAGE  MICROPROCESSOR WITHOUT INTERLOCKED PIPELINE STAGES (MIPS)  Intro to Machine Code o Type of REDUCED INSTRUCTION SET COMPUTER (RISC) architecture o Now that we have a processor, operations are performed by: o Provides a set of simple and fast instructions  The instruction register, decoding each instruction according to  Compiler translates instructions into 32-bit instructions for the opcode in the first 6 bits instruction memory  The control unit sending a sequence of signals to the rest of the  Complex instructions (multiplication) are built out of simple processor, according to the opcode value passed in from the ones by the compiler and assembler o Only question remaining: o MIPS is REGISTER-TO-REGISTER  Hwere do these instructions come from?  Every operation operates on data in registers  How are they provided to the instruction memory? o MIPS provides 32 registers, several have secial values  Assembly language  Register 0 ($zero): value 0 o Each processor type has its own language for representing 32-bit  always 0; can’t write into this register, only read instructions as user-level code words  Register 1 ($st): reserved for the assembler o Ex. C = A + B  Store A in $t1, B in $t2, C in $t3  Register 2 – 3 ($v0, $v1): return values  In Assembly Language instruction:  Register 4 – 7 ($a0 – a3): function arguments add $t3, $t1, $t2  Register 8 – 15, 24, 25($t0 – $t9): temporaries  In Machine Code instruction:  Register 16 – 23 ($s0 – $s7): saved temporaries 000000 01001 01010 01011 XXXXX 100000  Register 28 – 31 ($gp, $sp, $fp, $ra): memory and function  Control Unit signals: support  PCWrite = 0 PCWriteCond = 0  $sp is top of the stack, increments to 0  IorD = X  $ra is the return address, the address of a main program  MemRead = 0, MemWrite = 0  when a subroutine complete, $ra is used to return to  MemtoReg = 0 the main program  IRWrite = 0  $fp is the frame pointer  PCSource = X  $gp is the global pointer  ALUOp = 001 (add) o Also three special registers (PC, HI, LO) that are not directly  ALUSrcA = 1, ALUSrcB = 0 accessible  RegWrite = 1, RegDst = 1 (R-type)  HI and LO are used for multiplication and division, and have  Note: most of the time only one write signal is on special instruction for accessing them o Ex. Add 100 to value in PC and store it back into the PC  MIPS Instructions  Operation used by Assembly to jump o Things to note about MIPS instructions  Instruction is addi, the value 100 in instruction[15-0]  Instructions are written as:  ALUSrcB is from Sign Extend, needed b/c the value  Each instruction is written on its own line 100 in instruction[15-0] is 16-bits, need 32-bits  All instructions are 32-bits (4 bytes) long
More Less
Unlock Document

Only half of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit