Types of programming languages (3)

Resources | Revision Questions | Computer Science

Login to see all questions

Click on a question to view the answer

1.

Consider the following snippet of assembly language code (using a hypothetical instruction set):

    MOV R1, #10
    MOV R2, #20
    ADD R3, R1, R2
    STORE R3, [location]
  

What is the purpose of the assembler in relation to this code? Explain what each line of assembly language code does in terms of its operation.

2.

Explain how a compiler works, outlining the different stages involved in the compilation process. Include the roles of lexical analysis, parsing, and code generation.

3.
A computer scientist argues that the choice of programming language is a crucial factor in determining the efficiency of a software project. Discuss this statement, considering the trade-offs between high-level and low-level languages. Provide specific examples to support your answer.