See MIPS Run, Second Edition (The Morgan Kaufmann Series in Computer Architecture and Design)

Author: Dominic Sweetman
5.0
All Stack Overflow 10

Comments

by anonymous   2017-08-20

You need to refer to a label in the data section in the lui and ori instructions. The following works for gnu assembler (as):

    .data
    Array:
    .space 80             #Declares that Array will hold 20 integers
...
.text
    lui $s0, %hi(Array)
    ori $s0, %lo(Array)
    lw  $s1, 0($s0)       # load 1st word of Array
...

The %hi and %lo directives tell the linker what is going on, so that it can put the address of the label "Array" in the machine code. (NOTE: this likely doesn't work for SPIM or MARS.)

See this question.

See MIPS Run is the canonical book on MIPS CPUs. This book explains the MIPS instruction set, CPU architecture and how they relate to MIPS Linux.

by anonymous   2017-08-20

The PTE base address can be read from the MIPS CP0 Context register (#4).

See chapter 16 of See MIPS Run: Low-level Memory Management and the TLB.

by anonymous   2017-08-20

If you want to understand MIPS assembler you should get a copy of See MIPS Run. This book assumes you have a reasonable knowledge of the C language. If you are not familiar with C, there are many books available. Programming in C by Stephen G. Kochan is the first useful looking on I found on Amazon, though I've never read it.

(You might find learning Python to be a bit of a side-track if your goal is to understand how a particular game works.)