2.4 Types of Programming Language (OCR A Level Computer Science) Flashcards

Exam code: H446

1/32

0Still learning

Know0

  • Define programming paradigm.

Cards in this collection (32)

  • Define programming paradigm.

    A programming paradigm is a set of conventions and practices that dictate how computer programs are structured and developed.

  • Object-oriented programming organises code around                             rather than functions.

    Object-oriented programming organises code around objects rather than functions.

  • What is the main difference between procedural and object-oriented programming?

    Procedural programming is structured around procedure calls, while object-oriented programming is organised around objects that combine data and functionality.

  • Define assembly language.

    An assembly language is a low-level mnemonic representation of machine code for a specific computer architecture, using registers, mnemonics, and memory addresses.

  • True or False?

    Procedural programming is best suited for managing complex states and behaviours in large applications.

    False.

    Procedural programming is not ideal for complex states or behaviours; it can become unwieldy and hard to manage as the system grows.

  • One strength of object-oriented programming is                       , which allows code to be reused.

    One strength of object-oriented programming is inheritance, which allows code to be reused.

  • Name one key weakness of assembly language.

    One key weakness of assembly language is its lack of portability, as it is hardware-specific.

  • Why do new programming paradigms arise over time?

    New programming paradigms arise and existing ones adapt in response to changes in computing and software challenges.

  • Define procedural programming.

    Procedural programming is a method of writing software where tasks are broken down into a sequence of step-by-step instructions.

  • In procedural programming, code is grouped into           and          to promote reuse and improve clarity.

    In procedural programming, code is grouped into functions and procedures to promote reuse and improve clarity.

  • What is the role of variables in procedural programming?

    Variables are used to hold the program's state, storing data values that can change during the execution of the program.

  • A          is used for decision-making, while          is used to repeat actions in a program.

    A selection is used for decision-making, while iteration is used to repeat actions in a program.

  • Define subroutine.

    A subroutine is a reusable block of code, such as a function or procedure, that performs a specific task within a program.

  • True or False?

    Constants store values that can change during program execution.

    False.

    Constants store values that remain unchanged throughout program execution.

  • The          of execution in procedural programming is determined by              .

    The flow of execution in procedural programming is determined by control structures.

  • What is the purpose of file handling in procedural programming?

    File handling allows a program to read from and write to files, enabling data storage and retrieval outside the program’s immediate execution.

  • Define assembly language.

    An assembly language is a type of programming language that sits between high-level languages and machine code, allowing direct access to hardware and efficient, low-level programming for a specific CPU.

  • What is the Little Man Computer (LMC)?

    The Little Man Computer (LMC) is a simplified model of a computer used for teaching the basic functions of a CPU, including memory, an accumulator, and an instruction set.

  • What is the main advantage of using assembly language compared to high-level programming languages?

    Assembly language allows developers to write more efficient and hardware-specific code compared to high-level languages, enabling direct manipulation of the computer's hardware.

  • True or False?

    Each CPU type has its own specific assembly language.

    True.

    Each CPU's architecture is different, so its assembly language instructions are unique to that CPU type.

  • Define the HLT instruction in LMC.

    The HLT instruction tells the Little Man Computer to halt or end the program.

  • In Little Man Computer, the        instruction is used to load a value from memory into the accumulator.

    In Little Man Computer, the LDA instruction is used to load a value from memory into the accumulator.

  • What is the role of labels such as checkMax in LMC programs?

    Labels like checkMax are used as markers for branching instructions, allowing the program to jump to specific parts of the code based on conditions.

  • The      instruction in LMC is used to add the value in a specified memory location to the           .

    The ADD instruction in LMC is used to add the value in a specified memory location to the accumulator.

  • Define addressing mode.

    An addressing mode is a way in which an instruction in assembly language or machine code can access data stored in memory.

  • Define immediate addressing.

    In immediate addressing, the operand is part of the instruction itself. For example, MOV AX, 1234h moves the immediate value 1234h to the AX register.

  • Define direct addressing.

    In direct addressing, the memory address of the operand is directly specified within the instruction. For example, MOV AX, [1234h] transfers the value stored in memory location 1234h to the AX register.

  • Define indirect addressing.

    In indirect addressing, a register contains the memory address of the operand. For instance, MOV AX, [BX] moves the value from the memory address held in BX to the AX register.

  • Define indexed addressing.

    In indexed addressing, the effective address is computed by combining a base address with an index. For example, MOV AX, [BX + SI] fetches data from the address BX + SI and moves it into AX.

  • True or False?

    Indirect addressing means the instruction contains the memory address to access data directly.

    False.

    Indirect addressing uses a register to hold the memory address, rather than specifying the memory address directly in the instruction.

  • In assembly language,         addressing includes the operand within the instruction itself, while        addressing specifies the memory location of the operand.

    In assembly language, immediate addressing includes the operand within the instruction itself, while direct addressing specifies the memory location of the operand.

  • What addressing mode does the instruction ADD AX, [BX] use, and what does it do?

    This instruction uses indirect addressing. It adds the value from the memory address held in the BX register to the AX register.

Sign up to unlock flashcards

or