Questions tagged [little-man-computer]

Little Man Computer (LMC) models an instructional Von Neumann computer architecture and uses assembly language.

Little Man Computer (LMC) models an instructional Von Neumann computer architecture and uses language. It is mostly used for educational purposes.

Questions about programming issues involving LMC should clarify which simulator the code should run on, as there are different interpretations on how a LMC should work with negative numbers and overflow.

There are several simulators available on the web, including those published by:

These take assembly code as input and run the program visualising the process.

For more info, see:

90 questions
3
votes
2 answers

What happens to instructions given to the Little man in the LMC that begin with 4?

This might be a really strange question, but I have been doing some work on the little man computer and it mildly annoys me that not only is there no operation code number 4, but there is absolutely no information on the internet as to why. The…
3
votes
2 answers

Why no Multiply or Divide function in Little Man Computer

Hello I am currently using Little Man Computer for a school project and I understand that LMC has an ADD and a SUB function. However I understand that there is no Multiply or Divide function in LMC and I would like to know why that is.
HassanIM
  • 31
  • 2
3
votes
1 answer

Count down from 10 to 0: just displays -201

LOOP LDA COUNT SUB 1 STA COUNT OUT BRA PROGEND HLT COUNT DAT 11 ONE DAT 1 To me it seems pretty basic and simple and in my knowledge of maths, it should work: evidently it is not. So help pls
2
votes
2 answers

Input three numbers into the LMC and output them largest to smallest?

So, I've managed to get the bulk of the problem done however I can only output from largest to smallest if the input values are ascending? first = 10, second = 20, third = 30. How would I output this properly if the values were different? (Say,…
user17107474
2
votes
1 answer

Fetch - execute cycle for LMC instructions

I have to define the steps for each Little Man Computer instruction (ADD, SUB, BR, BRP etc.), and I'm having trouble with the branching instructions and COB (or the Halt instruction). I understand the fetch portion where each instruction begins…
2
votes
2 answers

Is Little Man Computer still relevant?

I´m trying to learn how computers actually works, I found some simulator software but the seem to be very complex (I´m still a beginner). I saw Little Man Computer (LMC) which is very old. I´m afraid the way the software works is not what exactly…
2
votes
1 answer

LMC: base conversion from decimal to base 9 included

I am trying to create an LMC assemble code that will allow a user to put two inputs: a decimal number and a base that the number should be converted to. The code should be able to convert any decimal number to any base between 2 and 9 included. I am…
NaiMomo
  • 21
  • 2
2
votes
1 answer

How to have the LMC(Little Man Computer) output digits that start with zero?

I need to output binary conversions(which I understand how to do). The issue I am having is that the LMC seems to not be able to print three zeros or '000'. Any idea how to get the program to perform this behavior? If this is a terrible question…
Justin Duncan
  • 88
  • 1
  • 6
2
votes
1 answer

How can I store an unknown number of inputs in different addresses in LMC (little-man-computer)?

I want to create a code that ask the user to input a number n, then ask for n inputs and store them all in different addresses so they can be read as instructions to be executed. However, I'm stuck, because I don't know how to store n inputs in n…
2
votes
1 answer

LMC (ASM) Counting Loop

LMC is a learning tool over @http://gcsecomputing.org.uk/lmc/index.html and a set of problems are "Write a program to output the numbers 1 to 10 in ascending order. Write a program to output the numbers 1 to 10 in descending order." Using the…
alrightthen
  • 21
  • 1
  • 4
1
vote
1 answer

Writing a program to convert multiple Roman numerals to a base-10 decimal number

I have written a Little Man Computer program to solve the following code challenge. But it doesn't produce the expected results. The code challenge The program should convert a given Little Man number into a number using the base-10 number system. A…
1
vote
1 answer

How can you reverse a list in LMC language?

I have a list in LMC and I would like to try to reverse it like so : tab dat 111 dat 222 dat 333 dat 444 dat 555 tab dat 555 dat 444 dat 333 dat 222 dat 111 -I tried to find…
jauwac
  • 11
  • 2
1
vote
1 answer

LMC program to recognize if a number doesn't evenly divide into another

I am trying to create a program in LMC which checks if a number evenly divides into another one (such as 10/2), with the program below I am able to do divison and halt the program as required INP STA DIVIDEND INP STA…
Aiitn
  • 13
  • 2
1
vote
1 answer

LMC program that will produce the sum of the median and twice the smallest of 3 inputs

so I've been tasked to create a little-man-machine program that will take 3 distinct inputs and produce the result of the median + 2 * the smallest number. So far I've managed to produce an output that produces the smallest number of the 3 inputs.…
1
vote
2 answers

How to produce dividend and remainder in a little man computer program?

I am trying to write a LMC program that takes two integer inputs, divides them, and produces the quotient and remainder. To start, I broke down the problem into 4 stages: 1.Divide num1 by num2 to get the quotient, q. 2.Multiply q and num2 to get the…
1
2 3 4 5 6