COMSC260 Final Exam Study Guide.
Link library - Answerfile containing procedures that have been assembled into machine code
I - Answerfor programs written in 32-bit protected mode
I - Answerfor programs written in 16-bit real-address mode
stack - AnswerLIFO(Last In, First Out)
the last value p...
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
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
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Brightstars. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.49. You're not tied to anything after your purchase.