1/171
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
In 32-bit mode, which register points to the top of the stack?
ESP
(True/False) The PUSH instruction can have an immediate operand.
True
(True/False) The POP instruction can have an immediate operand.
False
What directives are used to bracket a procedure?
PROC and ENDP
(True/False) If RET was left out of a procedure, execution would stop at the ENDP directive.
False
RET updates EIP to return to the calling procedure. Without it, execution will run right over the ENDP and continue to the next address in memory immediately after the procedure.
What does CALL push to the stack?
The address of the instruction immediately following the CALL instruction.
What does PUSH OFFSET myVar, where myVar is a data-segment variable, put on the stack?
The address of (pointer to) the memory location where the value of myVar is stored.
What does PUSH myVar, where myVar is a data-segment variable, put on the stack?
The current value in memory at the location myVar refers to.
What are some disadvantages of passing parameters using globals?
Modifying a global in a procedure modifies it outside the procedure.Use of globals makes a procedure far less modular.
Which parameter-passing method is commonly used by compilers?
Passing parameters on the stack.
If you're passing a pointer, which of the three parameter types might your parameter be classified as?
May be either an output parameter or an input-output parameter. In fact, it may even be an input parameter (for example with Irvine's WriteString).
What single instruction would I use to save all general purpose registers?
PUSHAD
(True/False) In the IA32 architecture, ESP (the stack pointer) is incremented each time data is pushed onto the stack.
False
What instruction would I use to save the current value of the flags register?
PUSHF
PUSHF is used to preserve all general purpose register contents on the stack.
False
Which of the following is true about the POP instruction?
It copies the data pointed to by the stack pointer into the operand, and then increments the stack pointer (by 2 or 4).
The CALL instruction functions similarly to which of the following?
Push, then Jump
A stack frame is _____
The area of the stack set aside for passed arguments, return address, local variables, and saved registers.
A/An ________ procedure call occurs when a called procedure calls another procedure before the first procedure returns.
nested
(True/False) A subprocedure's stack frame contains the return address and its local variables.
True
(True/False) An input parameter may be passed by reference.
True
(True/False) Passing by reference requires accessing a parameter's offset from inside the called procedure.
True
When values are received by a called subroutine, they are called __________.
parameters
(True/False) High-level languages always pass arrays to subroutines by value.
False
(True/False) Arrays are passed by reference to avoid copying each element into the stack/registers.
True
Which offers a more flexible approach, passing arguments to procedures in registers, or on the stack?
on the stack
Where is the runtime stack located in memory?
It is located in the Stack Segment of the program's memory space (Main Memory/RAM).
Consequence of improper runtime stack management
Stack overflow (running out of stack space), stack underflow (popping too many times), or corrupting the return address, which leads to program crashes.
A copy of the actual data is passed to the procedure. Changes made inside the procedure do not affect the original variable in the caller.
Passing by Value
The memory address of the variable is passed. Changes made inside the procedure do affect the original variable in the caller.
Passing by Reference/Address
Assembly Language programs are 'higher level' than C programs. (T/F)
False
Assembly Language programs are lower level than C program. A C program will compile into assembly on its way to Machine Code.
(True/False) Assembly Language instructions have a nearly 1:1 correspondence with Machine Code.
True
Some Assembly Languages and architectures have a 1:1 correspondence from Assembly to Machine.
(True/False) A single computer architecture may have programs written for it using more than one Assembly Language (x86, RISC-V, ...).
False
An Assembly Language is defined by an ISA (Instruction Set architecture), and is the only Assembly Language defined for that computer architecture.
(True/False) A single computer architecture may have programs written for it using more than one assembler (MASM, NASM, FASM, ...)
True
Different assemblers give software developers different capabilities in the way their assembly language programs are written, assembled, and debugged. MASM and NASM can both be used to author x86 Assembly for IA32 processors, for example. Assemblers have a many-to-one correspondence to assembly languages; that is, even though there is only one assembly language for a particular ISA, there may be several assemblers available to choose from.
What is an instruction?
An instruction is a control phrase for the computer which will be translated (with its operands) into a op code (Machine Language)
(True/False) High-level language (HLL) programs are portable to a variety of computer architectures.
True
HLL programs require compilers to create architecture-specific code.
(True/False) Assembly Language programs are portable to a variety of computer architectures.
False
Assembly Languages are architecture-specific.
Little-Endian
The least significant BYTE is stored at the lowest memory address.
Big-Endian
The most significant BYTE is stored at the lowest memory address.
What are the smallest and largest values which can be represented with an signed SDWORD
Smallest: -2^31 = 2,147,483,648
Largest: 2^31-1 = 2,147,483,647
How many bytes does it take to represent the following set of characters in ASCII: HELLO
Five.
One byte per ASCII character, five ASCII characters.
How many bits are there in 35 MB (note: bytes, so binary prefixes apply)
293,601,280 bits35 220 Bytes 8 bits/Byte = 36,700,160 Bytes * 8 bits / Byte = 293,601,280 bits
Define "Bus"
A set of parallel "wires" for transferring a set of electrical signals simultaneously.
What is the Address Bus used for?
To communicate a specific memory location for reads or writes, e.g. Read from "this address on the address bus"
Which register holds the opcode of current instruction being executed?
IR - Instruction Register
Which register points to the address of the next instruction to be executed?
IP - Instruction Pointer (EIP in IA32)
Which register holds the current machine instruction?
The Instruction Register (IR)
Which register holds the current micro-instruction?
The Control Register
What is the main purpose of caching?
Moving information from slower storage to faster storage, where it can be accessed more quickly.
In a vonNeumann architecture, how are programs organized?
Programs are stored in memory and executed according to an instruction execution cycle.
On a computer, where is simple integer math computed?
ALU - Arithmetic/Logic Unit
What component's primary duty is synchronizing processes inside a computer?
System clock
What storage unit is the closest/fastest on the chip?
Registers
What would you call an ordered list of organized instructions existing somewhere in memory, and associated with a data structure for storage of data?
A program!
Where is a major data transfer bottleneck in a computer, and what helps resolve it?
The data bus, because both the program instructions and the data must be retrieved from the same memory to be executed or used. Caching helps reduce the impact.
What is the width of the address and data buses?
32 bits
What is the size of the general-purpose registers?
32 bits
Name at least four CPU status flags.
Carry, Overflow, Parity, Auxiliary Carry, Sign, Zero
In 32-bit mode, aside from the stack pointer (ESP), what other register points to stack addresses?
Stack Segment (SS), possibly EBP depending on usage
Which flag is set when an arithmetic or logical operation generates a negative result?
Sign Flag
Which flag is set when the result of an unsigned arithmetic operation is too large to fit into the destination?
Carry Flag
Which flag is set when the result of a signed arithmetic operation is either too large or too small to fit into the destination?
Overflow Flag
If the AH register is modified by the software engineer, is there any change in the EAX register? Why or why not?
Yes, the AH register is part of the EAX register. Specifically, the bits 0-7 of the AH are exactly bits 8-15 of EAX.
What best describes the relationship from assembly language instructions to machine language instructions?
nearly one to one
Language Hierarchy: The purpose of a Compiler is to...
Convert High/Low level Program Code to Assembly/Machine Code
The linker combines object files into an executable file.
True
What type of tool can convert ARM Assembly to x86 Assembly?
Cross Assembler
What is the range of decimal values for an unsigned DWORD?
0 to 4,294,967,295
The ASCII code values for alphabetic letters (e.g. 'a') are smaller than for decimal digits (e.g. '1').
False
How many bytes long is a QUADWORD on x86 systems?
8
The two's complement of a binary value is formed by which process?
reversing (inverting) the bits and adding 1
How many bits long is a WORD on x86 systems?
16
How many binary digits are represented by a series of 4 hexadecimal characters?
16
What are components of the Control Unit?
Instruction Pointer
Instruction Register
Status Register
The CPU clock cycle length is the only contributing factor to the speed of operations on a computer.
False
During which phase of the instruction execution cycle is the instruction pointer incremented?
fetch
Please place the following steps of the instruction execution cycle in their proper order. Step 1 is?
Fetch the instruction at the address in the Instruction Pointer into the Instruction Register
Please place the following steps of the instruction execution cycle in their proper order. Step 2 is?
Increment the instruction pointer to point to the next instruction.
Please place the following steps of the instruction execution cycle in their proper order. Step 3 is?
Decode the instruction in the instruction register
Please place the following steps of the instruction execution cycle in their proper order. Step 4 is?
If the instruction requires memory access, determine the memory address, and fetch the operand from memory into a CPU register, or send the operand from a CPU register to memory
Please place the following steps of the instruction execution cycle in their proper order. Step 5 is?
Execute the instruction
Please place the following steps of the instruction execution cycle in their proper order. Step 6?
If the output operand is in memory, the control unit uses a write operation to store the data.
The status flags are implemented as individual bits within the Status Register.
True
What is the size of the EAX register?
32 bits
What is the size of the AX register?
16 bits
What is the size of the AH register?
8 bits
Which Operation Mode provides compatibility for legacy 8086 programs?
Real-Address mode
What is the name of the lowest 8 bits of the EDX register?
DL
The datatype of BYTE is what?
8-bit unsigned integer
The datatype of WORD is what?
16-bit unsigned integer
The datatype of SWORD is what?
16-bit signed integer
The datatype of DWORD is what?
32-bit unsigned integer
The datatype of SDWORD is what?
32-bit signed integer
The datatype of REAL4 is what?
32-bit IEEE short real
The datatype of REAL8 is what?
64-bit IEEE long real
What does AL refer to (8 bit register references)
Bits 0-7 of EAX
What does DH refer to (8 bit register references)
Bits 8-15 of EDX
(True/False): END main is a directive that tells the operating system where to begin execution of the program
True
(True/False): A MASM program must have a procedure named "main".
False
The 'main' procedure can have any valid identifier, as long as the END directive properly points the assembler to start execution at that identifier address.
This directive is used to mark the beginning of the code segment in memory.
.code