---
# System prepended metadata

title: 系統程式第一章
tags: [學業共筆]

---

推薦的系統程式筆記
> https://hackmd.io/@tsanyue/BJTvX0Tft

## SIC

### Instruction formats
* 8 bit opcode
* 1 bit index register

![](https://hackmd.io/_uploads/Sy2gMwDz6.png)

### addressing modes

**當使用類似陣列結構時，使用Index Addressing mode**

![](https://hackmd.io/_uploads/BkW9AYwzp.png)

### Data Type
* Bytes 8 bits
* WORD 24 bits

## SIC/XE

### Instruction formats

![](https://hackmd.io/_uploads/Bymnl9Pz6.png)

### Directing addressing modes
* immediate addressing
* indirect addressing
* simple addressing

![](https://hackmd.io/_uploads/rkmax5vM6.png)


**immediate addressing**

**indirect addressing**

**simple addressing**

### Relative addressing modes
![](https://hackmd.io/_uploads/HJ_qQ9uMT.png)


## CISC && RISC比較

**CISC：Complex Instruction Set Computers machine**

* 相對較大且較複雜的指令集
* <a style="color:orange;">有不同的指令集formats和長度</a>
* 很多不同的定址模式(Addressing mode)

**RISC: Reduced Instruction Set Computers machine**

* <a style="color:orange;">Standard, fixed instruction length</a>
* Memory access is usually done by **load** and **store** instructions only. 
    - <a style="color:orange;">Only register-to-register operations</a>
* Single-cycle execution of most instructions
* 相對較多數的 general-purpose registers
* 相對較少的machine instructions、指令集formats和定址模式

## CISC類型

### VAX architecture
**VAX architecture特色**
* variable-length bit Instructions(不同指令長度)
* operations aligned(指令對齊)
* Virtual address space切割
* Packed decimal format & Numeric format

**variable-length bit Instructions**
每個指令的長度會根據使用的OPcode和operand的數量而有所不同。
**operations aligned**

藉由將不同長度的引數(operand)和位址(address)組合，讓每個指令長度盡量保持一致，以提升效率

**Virtual address space**
* system space(系統)
    - 將一半的記憶體空間拿來儲存系統(os)，並且為所有應用程式共用
* process space(程序)
    - 剩下一半的記憶體空間，會幫每個應用程式先定義好使用空間

**Packed decimal format & Numeric format**
* Packed decimal format
    - 使用一個Byte來表達10進制的**兩位數**(BCD編碼)
* Numeric format
    - 使用一個Byte來表達10進制的**一位數**(效率較高)

### x86 architecture

**x86 architecture特色**
* 16-bit segment registers
* little-endian
* 

**Target adress**

TA = ()

### USPARC 

<a style="color:orange;">**pipeline(必考)**</a>
* 大工作切成小工作
* fetch_and_decode
