Assembly language (including following and writing simple programs with the Little Man Computer instruction set). See appendix 5d
1.2.4 Types of Programming Language
Practise exam questionsTypes of Programming Language — Note 3 of 5
Candidates need to have an understanding of the purpose and need for assembly language. They need to be familiar with the instructions given in Appendix 5d. They should be able to read, write, trace and amend programs written in the Little Man Computer language.
Assembly language uses short mnemonics to represent machine code instructions. The Little Man Computer (LMC) is a simplified model used to learn assembly language. You need to be able to read, trace, write and amend simple LMC programs.
ADD (add the value at an address to the accumulator), SUB (subtract), STA (store the accumulator in an address), LDA (load from an address into the accumulator).BRA (branch always), BRZ (branch if the accumulator is zero), BRP (branch if the accumulator is zero or positive).INP (input into the accumulator), OUT (output the accumulator), HLT (stop), DAT (label a memory location for data, with an optional starting value).loop or count.A low-level language that uses mnemonics (e.g. ADD, LDA) to represent machine code instructions. Each instruction usually translates to one machine code instruction.
STO, BR, BZ, BP, IN and END are accepted in answers.BRP branches when the accumulator is ZERO as well as positive.DAT lines before HLT. Data lines go after the program, otherwise they will be executed as instructions. INP
STA first
INP
ADD first
OUT
HLT
first DAT INP
STA count
loop LDA count
OUT
BRZ end
SUB one
STA count
BRA loop
end HLT
count DAT
one DAT 1Ready to test yourself?
Practise 1.2.4 questions