• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 10 pages
Exam (elaborations)

COMSC260 Final Exam Study Guide.

Document preview thumbnail
Preview 2 out of 10 pages

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 put into the stack is always the first value taken out runtime stack - Answera memory array managed directly by the CPU, using the ESP(extended stack pointer) register push operation - Answerdecrement the stack pointer and copy a value into the location in the stack pointed to by the stack pointer pop operation - Answerremove 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 - Answer20 The runtime stack is managed by the operating system, with no support from the CPU. - AnswerFalse The EBP register points to the last value pushed on the stack. - AnswerFalse ESP register The first value pushed on a stack is the last one to be removed. - AnswerTrue the ESP register always points to the last item pushed on the stack - AnswerTrue ©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED. 2 | P a g e The PUSH instruction copies a value from the stack to an operand before incrementing the stack pointer. - AnswerFalse PUSH instruction - Answerfirst decrement ESP and then copy a source operand into the stack. (A 16-bit: ESP = ESP-2, 32-bit: ESP = ESP - 4) POP instruction - Answerfirst copy the contents of the stack element pointed to by ESP into a 16 or 32 bit destination operand and then increment ESP PUSHFD - Answerpush the 32-bit EFLAGS register on the stack POPFD - Answerpop the stack into EFLAGS PUSHAD - Answerpush all of the 32-bit general purpose register on the stack in order, EAX, ECX, EDX, EBX, ESP, EBP, ESI, and EDI POPAD - Answerpop the same register off the stack in reverse order PUSHA - Answerpush the 16bit general purpose register(AX, CX, DX, BX, SP, BP, SI, DI) POPA - Answerpop 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 - Answer5 This codes a PROC declaration for a procedure named MySub. It uses the USES operator to preserve the EAX and EBX registers. - AnswermySub PROC USES EAX EBX This procedure locates the cursor at a specific row and column on the screen - AnswerGotoxy Write a procedure named ShowBinary that displays the following array as a sequence of binary bits, starting with the low-order value (h). Include the use of the LENGTHOF, OFFSET, and TYPE operators, and call the WriteBin procedure::::: array DWORD 10h,20h,30h,40h - AnswerShowBinary PROC MOV ECX, LENGHTOF array MOV ESI, OFFSET array L1: MOV EAX, [esi]

Content preview

©BRIGHSTARS 2024/2025 ALL RIGHTS RESERVED.




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

Document information

Uploaded on
January 14, 2025
Number of pages
10
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Brightstars
3.4
(43)
Sold
283
Followers
7
Items
16045
Last sold
1 day ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions