Karteikarten
FMJC.C2
Karten in diesem Stapel (30)
- 1What is source code?A program written in a high level language
....by the user
Easy for people to understand
Cannot run until it has been translated by a translator
(Compiler/Interpreter/Assembler)
to OBJECT CODE - 2What is object code?Low level/machine code/binary code
...used by the computer
Produced by the translator - 3What is executable code?A complete program
...that the computer can run with the need of the translator
...in machine code - 4What is intermediate code?Code that has been translated
usually by a compiler
...into code that needs to be further translated (interpreted) before it can run
Can be compiled to .exe
Can be interpreted for VirtualMachine - 5What does the linker do?Combines modules/library modules
..that are already compiled into object code - 6What does the loader do?Copies the modules into memory
...from backing store
..ready for execution
Completes address links to the program - 7Explain main purpose of a translatorConvert source code into object code
Convert HLL to LLL
Detect errors in the code - 8Explain why intermediate code can be more useful than executable code?Can run on a variety of machines
Sam intermediate code can be obtained from different HLL
Improves portability - 9What additional software needed for Intermediate code?Virtual Machine
- 10One disadvantage of Intermediate codeProgram runs more slowly
...has to be translated each time its run
...needs additional software - 11Software used to convert source code to object codetranslator
- 12Explain the term source codeOriginal/ code written by programmer
..often in high level language
May be in assembly language
Source code can be understood by people
..but cannot be executed until
translated into OBJECT CODE - 13Explain two advantages of using intermediate codecan be used on any variety of machine
code has been pre-compiled
and so ERROR FREE - 14Meaning of virtual machine and how intermediate code is run on itVirtual machine is a generalised computer
The code is run using an interpreter to make the code computer-specific - 15Describe differences between machine code and assembly languageMachine code written in binary
Assembly language written in:
Plain text using mnemonics
Machine code - no translation needed
Assembly Lang - needs assembler
Machine code hard to write
AL is easy than MC but harder than HLL - 16Describe the term assembly languageLanguage related closely to computer
Uses descriptive names
Uses mnemonics
Uses labels to allow selection
Each instruction is translated as one machine code instruction
May use macros - 17Describe the term machine codeBinary notation
Set of all instructions available
...for the architecture
Instructions operate on bytes of data - 18Tasks performed by the assemblerTranslates program from assembly language to machine code
mnemonics opcodes to machine code
Reserves space for instructions and data
symbolic addresses 2 numeric addresses
Creates symbol table 2 match labels
Checks syntax/offers diagnostics 4 errors - 19Describe one feature of an interpreterTranslates one line, runs it then next line
Reports one error at a time
...then stops - 20State two features of a compilerTranslates whole program as a unit
Creates an executable program/intermediate program
May report many errors at the same time
Optimisation - 21Explain intermediate code and its useSimplified code/ partially translated code
...which can be run on any computer/VM
improves portability
Different HLL create same
intermediate code
Runs more slowly than executable code - 22Describe what happens in the lexical analysis stageSource code used as input
Tokens are created from individual symbols and from the reserved words
Token - fixed length of binary digits
Variable names loaded into lookup table
Redundant characters removed
Comments removed, Error Help given
Prep code for syntax analysis - 23Describe what happens during syntax analysisAccepts output from lexical analysis
Tokens and statements are checked against the rules of the language
Error as a list is reported at end
Diagnostics must be given
No errors? -Code Generation
Further detail added to symbol table
...data type/scope/address - 24Give two stages of compilationLexical Analysis
Syntax Analysis
Code Generation - 25Describe what code optimisation doesMakes the code as efficient as possible
- 26What is meant by a library routine and their use when producing programsPieces of software
Routines often perform common tasks
Routines are pre-compiled and tested
Error-free
Available to programmer to use
No need to re-write code - 27How library routines are used when producing softwareMay allow programmer to use code written in a different language
Linker used to link routine to program
Standard routines for sorting/searching available & allows programmers to use others expertise. May be used many times. Loader will handle address when loaded - 28Library routinesare pieces of software
...which perform common tasks
...such as searching/sorting
routines are completed - 29Why library routines help programmersroutines are error-free
already available / saves time
may be used multiple times
may be written in a different language
programmers use others expertise - 30How routines are usedLinker is used to link the routine to the program
Loader is used to handle the address when the program is to be run
Informationen
- Beschreibung
- Karteikarten am FMJC.C2, erstellt von FMJC. am 17/06/2015.
- Erstellt von
- FMJC.
- Aufrufe
- 1
- Bewertung