COMSC260 Final Exam Study Guide.
Link library - Answer✔file containing procedures that have been assembled into machine code
Irvine32.lib - Answer✔for programs written in 32-bit protected mode
Irvine16.li - Answer✔for programs written in 16-bit real-address mode
stack - Answer✔LIFO(Last In, First Out)
the last value put into the stack is always the first value taken out
runtime stack - Answer✔a memory array managed directly by the CPU, using the ESP(extended
stack pointer) register
push operation - Answer✔decrement the stack pointer and copy a value into the location in the
stack pointed to by the stack pointer
pop operation - Answer✔remove a value from the stack
After the value is popped from the stack, the stack pointer is incremented to point to the next-
highest location in the stack
This is the value of EAX when the following sequence of instructions has executed
push 5
push 10
push 20
pop eax - Answer✔20
The runtime stack is managed by the operating system, with no support from the CPU. -
Answer✔False
The EBP register points to the last value pushed on the stack. - Answer✔False
ESP register
The first value pushed on a stack is the last one to be removed. - Answer✔True
the ESP register always points to the last item pushed on the stack - Answer✔True
1|Page
, ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.
The PUSH instruction copies a value from the stack to an operand before incrementing the stack
pointer. - Answer✔False
PUSH instruction - Answer✔first decrement ESP and then copy a source operand into the stack.
(A 16-bit: ESP = ESP-2,
32-bit: ESP = ESP - 4)
POP instruction - Answer✔first copy the contents of the stack element pointed to by ESP into a
16 or 32 bit destination operand and then increment ESP
PUSHFD - Answer✔push the 32-bit EFLAGS register on the stack
POPFD - Answer✔pop the stack into EFLAGS
PUSHAD - Answer✔push all of the 32-bit general purpose register on the stack in order, EAX,
ECX, EDX, EBX, ESP, EBP, ESI, and EDI
POPAD - Answer✔pop the same register off the stack in reverse order
PUSHA - Answer✔push the 16bit general purpose register(AX, CX, DX, BX, SP, BP, SI, DI)
POPA - Answer✔pop the same registers in reverse
This is the value of EAX when the following sequence of instructions has executed
push 5
push 10
pop ebx
pop eax - Answer✔5
This codes a PROC declaration for a procedure named MySub. It uses the USES operator to
preserve the EAX and EBX registers. - Answer✔mySub PROC USES EAX EBX
This procedure locates the cursor at a specific row and column on the screen - Answer✔Gotoxy
Write a procedure named ShowBinary that displays the following array as a sequence of binary
bits, starting with the low-order value (00000010h). Include the use of the LENGTHOF,
OFFSET, and TYPE operators, and call the WriteBin procedure::::: array DWORD
10h,20h,30h,40h - Answer✔ShowBinary PROC
MOV ECX, LENGHTOF array
MOV ESI, OFFSET array
L1: MOV EAX, [esi]
2|Page