HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A made-up assembler turns each instruction into 8 bits: a 4-bit operation code followed by the…
HardComputer ScienceHigh School (9–10)Computer Science › Software, Languages and TranslatorsNumericalIGCSE

A made-up assembler turns each instruction into 8 bits: a 4-bit operation code followed by the…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A made-up assembler turns each instruction into 8 bits: a 4-bit operation code followed by the address as a 4-bit binary number. The operation codes are LDA 000100010001, ADD 001000100010 and STO 010001000100.

The program is LDA 7, ADD 9, STO 10.

  1. Write the machine code of each instruction.
  1. The machine code of ADD 9 is read as one 8-bit binary number. What is it in denary?
  1. How many bits of machine code does the program have?

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Machine code is binary and is the language of the processor. Assembly language is low level: it uses mnemonics such as ADD, and an assembler translates it into machine code. A high-level language is easier to read, write and debug and is machine independent. A low-level language can manipulate the hardware directly.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Step 1. LDA 7. 000100010001 then 7=01117 = 01117=0111: 0001 0111.

Step 2. ADD 9. 001000100010 then 9=10019 = 10019=1001: 0010 1001.

Step 3. STO 10. 010001000100 then 10=101010 = 101010=1010: 0100 1010.

Step 4. ADD 9 in denary. 001010010010100100101001 has 1s in the places 323232, 888 and 111: 32+8+1=4132 + 8 + 1 = 4132+8+1=41.

Step 5. The bits. 333 instructions of 888 bits: 3×8=243 \times 8 = 243×8=24 bits.

Answer: (a) 0001 0111, 0010 1001, 0100 1010. (b) 414141. (c) 242424 bits.

Check. The assembler does a fixed swap for each mnemonic. That is why each line of assembly language matches one machine code instruction.

Log in to save this for later
← All Problems
← A team writes an app for a school timetable…Say whether each statement is about a compiler or an interpreter… →
More onComputer Science › Software, Languages and Translators

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. A programmer uses the identifier TotalPrice, which has 10 letters, 25 times in a program…Medium
  2. Name the function of an IDE in each case…Easy
  3. In a model with made-up times, a program takes 3 s each time it is run with an interpreter…Hard
  4. A programmer uses an interpreter while she writes a game…Medium
  5. A program has eight lines. Line 5 has a missing comma and line 7 has a missing bracket, so neither…Medium
All problems on this topic →