comp229-exercises-solution-2

comp229-exercises-solution-2 - System software Review...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
System software Lesson 2 – Assemblers comp229 Department of computer science Page 1 of 8 Fall 2003 Review exercises 2.1 Modern operating systems are written mostly in high-level language (e.g. C/C++) but a small portion is still written in assembly language. Provide a brief explanation about the reason that motivates operating system designers to still use assembly language. Assembly language is not very efficient to implement the logic of complex applications but it is sometimes necessary to use it in order to access some low-level features of the machine that are inaccessible with a high-level programming language. C/C++ programming languages were mainly invented to allow system programmers to access conveniently the low-level features of the machine but they were unable to provide full access. Also, the use of assembly language provides a better execution performance than higher-level languages because a compiler does not always generate an optimal machine code. Therefore, the critical parts of an operating system that interface directly with the hardware and that require an optimal performance are mostly implemented in assembly language. 2.2 Give a consequence of the use of assembly language in the implementation of an operating system. The parts that are written in assembly language must be modified when the operating system is ported to another machine architecture. 2.3 Explain the difference that exists between an assembly language statement and an assembly language directive. An assembly language statement is an instruction that will be converted into machine code to be executed by the processor. An assembly language directive is a command to the assembler and will not be converted to machine code. 2.4 Consider the following SIC assembly language program : 1 DIGIT START 1000 2 F I R S T S T L R E T A D R 3 R L O O P T D I N P U T 4 J E Q R L O O P 5 R D I
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
System software Lesson 2 – Assemblers comp229 Department of computer science Page 2 of 8 Fall 2003 1 4 J C A L L S U B 15 CALLSUB JSUB DISPLAY 1 6 L D L R E T A D R 1 7 R S U B 1 8 I N P U T
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/25/2010 for the course COMP COMP229 So taught by Professor Guy during the Spring '10 term at Concordia Canada.

Page1 / 8

comp229-exercises-solution-2 - System software Review...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online