Chapter 1 Flashcards
Much of computer architecture involves the substitution of _______ for _______
Much of computer architecture involves the substitution of numeric codes for symbols
The manipulation of the symbols that represent numeric codes is facilitated by what?
A macro processor
What is m4?
The UNIX macro processor.
Define “accumulator”
An accumulator is a register used to contain the results of an arithmetical or logical operation
Define “register”
A location in a store of data, used for a specific purpose and with quick access time
What is a stack?
A stack is a first-in-last-out data structure in which only the top stack elements are accessible
What is it called when we remove something from a stack?
popping
What is it called when we place items onto a stack?
pushing
What is the ALU?
The arithmetic logic unit. The unit in a computer that carries out arithmetical and/or logical operations
Stacks and registers are two forms of what?
Memory
Why is a stack convenient for expression evaluation?
Because memory addresses are not needed
Why would one use a register instead of the stack?
Registers are useful when values enter into the computation in a less structured manner
In a computer, what is an “address”?
A location in memory
What executes the machine language?
The central processing unit (CPU)
What does the program counter do?
It keeps track of the address of the next instruction to be executed
What is assembly language?
Symbols representing numeric values
What is m4 used for?
A program that can be used to translate symbols into numeric constants
Define “macro”.
Symbol, name, or key that represents a list of commands, actions, or keystrokes. Many programs allow you to create macros so that you can enter a single character or word to perform a whole series of actions.
How many arguments can a macro take?
A macro can have up to nine arguments
When using a macro, what indicates the presence of arguments?
When the macro name is immediately followed by an open parentheses “(“
If there are arguments present with a macro, how does the processor handle them?
The arguments are evaluated; if they are in quotes, the quotes are stripped and the arguments are NOT evaluated; any $n subs are made. The macro is fully expanded and pushed back to output stream.
What is a location counter?
It is a symbol representing the memory address of the instruction being assembled.
What is “eval”?
It’s a built in macro that takes in a string argument to represent an arithmetic expression. It then evaluates the expression and returns its value in the form of a numerical string.
What is machine language?
Numeric values that represent the operations of a machine and the locations of operands
What is a macro processor?
Identifies macro tokens and arguments in its input stream, and substitutes the macro definitions in their place to be rescanned
Define “define” in m4
A built in macro that defines its first argument to be a macro token to be replaced on evaluation by its second argument
What is an accumulator machine?
It combines an operand from memory with the contents of a single register (the accumulator) and stores the result of the operation in the accumulator. The contents of the accumulator can be loaded from and stored into memory.
What is a label?
A symbol whose value is the address where the instruction or data it references will be located in memory
What is a symbol table?
A table of symbol-value pairs that is created by the macro processor on the first pass and utilised on the second pass
What is MAR?
Memory access register
What is MDR?
Memory data register
What are the four registers?
%g for global
%o for output
%l for local
%i for input
Which register is the throwaway register?
%g0
Which register does trap get its service request instruction from?
%g1
Which registers does .div work with?
It takes what’s in %o0, divides %o1 into it, and stores the result in %o0