- 노션 정리 노트
고급 언어와 저급 언어
- 고급언어: 사람을 위한 어너이다. 우리가 흔하게 쓰는 C, C++ Java같은 언어를 의미한다.
- 저급언어: 컴퓨터가 이해하고 실행할 수 있는 언어이다.
Assembly Language의 경우, 고급 언어를 컴퓨터가 이해할 수 있는 기계어로 변경하기 위한 언어이다. 사람이 작성한 코드는 Assembly로 변경되고 이를 컴퓨터가 이해하고 받아들이는 것이다.
고급 언어가 저급 언어로 변경될 때, 컴파일 방식과 인터프리터 방식이 있다.
- Compile
- 소스코드 전체가 저급언어로 변경된다.
- 변경되는 과정을 compile이라고 하며 이를 수행하는 도구가 compiler이다. 이렇게 변환된 코드를 Object Code라고 한다.
- Interpreter
- 대표적으로 python이 interpreter 방식이다.
- compile과 달리 코드를 한 줄씩 차례로 변경하고 실행한다.
- 코드에 오류가 있어도, 오류 코드 위까지는 제대로 실행이 된다.
- Compile에 비해 빠르다고는 볼 수 없다.
명령어 구조
명령어는 연산코드와 operand로 구성되어 있다. MIPS의 자세한 내용은 Notion을 참고할 것.
Operand
연산에 사용되는 데이터를 저장한 위치를 나타내는 경우가 많다. 숫자, 문자, 이를 나타내는 데이터, 혹은 주소값이 들어갈 수 있다. Operand는 없을 수 있고 하나, 둘 그리고 세 개 등 여러 개 존재할 수 있다.
연산코드
데이터 전송, 산술,논리 연산, 제어 흐름 변경, 입출력 제어로 나눌 수 있다.
주소 지정 방식
Operand에 메모리나 register 주소를 담는 경우가 많다. 이는 명렁어의 길이 때문이다. 메모리 주소를 담는다면 메모리 주소에 저장할 수있는 공간 만큼 커지게 된다.
- 즉시 주소 지정 방식: 사용할 데이터를 operand에 직접 명시
- 직접 주소 지정 방식: 유효 주소를 명시
- 간접 주소 지정 방식: 유효 주소의 주소를 명시
- register주소 지정 방식: register를 명시
- register 간접 주소 지정 방식: 사용할 데이터를 메모리에 저장하고 주소를 저장한 register를 명시
'CSEE Study > Computer Architecture' 카테고리의 다른 글
1. Computer Abstractions and Technology (0) | 2023.03.01 |
---|