levo

Types of Programming Language

Assembly language and the Little Man Computer

  • 2 things to know
  • Component 01

Overview

Recall questions on assembly language and its instruction format, the Little Man Computer, its accumulator and DAT, tracing and writing LMC programs with BRA, BRZ and BRP, value limits, and executing an ADD instruction.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

In the Little Man Computer, what is the difference between BRA, BRZ and BRP?

Key term

A student uses BRP to loop while a counter is greater than zero, and finds the loop runs one time too many. Explain.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is assembly language?

    Model answer

    A low-level language in which each instruction corresponds to a single machine code instruction, written as a short mnemonic - such as ADD or STA - with an operand, instead of as a binary pattern. It is translated into machine code by an assembler and is specific to one processor family's instruction set.

  2. 2

    Give two advantages and two disadvantages of writing in assembly language rather than a high-level language.

    Model answer

    Advantages: complete control over the processor, registers and memory, so the code can be made as small and as fast as the hardware allows; and direct access to hardware features that a high-level language may not expose, which matters for device drivers and embedded systems. Disadvantages: it is slow to write and very error-prone, because everything must be spelled out at the level of individual instructions; and it is not portable, since the program only runs on the processor family it was written for and must be rewritten entirely for any other.

  3. 3

    What is the general format of an assembly language instruction?

    Model answer

    An opcode - the mnemonic saying what operation to carry out - followed in most cases by an operand, which is the data to act on or the address of that data. Some instructions, such as one that halts the processor, need no operand. Lines may also carry a label, which names that memory location so it can be referred to elsewhere without knowing its actual address.

  4. 4

    What is the Little Man Computer?

    Model answer

    A simple model of a computer used to teach how a processor really works. It has a single accumulator, a program counter, an input and an output, and a hundred numbered mailboxes acting as memory, each holding one instruction or one item of data. It has a very small instruction set, so complete programs can be written and traced by hand.

  5. 5

    In the Little Man Computer, what is the accumulator used for?

    Model answer

    It is the single register in which arithmetic is done and through which almost all data passes. A value is loaded into it from a mailbox or from input, added to or subtracted from, tested by the branch instructions, and then stored back to a mailbox or sent to output. Because there is only one, a value that is needed later must be stored before the accumulator is reused.

  6. 6

    What does the DAT instruction do in the Little Man Computer, and why is it not really an instruction?

    Model answer

    It reserves a mailbox to hold data rather than a program instruction, and optionally sets its initial value. It is an assembler directive: it generates no operation for the processor to carry out, it simply tells the assembler to set that memory location aside, usually with a label so the program can refer to it by name.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Types of Programming Language, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.