click below
click below
Normal Size Small Size show me how
CS0003 Midterms
| Question | Answer |
|---|---|
| [T / F] in direct memory addressing, one of the operands refers to a memory location and the other operand references a register. | True |
| These are APIs for the interface between the user space and the kernel space. | System calls |
| It contains the carry from bit 3 to bit 4 following an arithmetic operation | Auxiliary Flag |
| It tell the assembler about the various aspects of the assembly process. | Assembler directives |
| This refers to the process through which the processor controls the execution of instructions. | fetch-decode-execute cycle |
| Which of the following is not a type specifier? INT all of the above FLOAT DOUBLE | all of the above |
| This section is used for declaring variables. | bss section |
| Which flag indicates the overflow of a high-order bit (leftmost bit) of data after a signed arithmetic operation. | Overflow Flag |
| Which flag determines left or right direction for moving or comparing string data. | Direction Flag |
| Which flag contains the carry of 0 or 1 from a high-order bit (leftmost) after an arithmetic operation. | Carry Flag |
| In this addressing mode, an immediate operand has a constant value or an expression. | Immediate Addressing |
| Convert the following hexadecimal numbers to binary. 4FB2 | 100111110110010 |
| This section is used for keeping the actual code. | text section |
| This directive allows redefinition. %define EQU %assign %equ | %assign |
| This segment contains data values passed to functions and procedures within the program. data segment code segment stacks | stacks |
| This is the fundamental unit of computer storage. | bit |
| These registers mainly helps in referencing the parameter variables passed to a subroutine. | pointer |
| Which flag contains the carry from bit 3 to bit 4 following an arithmetic operation | Auxiliary Flag |
| What are the three sections of an assembly program? | text section bss section data section |
| It tell the assembler about the various aspects of the assembly process. | assembler directives |
| In this addressing mode, an immediate operand has a constant value or an expression. | Immediate Addressing |
| [T / F]The CMP instruction compares five operands. | False |
| This instruction is used for incrementing an operand by one | INC |
| If you want to check whether a given number is odd or even, a simple test would be to check the least significant bit of the number. If this is 1, the number is odd, else the number is _______. | Even |
| Jump if overflow JO JNO JS JC | JO |
| Jump if no carry. JNC JC JXCZ JP | JNC |
| This is the ASCII code for ? 63 36 33 60 | 63 |
| This is the ASCII code for d 100 101 200 120 | 100 |
| This instruction for multiplying binary data handles unsigned data | MUL |
| It is a division operation that generates two elements - a quotient and a remainder. This instruction is used for unsigned data. | DIV |
| [T / F]The ADD/SUB instruction can take place between register to memory. | True |
| If the operand is of one byte, it is loaded into the AL register, if the operand is one word, it is loaded into the AX register and a doubleword is loaded into the EAX register. | LODS |
| Jump sign is a negative value. JS JNS JNO JC | JS |
| Which of the following is not a basic instruction for processing strings. MOVS LODS STOP | STOP |
| [T / F] Numerical data is generally represented in binary system. | True |
| This is an instruction that compares two operands. It is generally used in conditional execution. | CMP |
| Used for decrementing an operand by one. It works on a single operand that can be either in a register or in memory. | DEC |
| This basic instruction for processing strings moves 1 Byte, Word or Doubleword of data from memory location to another. | MOVS |
| This basic instruction for processing strings loads from memory. If the operand is of one byte, it is loaded into the AL register, if the operand is one word, it is loaded into the AX register and a doubleword is loaded into the EAX register. | LODS |
| This basic instruction for processing strings stores data from register (AL, AX, or EAX) to memory. | STOS |
| This basic instruction for processing strings compares two data items in memory. Data could be of a byte size, word or doubleword. | CMPS |
| This basic instruction for processing strings compares the contents of a register (AL, AX or EAX) with the contents of an item in memory. | SCAS |
| The ___ instruction compares two operands. It is generally used in conditional execution. | CMP |
| Compares two numeric data fields. The destination operand could be either in register or in memory. The source operand could be a constant (immediate) data, register or memory. | CMP |
| Often used for comparing whether a counter value has reached the number of times a loop needs to be run. | CMP |
| [ T / F ]Conditional execution often involves a transfer of control to the address of an instruction that does not follow the currently executing instruction. | True |
| The ___ instruction provides a label name where the flow of control is transferred immediately. | JMP |
| What does JE/JZ mean? | Jump Equal or Jump Zero |
| What does JNE/JNZ mean? | Jump not Equal or Jump not Zero |
| What does JA/JNBE mean? | Jump Above or Jump Not Below/Equal |
| What does JAE/JNB mean? | Jump Above/Equal or Jump Not Below |
| What does JB/JNAE mean? | Jump Below or Jump Not Above/Equal |
| What does JBE/JNA mean? | Jump Below /Equal or Jump not Above |
| What does JXCZ mean? | Jump if CX is Zero |
| What does JC mean? | Jump if Carry |
| What does JNC mean? | Jump if No Carry |
| What does JO mean? | Jump if Overflow |
| What does JNO mean? | Jump if No Overflow |
| What does JP/JPE mean? | Jump Parity or Jump Jump Parity Even |
| What does JNP/JPO mean? | Jump No Parity or Jump Jump Parity Odd |
| What does JS mean? | Jump sign (negative value) |
| What does JNS mean? | Jump no Sign (positive value) |
| The ___ instruction can be used for implementing loops. | JMP |
| Basic Syntax of the basic LOOP instruction | LOOP label |
| Basic Syntax of the basic JMP instruction | JMP label |
| Basic Syntax of the basic CMP instruction | CMP destination, source |
| The LOOP instruction assumes that the ___ register contains the loop count. | ECX |
| Numerical data is generally represented in what system? | Binary System |
| Arithmetic instructions operate on ___ data? | Binary Data |
| When numbers are displayed on screen or entered from keyboard, they are in ____ form. | ASCII |
| Meaning of: AAA | ASCII Adjust After Addition |
| Meaning of: AAS | ASCII Adjust After Subtraction |
| Meaning of: AAM | ASCII Adjust After Multiplication |
| Meaning of: AAD | ASCII Adjust Before Division |
| Two Types of BCD representation | Unpacked & Packed representation |
| [Packed / Unpacked] In ____ BCD representation, each byte stores the binary equivalent of a decimal digit. | unpacked |
| What is the ASCII code for ? | 63 |
| What is the ASCII code for a | 97 |
| What rule states that the number of bits that are ON (1) in each byte should always be odd. | Rule of Parity |
| In this addressing mode, a register contains the operand. Depending upon the instruction, the register may be the first operand, the second operand or both. | Register Addressing |
| [T / F]processing data between registers does not involve memory, it provides fastest processing of data | True |
| What type of addressing has a constant value or an expression. | Immediate Addressing |
| in this type of addressing the offset value is specified directly as part of the instruction, usually indicated by the variable name. | Direct Memory Addressing |
| This addressing mode utilizes the computer's ability of Segment: Offset addressing. Generally, the base registers EBX, EBP (or BX, BP) and the index registers (DI, SI), coded within square brackets for memory references, are used for this purpose. | Indirect Memory Addressing |
| Type of Memory Addressing generally used for variables containing several elements like, arrays. Starting address of the array is stored in, say, the EBX register. | Indirect Memory Addressing |
| [T / F ]Both the operands in MOV operation should be of same size | True |
| What does DB mean? | Define Byte |
| What does DW mean? | Define Word |
| What does DD mean? | Define Doubleword |
| What does DQ mean? | Define Quadword |
| What does DT mean? | Define Ten Bytes |
| The ____ directives are used for reserving space for uninitialized data. | Reserve Directives |
| The ___ directive is used for defining constants. EQU %assign %define | EQU |
| The ___ directive can be used to define numeric constants like the EQU directive. EQU %assign %define | %assign |
| This directive allows redefinition EQU %assign %define | %assign |
| The ___ directive allows defining both numeric and string constants. EQU %assign %define | %define |
| This directive is similar to the #define in C. | %define |
| The ___ instruction is used for incrementing an operand by one. It works on a single operand that can be either in a register or in memory. | INC |
| The ___ instruction is used for decrementing an operand by one. It works on a single operand that can be either in a register or in memory. | DEC |
| [T / F]memory-to-memory operations are not possible using ADD/SUB instructions. | True |
| Handles unsigned data when multiplying | MUL |
| Handles signed data when multiplying | IMUL |
| The bitwise ___ operation returns 1, if the matching bits from both the operands are 1, otherwise it returns 0. | AND |
| The bitwise ___ operator returns 1, if the matching bits from either or both operands are one. It returns 0, if both the bits are zero. | OR |
| The ___ operation sets the resultant bit to 1, if and only if the bits from the operands are different. If the bits from the operands are same (both 0 or both 1), the resultant bit is cleared to 0. | XOR |
| The ___ instruction works same as the AND operation, but unlike AND instruction, it does not change the first operand. | TEST |
| The ___ operation reverses the bits in an operand. | NOT |
| Which type of flag is set if the result of an arithmetic operation is zero. | ZF Zero Flag |
| Which type of flag is set if an arithmetic operation results in a carry/borrow (overflow/underflow). | CF Carry Flag |
| Which type of flag is set if the result of an operation is negative. | SF Sign Flag |
| Which type of flag is set if signed arithmetic operation results in overflow. | OF Overflow Flag |
| Which type of flag is set if the number of set bits in the result is even. | PF Parity Flag |
| Which type of flag is used in string processing operations to indicate the direction. | DF Direction Flag |
| Register used for arithmetic operations (e.g., addition, subtraction). | EAX / Accumulator |
| Register often used to store data or as a base pointer for arrays. | EBX / Base |
| Register used for loops and string operations (acts as a loop counter). | ECX / Counter |
| Register used in input/output and for extended multiplication/division. | EDX / Data |
| Which Repetition Prefix is the unconditional repeat. It repeats the operation until CX is zero. | REP |
| Which Repetition Prefix is a conditional repeat. It repeats the operation while the zero flag indicates equal/zero. It stops when the ZF indicates not equal/zero or when CX is zero. | REPE / REPZ |
| Which Repetition Prefix is also a conditional repeat. It repeats the operation while the zero flag indicates not equal/zero. It stops when the ZF indicates equal/zero or when CX is decremented to zero. | REPNE / REPNZ |
| It is a sequence of instructions, assigned by a name and could be used anywhere in the program. script registers macro segments | macro |
| In this type of recursion, the procedure calls itself. Indirect Direct all of the above Mixed | Direct |
| It specifies the location for a subsequent read/write operation in the file in terms of bytes. file size file management File pointer file descriptor | File pointer |
| [T/F] Procedures are identified by a name. | True |
| In this type of recursion, the first procedure calls a second procedure, which in turn calls the first procedure. All of the above Indirect Mixed Direct | Indirect |
| [T/F] Only words or doublewords could be saved into the stack, not a byte. | True |
| The procedure is called from another function by using the ____ instruction. | call |
| [T/F] The macro begins with the %endmacro directive and ends with the %macro directive. | False |
| The called procedure returns the control to the calling procedure by using the ______ instruction. | RET |
| Which of the following is not a standard file stream? stdprint stderr stdout stdin | stdprint |
| Under this law, the input of A has no effect. Identity Law Idempotent Law De Morgan’s Law Annulment Law | Annulment Law |
| [T/F] The Complement Law states that 𝐴∨¬𝐴=¬A. | False |
| The Complement Law states that 𝐴∧¬𝐴=0 | True |
| Which is not a Boolean Algebra Law? De Morgan’s Law Modus Tollens Identity Law all of the above | Modus Tollens (Correct!) |
| The Identity Law states that A∧1 can be written as ? 1 0 A none of the above | A |
| What gate is the notation ¬ representing? | NOT |
| A∧B=Q, if A=1 and B=1, what does Q equal? | 1 |
| What gate is the notation ∧ representing? | AND |
| What is the output of an AND gate if the inputs are 1 and 0? | 0 |
| Which has the highest priority among the logic gates? AND OR NOT all of the above | NOT |