電腦群組成:實現電腦體繫結構所體現的屬性。包括了硬體細節
電腦體繫結構:電腦程式員所見的電腦系統屬性。包括指令集,儲存定址
例如,指令系統屬於電腦體繫結構,但指令系統的實現(取指令,分析指令,去運算元等)屬於電腦群組成。
區分這兩個概念很重要,嵌入式程式員需要理解電腦體繫結構(例如指令集),也需要理解電腦群組成(例如寄存器個數,用途)。
電腦群組成涉及:匯流排,儲存空間,IO,CPU,控制單元(CU)組件
關於電腦群組成的理論進階,推薦《Fundamentals of Digital logic and microcomputer Design 5 edition》:
1-5章:理論基礎
6-8章:微電腦設計
9-11章:Intel和摩托的微處理器
幾個重要概念
1.Microcode translates machine instructions into sequences of detailed circuit-level operations.
2.Microprogramming is typically used by the microprocessor designer to program the logic performed by the control unit。A microprogram is stored in the control unit.
3. Writing microcode is often called microprogramming
and the microcode in a particular processor implementation is sometimes called a microprogram
.
4.Some hardware vendors, especially IBM
, use the term as a synonym for firmware
, so that all code in a device, whether microcode or machine code
, is termed microcode
5.Machine code or machine language is a system of instructions and data executed directly by a computer's central processing unit.(Machine code 由Microcode實現)
6.An assembly language program is stored in the main memory. The assembly language program is called a macroprogram.
7.A macro instruction
is a line of computer program coding that results in one or more lines of program coding in the target programming language.
8.Machine code is then stored as an executable file (i.e., a ready-to-run program) and can be executed (i.e., run) by the operating system any time it is instructed to do so by another program or by a user.Machine code is extremely difficult for humans to read because it consists merely of patterns of bits (i.e., zeros and ones).(編譯器,連結器,彙編器)
9.如何執行程式:Typically, computer programs are stored in non-volatile memory until requested either directly or indirectly to be executed by the computer user. Upon such a request, the program is loaded into random access memory, by a computer program called an operating system, where it can be accessed directly by the central processor. The central processor then executes ("runs") the program, instruction by instruction, until termination. A program in execution is called a process.[6] Termination is either by normal self-termination or by error — software or hardware error.
總結:整體的層次是,原始碼(例如C++) -> 機器碼 -> 被作業系統調入記憶體 ->CPU執行其中的指令(由microcode實現)。