Presentation is loading. Please wait.

Presentation is loading. Please wait.

PCSpim Introduction. Register contentProgramMemory contentMessage.

Similar presentations


Presentation on theme: "PCSpim Introduction. Register contentProgramMemory contentMessage."— Presentation transcript:

1 PCSpim Introduction

2 Register contentProgramMemory contentMessage

3 Register Content

4 PC = EPC = Cause = BadVAddr= Status = 3000ff10 HI = LO = General Registers R0 (r0) = R8 (t0) = R16 (s0) = R24 (t8) = R1 (at) = R9 (t1) = R17 (s1) = R25 (t9) = R2 (v0) = R10 (t2) = R18 (s2) = R26 (k0) = R3 (v1) = R11 (t3) = R19 (s3) = R27 (k1) = R4 (a0) = R12 (t4) = R20 (s4) = R28 (gp) = R5 (a1) = R13 (t5) = R21 (s5) = R29 (sp) = 7fffeffc R6 (a2) = R14 (t6) = R22 (s6) = R30 (s8) = R7 (a3) = R15 (t7) = R23 (s7) = R31 (ra) = FIR = FCSR = FCCR = FEXR = FENR = Double Floating Point Registers FP0 = FP8 = FP16 = FP24 = FP2 = FP10 = FP18 = FP26 = FP4 = FP12 = FP20 = FP28 = FP6 = FP14 = FP22 = FP30 = Single Floating Point Registers FP0 = FP8 = FP16 = FP24 = FP1 = FP9 = FP17 = FP25 = FP2 = FP10 = FP18 = FP26 = FP3 = FP11 = FP19 = FP27 = FP4 = FP12 = FP20 = FP28 = FP5 = FP13 = FP21 = FP29 = FP6 = FP14 = FP22 = FP30 = FP7 = FP15 = FP23 = FP31 =

5 Program

6 [0x ]0x8fa40000 lw $4, 0($29) ; 175: lw $a0 0($sp) # argc [0x ]0x27a50004 addiu $5, $29, 4 ; 176: addiu $a1 $sp 4 # argv [0x ]0x24a60004 addiu $6, $5, 4 ; 177: addiu $a2 $a1 4 # envp [0x c]0x sll $2, $4, 2 ; 178: sll $v0 $a0 2 [0x ]0x00c23021 addu $6, $6, $2 ; 179: addu $a2 $a2 $v0 [0x ]0x0c jal 0x [main] ; 180: jal main [0x ]0x nop ; 181: nop [0x c]0x a ori $2, $0, 10 ; 183: li $v0 10 [0x ]0x c syscall ; 184: syscall# syscall(exit) KERNEL [0x ]0x0001d821 addu $27, $0, $1 ; 82: move $k1 $at [0x ]0x3c lui $1, ; 84: sw $v0 s1 [0x c]0x3c lui $1, ; 85: sw $a0 s2 [0x ]0xac sw $4, 516($1) [0x ]0x401a6800 mfc0 $26, $13 ; 87: mfc0 $k0 $13 [0x ]0x001a2082 srl $4, $26, 2 ; 88: srl $a0 $k0 2 [0x c]0x f andi $4, $4, 31 ; 89: andi $a0 $a0 0x1f [0x800001a0]0x ori $2, $0, 4 ; 93: li $v0 4# print_str [0x800001a4]0x3c lui $4, [__m1_]; 94: la $a0 __m1_ [0x800001a8]0x c syscall ; 95: syscall [0x800001ac]0x ori $2, $0, 1 ; 97: li $v0 1# print_int [0x800001b0]0x001a2082 srl $4, $26, 2 ; 98: srl $a0 $k0 2 [0x800001b4]0x f andi $4, $4, 31 ; 99: andi $a0 $a0 0x1f [0x800001b8]0x c syscall ; 100: syscall [0x800001bc]0x ori $2, $0, 4 ; 102: li $v0 4# print_str [0x800001c0]0x c andi $4, $26, 60 ; 103: andi $a0 $k0 0x3c [0x800001c4]0x3c lui $1, ; 104: lw $a0 __excp($a0) [0x800001c8]0x addu $1, $1, $4... addressmachine code Assembly code comment

7 Memory

8 DATA [0x ]...[0x ]0x STACK [0x7fffeffc] 0x KERNEL DATA [0x ] 0x x x206e6f69 0x636f2000 [0x ] 0x x x e 0x726f6e67 [0x ] 0x000a6465 0x495b2020 0x e 0x [0x ] 0x d 0x4c545b20 0x20005d42 0x4c545b20 [0x ] 0x20005d42 0x4c545b20 0x20005d42 0x64415b20 [0x ] 0x x x20726f72 0x69206e69 [0x ] 0x2f74736e 0x x x205d6863 [0x ] 0x5b x x x6f address content

9

10

11


Download ppt "PCSpim Introduction. Register contentProgramMemory contentMessage."

Similar presentations


Ads by Google