Sei sulla pagina 1di 3

Instruction set architecture is the structure of a computer that a machine language programmer (or a compiler) must understand to write

a correct (timing independent) program for that machine. Levels of programing language Microcode Microcode Machine-specific code that directs the individual components of a CPUs datapath to perform small-scale operations. CPU: central processing unit of a computer, typically consisting of: Control unit Arithmetic/logical unit (ALU) Registers high-speed memory locations to store temporary results and control information. Foremost among these is the program counter, which points to the next instruction to be executed. The CPU is connected to I/O devices and main memory by parallel channels called buses. Machine code / Assembly Language Machine code instructions still depend on the computer s architecture, but the variation isnt as great; many CPUs manufactured around the same time or by the same company will use the same machine code sets, in fact. Assembly language is a symbolic presentation of machine code so that people (very dedicated people with lots of free time) can read programs written in it. Most assemblers (programs that convert assembly code to machine code) support labelling and macros to make assembly language programming easier. Some recent assemblers support looping control structures, simple data structures and even types! Low-level Programming Language Formerly known as high-level programming languages. Machine code Assembly Language Low-level Programming Language High-level Programming Language

e.g.: FORTRAN, COBOL, BASIC, arguably C These languages have looping constructs, procedures, functions, some typing the trappings of modern programming languages. Big improvement over assembly language. High-level Programming Language e.g.: Java, Python, ML, Prolog, MATLAB, etc. These are very convenient, but also very far removed from the computer they are running on. Type checking Easier to debug You may never even see a memory address. As a result, they typically arent as efficient. They still may not be portable: implementation dependence. Java has had some problems with this. Assembly language instruction A. Instruction Types Arithmetic instruction Data transfer instruction Data Types
Loading 8-bit data directly in WREG Copying data between WREG and data (file) register including I/O ports Copying data from one data (file) register to another data (file) register Clearing or setting all data bits in data (file) register Exchanging low-order four bits (nibble) with high-order four bits in data (file) register

B.

C.

Addressing Modes Immediate addressing is where the data is part of the instruction. Direct addressing is where the address of the data is given in the instruction. Register addressing is where the data is located in a register. Indirect addressing gives the address of the address of the data in the instruction. Register indirect addressing uses a register to store the address of the address of the data Indexed addressing uses a register (implicitly or explicitly) as an offset, which is added to the address in the operand to determine the effective address of the data.

Based addressing is similar except that a base register is used instead of an index register. In stack addressing the operand is assumed to be on top of the stack.

Potrebbero piacerti anche