Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Computer_architecture_project1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lang0909
Computer_architecture_project1
Commits
2e4d0ca3
Commit
2e4d0ca3
authored
5 years ago
by
lang0909
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
ef72181c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+35
-29
35 additions, 29 deletions
README.md
with
35 additions
and
29 deletions
README.md
+
35
−
29
View file @
2e4d0ca3
...
@@ -25,62 +25,68 @@ make test
...
@@ -25,62 +25,68 @@ make test
make clean
make clean
```
```
**직접 object 파일 생성 및 하나씩 test방법**
```
bash
make
./assembler sample_input/?.s //
'?'
에 파일 명 입력
diff
-Naur
sample_input/?.o sample_output/?.o
;
//
'?'
에 파일 명 입력
```
## 기능 설명
## 기능 설명
### Instruction Set
### Instruction Set
-
상세한 instruction 정보는 /handout/MIPS_Green_Sheet.pdf 를 참고한다
-
상세한 instruction 정보는 /handout/MIPS_Green_Sheet.pdf 를 참고한다
-
**Only instructions for
unsi
g
ned operation
s need to be implemented.**
(addu, addiu, subu, sltiu, sltu, sll, srl)
-
unsin
g
ed operation
에 대한 instruction만 구현
(addu, addiu, subu, sltiu, sltu, sll, srl)
-
**However, the immediate fields for certain instructions are sign extended to allow negative numbers**
(addui, beq, bne, lw, sw, sltui)
-
단, 특정 instruction에 대한 immediate 필드는 음수가 혀용되도록 확장된 기호로 표시
(addui, beq, bne, lw, sw, sltui)
-
**Only loads and stores with 4B word need to be implemented.**
-
4Byte의 word 형태로 load와 store 구현
-
**The
assembler
must support decimal and hexadecimal numbers (0x) for the immediate field, and**
*.data*
**section.**
-
assembler
는 immediate 필드에 대해 10진수 및 16진수와 .data 섹션을 지원
-
**The register name is always**
*“$n”*
**n is from 0 to 31.**
-
레지스터의 이름은 "$n" 이고 n은 0~31이다.
-
la
**(load address) is a pseudo instruction; it should be converted to one or two
assembly instruction
s.**
-
la
의 경우 pseudo instruction이고, 하나 또는 두개의
assembly instruction
으로 변환 할 수 있다.
la $2, VAR1: VAR1
is a label in the
data section
la $2, VAR1: VAR1
은
data section
의 주소이다.
-
It should be converted to lui and
ori instruction
s
.
-
la는 lui와
ori instruction
으로 변환된다
.
-
lui $register, upper 16bit address
-
lui $register, upper 16bit address
-
ori $register, lower 16bit address
-
ori $register, lower 16bit address
-
If the
lower 16bit address
is
0x0000
, the
ori instruction
is useless
.
-
만약
lower 16bit address
가
0x0000
이면
ori instruction
은 필요없다
.
-
Case1) load address is 0x1000 0000
-
Case1) load address is 0x1000 0000
-
lui $2, 0x1000
-
lui $2, 0x1000
-
Case2) load address is 0x1000 0004
-
Case2) load address is 0x1000 0004
-
lui $2, 0x1000
-
lui $2, 0x1000
-
ori $2, $2, 0x0004
-
ori $2, $2, 0x0004
###Directives
### Directivites
-
.text
-
.text
-
indicates that following items are stored in the user text segment, typically instructions
-
다음 항목들이 user text 세그먼트에 저장되었음을 나타낸다
-
It always starts from 0x400000
-
항상 0x400000 부터 시작한다.
-
.data
-
.data
-
indicates that following data items are stored in the data segment
-
다음 데이터 항목들이 data 세그먼트에 저장됨을 나타낸다.
-
It always starts from
0x10000000
-
항상
0x10000000
부터 시작한다.
-
.word
-
.word
-
store n 32-bit quantities in successive memory words
-
연속적인 memory words 에 n 32-bit를 저장
-
You can assume that the .data and .text directives appear only once, and the .data must appear
-
그림을 통해 이번 프로젝트에 사용된 메모리 맵을 확인 할 수 있다.
before .text directive. Assume that each word in the data section is initialized (Each word has an
initial value). In the following figure, we illustrate the memory map used in our projects.

### 입력예시
### 입력예시

### 출력예시
### 출력예시
The output of the assembler is an object file. We use a simplified custom format.
**assembler의 output은 object파일이다.**
-
The first two words (32bits) are the size of text section, and data section.
-
처음 두 words는 text section과 data section의 크기이다.
-
The next bytes are the instructions in binary. The length must be equal to the specified text section
-
다음 byte들은 instruction을 binary로 표현한 형태이다. 길이는 지정된 text section의 길이와 같아야한다.
length.
-
text section 이후 나머지 byte는 data section의 초기 값이다.
-
After the text section, the rest of bytes are the initial values of the data section.
The following must be the final binary format:
The following must be the final binary format:
<text
section
size
>

<data
section
size
>
\ No newline at end of file
<instruction
1
>
…
<instruction
n
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment