Chapter 6 Flashcards
What are the four categories of programming languages?
Assembly
Compiled
Interpreted
Query
Assembly language:
developed in 1947 at the University of London
the lowest level of code
allows the developer to provide instructions directly to the hardware
is specific to processor architecture
What are assembly language’s advantages over higher-level languages?
It can be faster
used for direct hardware access such as in the BIOS, device drivers, and customized embedded systems
used for reverse engineering of code
Binary Notational System (base 2):
1s and 0s
Decimal Notational System (base 10):
the numbers 0 or through 9 are used
Binary Math:
1+1=?
10+1=?
11+1=?
10
11
100
Hexadecimal Notational System (base 16):
number 0-9 are used
letters A-F are used to represent numbers 10-15
F+1=10
American Standard Code for Information Interchange (ASCII, pronounced ask-e):
represent text and special characters on computers and telecommunications equipment
use seven bits to store information, which provides for only 128 characters
Unicode:
superset of ASCII
136,755 characters across 139 language scripts and several character sets
UTF-8 uses 8 bits and it identical to ASCII
UTF-16 uses 16 bits for 65,536 and is the most common standard in use today
What 2 things do you need to know when coding in assembly?
the version specific to the processor’s platform
how the processor codes will respond in protected and unprotected memory environments
What is the binary code to tell the processor to move data?
10110 followed by a 3-bit memory register identifier
MOV:
short for move
is a mnemonic to replace the binary or hex code
What section is after the semicolon on a line of code?
comments
What does the basic structure of a line of code contain?
processor instructions (do this)
directives (giving the processor specific ways of performing the task)
data
optional comments
Compiled Programming Language:
one that requires the use of a compiler to translate it into machine code
What are the three steps for creating and using a program using a compiled language?
Write the application in a programming language, such as Java or C++. This is called source code
Use a compiler to translate the source code into machine code. Most software development apps have a compiler
Execute the program file, which (in Windows) usually has an .exe extension
In the past what were the more common compiled languages?
Fortran
BASIC
Pascal
Currently what are the more common compiled languages?
Java
C
C++
C#
Compare Java code to assembly:
Java is a lot shorter
Java uses the { } brackets to indicate code blocks
use 2 slashes (//) to create comment section compared to semicolon
Java uses double quotes (“””) and assembly uses single quotes (‘’)
Compare C++ and Java:
both are derivatives of the C language
Both comments start with two slashes and braces are present to create blocks of code
both use a main function, double quotes for text, and a semicolon to end a statement
Interpreted Programming Language:
each line of code is read by an interpreter every time the program is executed
What do both an interpreter and a compiler do?
they take high-level source code and translate it into low-level machine code
Interpreter vs. Compiler
Task:
Translating source code
Interpreter translate one statement at a time
Compiler translates entire program at once
Interpreter vs. Compiler
Task:
Executing programs
Interpreter executes program by itself
Compiler creates an executable file (usually .exe)
Interpreter vs. Compiler
Task:
Analyzing source code:
Interpreter is faster than Compiler
Interpreter vs. Compiler
Task:
Executing code
Compiler is faster than Interpreter
Interpreter vs. Compiler
Task:
Using memory
Compiler is faster than Interpreter
Interpreter vs. Compiler
Task:
Debugging
Interpreter is easier than Compiler
When does the interpreter generate an error code?
when it gets to a line that is written incorrectly
When does the compiler generate an error code?
After it reads the entire code
What are the three types of interpreted languages to be familiar with?
Markup language
Scripting language
Scripted language