Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 229 pages
Exam (elaborations)

COS2621 EXAM PACK

Document preview thumbnail
Preview 4 out of 229 pages

COS2621 EXAM PACK. Detailed working, solutions, memo, notes & explanations.

Content preview

COS2621
EXAM PACK

,COS2621 2018 MEMO

1.1

1.2 2

1.3 1

1.4 5

1.5 1

1.6 4

1.7 5

1.8 3

1.9 5

1.10 3

1.11 1

1.12 4

1.13 1

1.14 1

1.15 3

,mov ax,2h //2 cycles to execute + 4 cycles to fetch
mov bx,3h //2 cycles to execute + 4 cycles to fetch
mul bx //5 cycles to execute + 4 cycles to fetch
add ax,bx //4 cycles to execute + 4 cycles to fetch
Total cycles = 29 cycles which requires 29 x 0.00125 μsec = 0.03625 μsec




Disadvantages
1. Development time. Writing code in assembly language takes much longer than

, writing in a high-level language.
2. Reliability and security. It is easy to make errors in assembly code. The assembler is not
checking if the calling conventions and register save conventions are obeyed.
3. Debugging and verifying. Assembly code is more difficult to debug and verify because there
are more possibilities for errors than in high-level code.
4. Maintainability. Assembly code is more difficult to modify and maintain because the
language allows unstructured spaghetti code and all kinds of tricks that are difficult for others to
understand. Thorough documentation and a consistent programming style are needed.
5. Portability. Assembly code is platform-specific. Porting to a different platform is difficult.




1. Debugging and verifying. Looking at compiler-generated assembly code or the disassembly
window in a debugger is useful for finding errors and for checking how well a compiler
optimizes a particular piece of code.
2. Making compilers. Understanding assembly coding techniques is necessary for making
compilers, debuggers and other development tools.
3. Embedded systems. Small embedded systems have fewer resources than PCs
and mainframes. Assembly programming can be necessary for optimizing code for speed or size
in small embedded systems.
4. Hardware drivers and system code. Accessing hardware, system control registers,
and so on may sometimes be difficult or impossible with high level code.


5. Accessing instructions that are not accessible from high-level language.
Certain assembly instructions have no high-level language equivalent.


6. Self-modifying code. Self-modifying code is generally not profitable because it

Document information

Uploaded on
October 6, 2023
Number of pages
229
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
R44,51

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.
Sold
1100
Followers
917
Items
2067
Last sold
4 days ago


Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT 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