Save
Computer Science A Level
1-2 Software
Programming Language Translators
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Tymon Zwirko
Visit profile
Cards (31)
What do computers execute?
Machine code
View source
Why is machine code difficult for humans?
It is hard to
read
,
write
, and
debug
View source
What might a machine code instruction look like?
01000101
View source
How do assembly code instructions compare to machine code?
They are easier for humans to work with
View source
What type of language is assembly code?
Low level language
View source
What does an assembler do?
Translates
assembly code
into
machine code
View source
Why is object code hardware specific?
Each
processor
has its own
instruction set
View source
What does a compiler do?
Translates
high-level language
into
machine code
View source
What is the resulting machine code from a compiler called?
Object code
View source
How is object code produced?
It is
hardware
specific
View source
What does an interpreter do?
Translates
high-level language
into
machine code
View source
How does an interpreter execute code?
Line by
line
View source
What are the differences between a compiler and an interpreter?
Compiler:
Runs programs multiple times without
recompilation
Faster execution
Executable
code does not need interpreter
Compiled
code is hard to read
Interpreter:
Source code
runs on any machine with interpreter
Small errors don't require recompilation
View source
What is bytecode in programming?
Intermediate step between
source
and
machine code
View source
How is Java related to bytecode?
Java is
compiled
into bytecode
View source
What interprets bytecode?
Bytecode
interpreter
View source
What are the stages of compilation?
Lexical analysis
Symbol table
Syntax analysis
Semantic analysis
Code generation
View source
What happens during lexical analysis?
Unnecessary
spaces
and
comments
are removed
View source
What are tokens in lexical analysis?
Represent
functions
in the program
View source
What might tokens look like for the code "age = 17; print(age);"?
<
identifier
> <
operator
> <number> <
keyword
> <
open_bracket
> <identifier> <
close_bracket
>
View source
What does the symbol table do?
Keeps track of
memory addresses
for
identifiers
View source
What occurs during syntax analysis?
Tokens
are checked against
language rules
View source
What happens if a phrase is not valid in syntax analysis?
An
error
will be recorded
View source
What is a syntax diagram?
Visual
representation
of syntax rules
View source
What does semantic analysis check for?
Valid syntax that is not a
valid program
View source
What occurs during code generation?
Machine code
is generated from the program
View source
What is code optimization?
Improving code
efficiency
and removing redundancies
View source
What are libraries in programming?
Sets of pre-written
functions
Examples:
random number generation
,
math operations
Programmers can write their own libraries
Library functions can be called in programs
View source
What does a linker do?
Links
memory addresses
for
library functions
View source
What is the role of a loader?
Copies
program
into
main memory
to run
View source
Why does the loader relocate memory addresses?
Some
memory
may
already
be in
use
View source