CS33-6 - SPIM Assembler Memory built on word boundaries All...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-1 SPIM Assembler Memory built on word boundaries All instructions begin on word boundaries Data words require alignment Byte: No restrictions Halfword: Even address Word: Address multiple of 4 DoubleWord:Address multiple of 8
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-2 MIPS Memory Machine Standard Multiple Regions 0x00400000: Text Segment: Program Code 0x10000000: Data Segment: Program Data 0x7FFFFFFC: Stack Segment: Works Down 0x80000000: Kernel Text: Kernel Code 0x90000000: Kernel Data: Kernel Data
Image of page 2
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-3 SPIM Assembler
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-4 SPIM Assembler Characteristics Built in to SPIM Loads directly into SPIM Does not generate object code Uses syscall’s to access I/O library Does not support all hardware details Implements branch instructions differently from hardware
Image of page 4
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-5 SPIM Assembler Capabilities Accepts native MIPS machine instructions Provides data-generation pseudo-ops Provides macro instruction for common operations not in the native opcode set Supports labels but labels must be used as a data word label or as a jump or branch destination
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-6 SPIM Assembler Input Format Comments begin with # anywhere on line Machine instructions use mnemonics Pseudo-ops all begin with a period
Image of page 6
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-7 Machine Instructions Input in source format Label is optional Recognizes register names Examples add $t0,$t1,$t2 here: sra $s5,$t7,10 xori $s3,$a0,1 lw $a0,12($s6)
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-8 Machine Instruction Translation Each field translated separately Instruction word is 32 bits long Fields merged to form binary instruction Final instruction is viewed as hexadecimal Fields not generally visible in hex format
Image of page 8
CS 33: Computer Organization Topic 6: SPIM Assembler 9/2008 John A. Rohr All Rights Reserved JAR 6-9 Machine Translation Example sub $t2,$t0,$t1 • R d = $t2 Register 10 01010 2 • R s = $t0 Register 8 01000 2
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern