freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

cpsc161lecture3-資料下載頁

2024-10-24 17:52本頁面

【導(dǎo)讀】.11999&#169;UCB. CPSC161. Lecture3. Prof..Bhuyan. .21999&#169;UCB. oprsrtrdshamtfunct. oprsrt16bitaddress. op26bitaddress. R. I. J. .31999&#169;UCB. add. add$s1,$s2,$s3$s1=$s2+$s3. Threeoperands;datainregisters. Arithmeticsubtract. sub$s1,$s2,$s3$s1=$s2-$s3. Threeoperands;datainregisters. loadupperimmediate. lui$s1,100. $s1=100*2. branchonequal. beq$s1,$s2,25. if($s1==$s2)goto. PC+4+100. Equaltest;PC-relativebranch. Conditional. branchonnotequal. bne$s1,$s2,25. if($s1!=$s2)goto. PC+4+100. Notequaltest;PC-relative. slt$s1,$s2,$s3. if($s2<$s3)$s1=1;else$s1=0. Comparelessthan;forbeq,bne. setlessthan. immediate. slti$s1,$s2,100. if($s2<100)$s1=1;else$s1=0. Uncondi-jumpregisterjr$ragoto$raForswitch,procedurereturn. R-format. I-format. I-format. <-R-format. <-J-format. <-R-format. <-J-format. .41999&#169;UCB. insteadofr0,r1,…,r31,use. $s0,$s1,…forregisters. $t0,$t1,…forregisters. $s0,$s1,…,$t0,$t1,…,tor0,r1,…(.,intfahr),Assemblyoperands. .51999&#169;UCB. $a0-$a34-7arguments. $t0-$t78-15temporaries. $s0-$s716-23saved. $t8-$t924-25moretemporaries. $gp28globalpointer. $sp29stackpointer. $fp30framepointer. $ra31returnaddress. .61999&#169;UCB. registers

  

【正文】 2, L1 ?beq is “Branch if (registers are) equal” Same meaning as (using C): if (register1==register2) go to L1 176。 Complementary MIPS decision instruction ?bne register1, register2, L1 ?bne is “Branch if (registers are) not equal” Same meaning as (using C): if (register1!=register2) go to L1 176。 Called conditional branches .18 1999169。UCB Compiling C if into MIPS: Summary 176。 Compile by hand if (i == j) f=g+h。 else f=gh。 Mapping f: $s0, g: $s1, h: $s2, i: $s3, j: $s4 beq $s3,s4, True branch i==j sub $s0,$s1,$s2 f=gh(false) j Exit go to Exit True: add $s0,$s1,$s2 f=g+h (true) Exit: 176。 Note: Compiler supplies labels, branches not found in HLL code。 often it flips the condition to branch to false part i == j? f=g+h f=gh (false) i != j (true) i == j C M I P S .19 1999169。UCB Loops in C/Assembly: Summary Loop: g = g + A[i]。 i = i + j。 if (i != h) goto Loop。 (g,h,i,j:$s1,$s2,$s3,$s4 : base of A[]:$s5) Loop: add $t1,$s3,$s3 $t1= 2*i add $t1,$t1,$t1 $t1= 4*i add $t1,$t1,$s5 $t1=addr A lw $t1,0($t1) $t1=A[i] add $s1,$s1,$t1 g=g+A[i] add $s3,$s3,$s4 i=i + j bne $s3,$s2,Loop goto Loop if i!=h C M I P S .20 1999169。UCB Branch Addressing: PCrelative 176。 Conditional Branch: beq $t0,$t1,label ?address just 16 bits (216), program too small! 176。 Option: always add address to a register PC = Register + Branch address ? Change register contents = bigger programs 176。 Which register? ? How use conditional branch? ifelse, loops ? Near current instruction = use PC as reg! ? PCrelative addressing (PC+4) +/ 215 words op rs rt address 6 bits 5 bits 5 bits 16 bits I .21 1999169。UCB Branch Addressing: Jumps, J format 176。 j label go to label ?j has only one operand。 add format ? large address allows large programs ? bright idea: address of instruction always multiple of 4 (instructions always words) = store number of word, save 2 bits ? Example: j exit exit = 10000 ? PC = address * 4 + upper 4 bits of old PC 2 2500 6 bits 26 bits op address J J .22 1999169。UCB Branch Addressing: PCrelative Example Loop: slt $t1,$zero,$a1 t1=9,a1=5 beq $t1,$zero,Exit no=Exit add $t0,$t0,$a0 t0=8,a0=4 subi $a1,$a1,1 a1=5 j Loop goto Loop Exit: add $v0,$t0,$zero v0=2,t0=8 0 5 9 0 42 0 80000 4 9 0 3 80004 8 4 8 0 80008 8 5 5 1 2 20200 8 0 2 0 32 80012 0 32 0 80016 80020 Address 80020 = 80004 + 4 + 3*4 Set t1=1 if $zero $a1
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1