Model Midterm Term
.pdf
keyboard_arrow_up
School
New Jersey Institute Of Technology *
*We aren’t endorsed by this school
Course
CS 610
Subject
Computer Science
Date
Apr 3, 2024
Type
Pages
5
Uploaded by SuperMagpie4063
ECE 692 Spring 2021 Midterm
1.
ELFs are made by
a)
gcc
b)
objcopy
c)
makeelf
d)
sudo rm -rf
2.
Compilers are used to make
a)
object, linkable, and/or executable files.
b)
linker scripts.
c)
immutable directories.
d)
Micro-controllers.
3.
What is the value of the overflow flag for this, A+B, example? The dots can have any binary values.
A01..
2
B01..
2
a)
V=1
b)
V=0
c)
V=100?
4.
(Ref) R0 = 11101
2
SUBS R3, R0, R1
; What are the values for the C, Z, V, and N flags? Assume that starting point of the flags are C=1, Z=0, V=0, and N=0.
a)
C=1, V=0, Z=0, N=0
b)
C=0, V=0, Z=0, N=0
c)
C=1, V=1, Z=0, N=0
d)
C=1, V=0, Z=0, N=1
5.
Unsigned subtraction is correct when the carry flag is 0.
a)
False
b)
True
6.
Shift operations possibly can change the carry and overflow flags.
a)
False
b)
True
7.
Thumb-2 instruction set allows
a)
16/32 bits instructions that are a trade-off between CPU performance and code density.
b)
only 32 bits and allow a higher code density.
c)
32/64 bits instructions together.
d)
the only way to make programs out of ARM instructions.
8.
Cortex-A processors are likely to be found in
a)
a cellphone, tablet or laptop.
b)
a toaster.
c)
a real-time dependent system.
d)
small, non-graphical devices.
9.
Compilers can combine assembly and C/C++ language code.
a)
True
b)
False
10. A Load-Store instruction set
a)
cannot directly access the data stored in memory.
b)
computes the result after loading data onto the stack.
c)
is not used in modern processors.
d)
does not exist.
11. Assembler directives are used to provide
a)
assembler specific compilation information.
b)
direct linking of object files.
c)
only direct execution of load instructions.
d)
align code to memory.
12. The Keil ENTRY assembler directive
a)
specifies the entry point of an application.
b)
specifies the starting point where the stack begins.
c)
doesn’t exist.
d)
is not an assembler directive.
13. ALIGN=2 aligns the following instructions/pseudo instructions to addresses
a)
with a multiple of 4.
b)
with a multiple of 2.
c)
that are 2 bytes offset off of word addresses.
d)
is not real.
14. The Interrupt Program Status Register (IPSR) is used
a)
to pass exception or interrupt information.
b)
for arithmetic flags.
c)
doesn’t exist.
d)
to store information when subroutines are running.
15. The arithmetic instructions updates the carry flag in APSR
a)
if an S is suffixed to the end of the instruction.
b)
always.
c)
never.
d)
never, because the carry flag is not in the APSR.
16. If variable a=0x12345678 and mask=0xFF000000 what is the result of a ^= mask?
a)
0xED345678
b)
0xFE345678
c)
0x00345678
d)
0xED000000
17. (Ref) What does ADD R0, R1, R2, LSL #3
do?
a)
R0 = R1 + R2 * 8
b)
R0 = R1 + R2 / 8
c)
R0 = R1 – R2 * 8
d)
R1 = R0 + R2 * 8
18. (Ref) Suppose r0 = 0xFFFFFFFF, r1 = 0x00000001, and r2 = 0x00000000. Initially the N, Z, V,
C flags are 0. Find the values of the flags and r3 for ADD r3, r0, r2
.
a)
R3 = 0xFFFFFFFF, N=0, Z=0, V=0, C=0
b)
R3 = 0xFFFFFFFF, N=1, Z=0, V=0, C=0
c)
R3 = 0x00000000, N=0, Z=0, V=0, C=0
d)
R3 = 0x00000000, N=0, Z=1, V=0, C=1
19. (Ref) Suppose r0=11101
2
and r1=10110
2
. What are the N, Z, C, V flags for SUBS r3, r0, r1
. Assume initially N=0, Z=0, C=1, V=0.
a)
N=0, Z=0, V=0, C=1
b)
N=0, Z=0, V=0, C=0
c)
N=1, Z=0, V=0, C=1
d)
N=1, Z=0, V=0, C=0
20. Suppose mask = 0x00000F0F and P = 0xABCDABCD. What is the result of Q = P | mask
.
a)
Q = 0xABCDAFCF
b)
Q = 0xABCDAECE
c)
Q = 0xABCDA0C0
d)
Q = 0x00000B0D
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
please write with proper explanation.
Question half solution is here please write what is main disadvantages of this approach?
Half solve questions:
Mutual Exclusion:
Mutex is an abbreviation for Mutual Exclusion. It is a programme object that prevents multiple users from accessing a shared resource at the same time. When a process accesses a shared variable, it is said to be in the critical section. When no two processes are present in the critical section at the same time, this is referred to as Mutual Exclusion or Mutex.
while (true)
{
semaphore sem = S;
while (S <= 0) do no operation
{
S = S-1;
wait (S);
}
/*critical section*/
while (S > 0)
{
S = S+1;
signal (S);
}
/*remainder section*/
}
arrow_forward
JavaScript
The difference between a compiled and an interpreted language is that:
Group of answer choices:
a- interpreted languages create an executable file whereas compiled languages do not.
b- compiled languages create an executable file whereas interpreted languages do not.
c- There is no such thing as an interpreted language
d- interpreted languages can execute on any machine regardless of whether the source code is present
Which is correct?
arrow_forward
What are the common challenges or issues developers may encounter when working with object serialization?
arrow_forward
in c++ language
arrow_forward
A compiled program can be supplied as an executable file. An executable file is a file that is ready to run. Since an executable file cannot be run, programmers prefer to supply executables rather than source code. What is this executable file and what differentiates it from the source code?
In the Python programming language, the process of source code translation is different from that in C programming, explain
arrow_forward
. Explain the differences between stream socket and datagram socket with diagram. java
arrow_forward
4) For each of the following, list if it is a characteristic of a) Interpreted languages, b)
Compiled Languages or c) languages that have compilation with Interpretation.
Easy/Quick to test your program:
Portability:
Fastest to execute once your program has been tested:
Requires that the source code be present in the client's machine:
C# and Java:
Javascript and Python:
C, C++:
5) Describe three of the top 10 web application security risks and how it can be mitigated.
arrow_forward
Define the remote interface in protocol buffer
Implement the gRPC client and server in the ballerina language
Implement the server-side logic in response to the remote invocations
arrow_forward
a) What is the definition of garbage collection?
b) What is System.gc() and what does it do?
arrow_forward
CODE IN C++ PLEASE....
arrow_forward
• What is static memory allocation and dynamic memory allocation?• What are c++ access modifiers explain with details?
arrow_forward
What are the potential challenges or issues developers may face when working with object serialization?
arrow_forward
Chat Application
Write a GUI Java program to implement a client/server chat application using Java sockets
and threads.
1000
...
Server
Client
Client
Connected to: localhost
Now Connected to localhost
Send
Send
Project instructions
1) The total grade for the project is 05 marks.
2) Each student must implement the project individually without any participation with
other students.
3) Your program has to be split into several appropriate functions and classes.
4) The style and readability of your program will also determine your grade, in addition
to the correctness of the program.
Write your Code here
Paste your Output Screen here
Server
arrow_forward
openGL : C++ language
arrow_forward
Does Garbage collection occur in permanent generation space in JVM ?
arrow_forward
A name fined in file/namespace scope. It can be referenced by name only thin the same translation unit.
arrow_forward
Java program for file handling
arrow_forward
Write a C program to simulate the hierarchy file organization technique.
arrow_forward
Q3) A) Why 1/O streams are important in programming? Explain briefly each reason.
Q3)B) What are the advantages of OOP? Explain each point with running examples and their outputs
C ++
arrow_forward
Use java Language
arrow_forward
Assembly instructions and assembly directives
The LC-3 assembly language includes assembler directives and assembly instructions (see the text).
Consider this claim:
. ORIG and . END are not translated by the assembler into LC-3 machine language instructions.
Is this claim true?
Yes, it is true.
O No, it is false.
Consider this claim: . STRINGZ is an assembler directive. Is this claim true?
O Yes, it is true.
O No, it is false.
arrow_forward
C++
arrow_forward
As a result, when individuals speak about dynamic memory allocation, what precisely do they mean? What's the goal of it all? Many of the most important functions in the C programming language make it feasible to allocate memory in a dynamic manner. Please answer with code examples that are suitable for the situation.
arrow_forward
In C language Can realloc() release the memory space that was previously allocated? If so, in what way?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Related Questions
- please write with proper explanation. Question half solution is here please write what is main disadvantages of this approach? Half solve questions: Mutual Exclusion: Mutex is an abbreviation for Mutual Exclusion. It is a programme object that prevents multiple users from accessing a shared resource at the same time. When a process accesses a shared variable, it is said to be in the critical section. When no two processes are present in the critical section at the same time, this is referred to as Mutual Exclusion or Mutex. while (true) { semaphore sem = S; while (S <= 0) do no operation { S = S-1; wait (S); } /*critical section*/ while (S > 0) { S = S+1; signal (S); } /*remainder section*/ }arrow_forwardJavaScript The difference between a compiled and an interpreted language is that: Group of answer choices: a- interpreted languages create an executable file whereas compiled languages do not. b- compiled languages create an executable file whereas interpreted languages do not. c- There is no such thing as an interpreted language d- interpreted languages can execute on any machine regardless of whether the source code is present Which is correct?arrow_forwardWhat are the common challenges or issues developers may encounter when working with object serialization?arrow_forward
- in c++ languagearrow_forwardA compiled program can be supplied as an executable file. An executable file is a file that is ready to run. Since an executable file cannot be run, programmers prefer to supply executables rather than source code. What is this executable file and what differentiates it from the source code? In the Python programming language, the process of source code translation is different from that in C programming, explainarrow_forward. Explain the differences between stream socket and datagram socket with diagram. javaarrow_forward
- 4) For each of the following, list if it is a characteristic of a) Interpreted languages, b) Compiled Languages or c) languages that have compilation with Interpretation. Easy/Quick to test your program: Portability: Fastest to execute once your program has been tested: Requires that the source code be present in the client's machine: C# and Java: Javascript and Python: C, C++: 5) Describe three of the top 10 web application security risks and how it can be mitigated.arrow_forwardDefine the remote interface in protocol buffer Implement the gRPC client and server in the ballerina language Implement the server-side logic in response to the remote invocationsarrow_forwarda) What is the definition of garbage collection? b) What is System.gc() and what does it do?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr