Programming the Basic Computer - machine language, assembly language, assembler, program loops, subroutines, input-output programming - One Line Questions
1.
What is a 'buffer' in I/O programming? —
A temporary storage area in memory used to hold data during input or output operations
2.
Which of the following is a typical operand in machine language? —
A memory address or a register number
3.
What is 'recursion' in programming? —
A function calling itself directly or indirectly
4.
What is a 'nested loop'? —
A loop placed inside another loop
5.
What is Direct Memory Access (DMA)? —
A method allowing I/O devices to transfer data directly to and from main memory without CPU intervention
6.
In the context of I/O programming, what is a 'device driver'? —
A software component that translates generic I/O requests into specific commands for a hardware device
7.
What is an 'interrupt' in the context of I/O programming? —
A signal from a device indicating it needs attention or has completed an operation
8.
What is a 'stack frame' or 'activation record'? —
A data structure on the stack holding information about a single subroutine call
9.
What is a subroutine in the context of programming? —
A block of code designed to perform a specific task and can be called from other parts of the program
10.
What is the lowest level of programming language that a computer can directly understand and execute? —
Machine Language
11.
Which instruction format is directly executable by the CPU? —
Machine Language Instruction
12.
Which component translates assembly language into machine code? —
Assembler
13.
A 'for' loop is a common example of which type of loop? —
Count-controlled loop
14.
What happens when a subroutine 'returns'? —
Control is transferred back to the instruction following the subroutine call
15.
A 'while' loop is an example of what kind of loop? —
Entry-controlled loop
16.
Machine language instructions are typically represented in what format? —
Binary or Hexadecimal
17.
A 'do-while' loop is an example of what type of loop? —
Exit-controlled loop
18.
What is the output of an assembler? —
Object code (relocatable machine code)
19.
Which type of loop continues to execute as long as a specified condition remains true? —
Conditional loop
20.
Which loop structure guarantees that the loop body will execute at least once? —
Do-while loop
21.
Assembly language provides a one-to-one or close-to-one mapping with what? —
Machine language instructions
22.
Assembly language mnemonics are symbolic representations of: —
Machine code operations
23.
Which type of programming involves writing instructions that directly interact with hardware devices? —
Input-Output Programming
24.
What does 'memory-mapped I/O' mean? —
I/O devices are accessed using the same address space as memory
25.
What is the main benefit of using assembly language over machine language? —
Easier to read, write, and debug due to mnemonics and labels
26.
What is the main advantage of using subroutines? —
Reduced code redundancy and improved modularity
27.
An infinite loop is a loop whose condition: —
Is never met
28.
Which of the following is a common assembler directive? —
ORG (Origin)
29.
Which programming language uses mnemonics to represent machine code instructions? —
Assembly Language
30.
Which mnemonic might represent the 'ADD' operation in assembly language? —
ADD
31.
Machine code instructions are specific to a particular what? —
Computer Architecture (Instruction Set Architecture)
32.
Which of the following is a characteristic of assembly language? —
Closely tied to the specific computer architecture
33.
Which I/O technique involves the CPU being notified by hardware when an I/O device is ready? —
Interrupt-driven I/O
34.
Machine language is also known as: —
Object code
35.
What is the 'call stack' primarily used for? —
Managing function calls and their local states
36.
What is the process of 'calling' a subroutine? —
Transferring control to the subroutine and saving the return address
37.
An 'assembler directive' (or pseudo-operation) provides instructions for which entity? —
The assembler program itself
38.
What does the 'op-code' part of a machine language instruction specify? —
The operation to be performed
39.
What does the 'operand' field in a machine instruction typically specify? —
The location of the data or address to be used in the operation
40.
What is the role of a linker in the compilation process? —
To combine multiple object files and resolve external references
41.
What is the main purpose of using labels in assembly language? —
To represent memory addresses for jumps and data references
42.
In programming, what is a 'program loop' primarily used for? —
To repeat a block of code multiple times
43.
In assembly language, what is the purpose of a 'pseudo-operation' or 'assembler directive'? —
To control the assembly process itself, not executed by the CPU
44.
What is a 'jump' or 'branch' instruction used for in machine/assembly language? —
To alter the sequential flow of program execution
45.
What is the primary role of the stack in subroutine calls? —
To store the return address and local variables
46.
What is the 'symbol table' used for during assembly? —
To keep track of labels and their corresponding memory addresses
47.
What is the primary function of an assembler? —
To translate assembly language into machine code
48.
What is the process of 'linking'? —
Combining multiple object files and library files into a single executable program
49.
When programming input/output, what does 'polling' typically involve? —
Continuously checking the status of an I/O device