---
# System prepended metadata

title: '[計算機組織筆記 5]'
tags: [計算機組織, assembly]

---

# [計算機組織筆記 5]
###### tags: `計算機組織` `assembly`
*6BR

###  ＊Assembly

* C : 
```
if(i==j) f=g+h;
else f=g-h;
```
* assembly :
```
//$s0 = f
//$s1 = g
//$s2 = h
//$s3 = i
//$s4 = j
//bne = branch not equal
//beq = branch equal
bne $s3, $s4, Else //branch not equal, then jump to Else
add $s0, $s1, $s2
j Exit // j = jump

Else : sub $s0, $s1, $s2
Exit :
```