Introduction Flashcards
Machine Cycle
Fetch > Decode > Execute
Retrieve the instruction from memory and increment the Program Counter
Fetch
Decode the bit pattern in the Instruction Register
Decode
Perform the instruction in the Instruction Register
Execute
Instructions are from a language called ____
Machine Language
An executable program is a sequence of these simple instructions, which are stored in memory
Machine Code
The computer can only understand the bits (the encoded program):
Machine Language
English-like abbreviations for programs:
Assembly Language
What the computer actually sees and deals with. Given as a number or a sequence of numbers.
Machine Language
Same as machine language, except the command numbers have been replaced by letter sequences
Assembly Language
Middle-level language, maps human-readable mnemonics to machine instructions, allows machine-level programming without writing in machine language
Assembly Language
Allows you to describe the program in a more natural language
High-level language
Low-level language which provides the basic instructional interface to the computer processor
Assembly Language
As close to the processor as you can get as a programmer
Assembly Language
Reasons not to use assembly:
> Development TIme
Maintainability
Portability
The I/O devices connected to the bus
Input and Output
A collection of the computer’s electrical lines where signals pass through
bus
The bus is typically designed to transfer fixed-sized chunks of bytes known as _____
words
The computer’s processor; Engine that interprets (or executes) instructions stored in main memory
Central Processing Unit
CPU chip includes the _____ and ______
Arithmetic and Logic Unit, CPU Registers
A logic circuit in the CPU that is responsible for performing mathematical and logical operations
Arithmetic and Logic Unit
A set of flip-flops treated as a single unit
register
A digital logic circuit capable of storing a single bit
flip-flop
Temporary storage device that holds both a program and the data it manipulates while the processor is executing the program
Main Memory
Data storage sizes in order
Byte > Word > DWord > QWord > DQWord
Temporary storage or working location built into the CPU itself (separate from memory)
register
Computations are typically performed by the CPU using ______
registers
A ______ can be accessed with all 64-bits or some portion or subset accessed
General Purpose Register
Used to point to the current top of stack
Stack pointer register (RSP)
Used as a base pointer during function calls
Base pointer register (RBP)
Used by the CPU to point to the next instruction to be executed
Instruction pointer register (RIP)
Used for status and CPU control information
Flag register (rFlags)
Updated by the CPU after each instruction and not directly accessible by programs
Flag register (rFlags)
stores status information about the instruction that was just executed
Flag register (rFlags)
Can be viewed as a series of bytes; each memory address holds one byte of information
Main Memory
Main memory architecture is _____
little-endian
Stored in the lowest memory address
Least Significant Byte (LSB)
Stored in the highest memory location
Most Significant Byte (MSB)
Makes use of LSB and MSB
Little-endian architecture
where the machine language is stored
text (code)
where the initialized data is stored
data
where uninitialized declared variables are stored
BSS
where dynamically allocated data will be stored (if requested)
heap
starts in high memory and grows downward (used by subroutines)
stack
Goal of Memory Hierarchy
Balance performance with cost
all initialized variables and constants are places in this section
Data Section
Data section starts with ____
section .data
____ substituted for their defined values during the assembly process
constant
not assigned a memory location
constant
format for constants
<varname> equ <initVal>
</initVal></varname>
format for variable definition
<varname> <directive> <initVal>
</initVal></directive></varname>
all uninitialized variables are placed in this section
BSS Section
BSS section starts with ____
section .bss
includes some headers or labels that define the initial program entry point
Text Section
Text section starts with ___
section .text
Numeric values may be specified in ______
Decimal, hex, or octal
Default radix (base) for numeric value is _____
Decimal
modifies the original C program according to directives that begin with the # character
Preprocessing
translates the output text file of the pre-processor into a text file which contains an assembly language program
Compilation
Translates compiler output to machine language instructions, generating a relocatable object program
Assembly
Handles the merging of other necessary precompiled object files with the assembler’s output, generating an executable file
Linking
Program that will read an assembly language input file and convert the code into a machine language binary file
Assembler
comments are removed, and the variable names and labels are converted into appropriate addresses
Assembler
optionally capable of creating a list file which shows the line number, the relative address, the machine language version of the instruction, and the original source line
Assembler
combines one or more object files into a single executable file
Linker
any routines from user or system libraries are included as necessary
linker
part of the operating system that will load the program from secondary storage to primary storage (main memory)
loader
used to control execution of a program
debugger
allows for testing and debugging activities to be performed
debugger