1 / 12

Low-level Programming Language

Low-level Programming Language. Review on Machine Cycle. Long long time ago …. Each cycle includes four steps: Fetch Decode Execute Store => an instruction is executed (completed)!!. Register (accumulator). register. Instruction. Eg. 1011 1001 0011 0100 0001 0010. One instruction.

badrani
Download Presentation

Low-level Programming Language

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Low-level Programming Language

  2. Review on Machine Cycle Long long time ago… • Each cycle includes four steps: • Fetch • Decode • Execute • Store • => aninstruction is executed (completed)!! Register (accumulator) register

  3. Instruction Eg. 1011 1001 0011 0100 0001 0010 One instruction ~One machine cycle

  4. Levels of programming language High level language(3GL,4GL) Low level language *Assembly language(2GLs) assembler *Machine language(1GLs) CPU

  5. The format of an instruction 1st-generation language-Machine languages Eg. Load a value intoregister 8, taken from thememory cell 68cells after the location listed inregister 3 : [opcode|source|destination| memory address ] 35 3 8 68 decimal 100011 00011 01000 00000 00001 000100 binary Operands Opcode * The format of a instruction : opcode + operand(S)

  6. 1st-generation language-Machine languages The format of an instruction *Opcode : (operation code) -indicate the command (instruction) to be executed ~ NAME OF THE FUNCTION *Operands: -indicate the registers, values or memory addresses used in the function ~PARAMETER

  7. 1st-generation language-Machine languages Features: 1. Understood and executed by a computer at once - binary code =>tedious 2. Each statement represents one instruction => lengthy • * Machine-dependent Platform-dependent (each model of CPU has their own instruction set) Models of CPU (intel) Eg. X86 machine language 1011 1001 0011 0100 0001 0010

  8. 1st-generation language-Assembly language * The format of a instruction also consists : opcode + operand(S) Example : Set CX register to be 1234H Mov CX, 1234H Operands Opcode Opcode : makes use ofmnemonics (~memory aid) -”looks” like the meaning -symbolic and meaningful

  9. Mnemonics For your reference only!

  10. 1st-generation language-Assembly language Features: 1. 1 instruction in assembly language = 1 instruction in machine language => still lengthy • Machine-dependent => not portable 3. Easier to be understand and remember (make use of meaningful codes like mnemonics)

  11. Machine language V.S. Assembly language • Similarities • Lengthy • Machine independent • Low portability • Execute quickly • Difference • 2GLs uses meaningful codes • Easier to remember • Can be written comparatively efficiently • Less errors • 2GLs need to be translated before running

  12. Application?? • Why learning assembly language is still a good idea? • system programs • driver programs • utility programs

More Related