Presentation is loading. Please wait.

Presentation is loading. Please wait.

What are the contents of $s0 after running this instruction?

Similar presentations


Presentation on theme: "What are the contents of $s0 after running this instruction?"— Presentation transcript:

1

2 What are the contents of $s0 after running this instruction?
addi $s0,$zero,0xF00D 0xFFFFF00D 0x1111F00D 0x0000F00D 0xF00D0000 None of the above A. Sign extension!

3 how can we load the lower 16 bits? addi $s0,$s0,0xBEEF
Suppose we want to load 0xDEADBEEF into $s0. After we load the upper 16 bits with lui $s0,0xDEAD how can we load the lower 16 bits? addi $s0,$s0,0xBEEF andi $s0,$s0,0xBEEF ori $s0,$s0,0xBEEF Any of the above None of the above Sign extension for addition: Consider whether lower 16 bits lead with a 1 or a 0 [Slide: Janet Davis]

4 Addresses between 0 and 64K-1 Addresses between 0 and 256K-1
I-type Instruction Format: What is the range of addresses for conditional branches in MIPS? (K = 210 = 1024) Addresses between 0 and 64K-1 Addresses between 0 and 256K-1 Addresses up to about 32K before the branch to about 32K after Addresses up to about 128K before the branch to about 128K after None of the above Question: [PH 2.10 Self-Check 1, p. 136] Figure: [PH p. 97]

5 [PH Fig. 2.18, p. 133]

6 Addresses between 0 and 256M-1
J-type Instruction Format: op address What is the range of addresses for j and jal in MIPS? (M = 220 = 1024K) Anywhere within a block of 64M addresses where the PC supplies the upper 6 bits. Anywhere within a block of 256M addresses where the PC supplies the upper 4 bits. Addresses between 0 and 256M-1 Addresses up to about 128M before the jump to about 128M after None of the above Question: [PH 2.10 Self-Check 2, p. 136] Figure: [PH p. 97]

7 [PH Fig. 2.18, p. 133]

8 Exercises 2.25.2(a,b) 2.25.3(a,b) 2.26.1(a,b) 2.26.2(a,b)


Download ppt "What are the contents of $s0 after running this instruction?"

Similar presentations


Ads by Google