Principles of Computer Organization (c)

Computer program and classification

Computer program

Interaction between programmers and computer hardware language

A computer program classification

  • High-level language
  • Assembly language
  • Machine language

Program Example

//c语言程序
int main()
{
	int fibo[10];
	int i;
	fibo[0]=1;
	fifo[1]=1;
	for(i=2;i<10;i++)
		fibo[i]=fifo[i-1]+fibo[i-2];
}
//机器语言
6901:0110100100000001
6a01:0110101000000001
6b80
3360
6c09
db20
db41
e145
e149
4b02
//汇编语言
LI R1 1
LI R2 1
LI R3 80
SLL R3 R3 0
LI R4 9
SW R3 R1 0
SW R3 R2 1
ADDU R1 R2 R1
ADDU R1 R2 R2
ADDIU R3 2
ADDIU R4 FF
BNEZ R4 F9

High-level language

High-level language, also known as algorithmic language, it's the realization of ideas, not too much "closer" instruction set computer hardware, but rather focus on algorithms for solving practical problems used, the aim is to make programmers to easily write deal and procedures for problem-solving process, and strive to make the program more efficient design.
The most commonly used high-level language has many kinds of BASIC, PASCAL, C, C ++ , JAVA, PROLOG , etc., these language designed the program, need to go through the compiler first translated into machine language program to be executed on the hardware system of the computer, individual choice of interpreted programs.

Assembly language and machine language

Assembly language is the result of computer processing machine language symbol, and then add some easy programming and implementation extensions. In assembly language English words or abbreviations may be used in place of the binary instruction code, easier to remember and understand; not selection of English words to represent data (constants, variables, and statement label) program, so that programmers need not personally the data distribution storage unit, but is left to the assembler, meeting the basic criteria are available.
On this basis, if higher, it is possible (e.g., circular structure and is repeatedly executed, the subroutine argument is replaced with dummy true parameter) to provide the necessary support in terms of different structural characteristics to support the program, so that the assembly language utility.
Only after running the assembler to be translated into machine language through assembler.

Machine language is a set of instructions can directly identify the computer hardware and operation, the instruction is composed of a binary code, machine language program basic design feasible.

Here Insert Picture Description

Von Neumann architecture computer

  • Stored program computer
    program instructions is constituted by
    a program instruction sequences described by a functional
    sequence of sequences of instructions stored in memory
  • Instruction execution order
  •      用PC指示当前被执行的指令
    
  •      从存储器中读出指令执行
    
  •      PC指向下一条指令
    
He published 185 original articles · won praise 18 · views 160 000 +

Guess you like

Origin blog.csdn.net/pk_20140716/article/details/104617045