Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.
Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.

The Little Man Computer Apr. 12, 2011 in Simulations, Text, Vb.net

The Little Man Computer (LMC) is an instructional model of a computer, created by Dr. Stuart Madnick in 1965. The LMC is generally used to teach students, because it models a simple von Neumann architecture computer - which has all of the basic features of a modern computer. It can be programmed in machine (albeit usually in decimal) or assembly code.

Screenshot of the Program

For reference, here is some example code that takes numbers as input, and squares the result. Credit Wikipedia.

START   LDA ZERO     // Initialize for multiple program run
        STA RESULT
        STA COUNT
        INP          // User provided input
        BRZ END      // Branch to program END if input = 0
        STA VALUE    // Store input as VALUE
LOOP    LDA RESULT   // Load the RESULT
        ADD VALUE    // Add VALUE, the user provided input, to RESULT
        STA RESULT   // Store the new RESULT
        LDA COUNT    // Load the COUNT
        ADD ONE      // Add ONE to the COUNT
        STA COUNT    // Store the new COUNT
        SUB VALUE    // Subtract the user provided input VALUE from COUNT
        BRZ ENDLOOP  // If zero (VALUE has been added to RESULT by VALUE times), branch to ENDLOOP
        BRA LOOP     // Branch to LOOP to continue adding VALUE to RESULT
ENDLOOP LDA RESULT   // Load RESULT
        OUT          // Output RESULT
        BRA START    // Branch to the START to initialize and get another input VALUE
END     HLT          // HALT - a zero was entered so done!
RESULT  DAT          // Computed result (defaults to 0)
COUNT   DAT          // Counter (defaults to 0)
ONE     DAT 1        // Constant, value of 1
VALUE   DAT          // User provided input, the value to be squared (defaults to 0)
ZERO    DAT          // Constant, value of 0 (defaults to 0)

In the absence of any Windows desktop emulator, I created my own in .NET and here it is. View and download on GitHub.

Visiting Club Med Mar. 20, 2011 in Italy, Photos, Travel

Small Lizard Footprints in the Sand

Universal Studios Aug. 19, 2010 in Photos, Travel, United states

The Universal Studios Globe

New Zealand Water Aug. 11, 2010 in New zealand, Photos, Travel

Mountain

Harbour Beach

Hong Kong and the Chi Lin Nunnery Aug. 1, 2010 in Hong kong, Photos, Travel

Hong Kong Streets Hong Kong Harbour Hong Kong Temple

Visiting Normandy Aug. 14, 2009 in France, Photos, Travel

Exploring to Monuments, Monet’s Garden, Mont Saint Michel, and more.

War Memorial Monet's Pond

Monet's House The House

Orange Butterfly on Lavender Mont Saint Michael

Camembert Tank

Scratch Pac-Man Jul. 21, 2009 in Games

I created Pac-Man in Scratch.

Start Screen Maze

Starting the game. The maze. It changes as you clear screens.

Continue Reading...

Egyptian Manor Jun. 25, 2009 in Photos

Egyptian Manor

It's Snowing! Dec. 23, 2008 in Photos, Snow

Snow on the streets Snow on a farm

Snow in the woods Snow of a man

My New Zealand Road Trip Aug. 19, 2008 in New zealand, Photos, Travel

This year I went on a road trip from the bottom of the South Island, all the way to the top of the North. It was a great trip. I got to see some amazing places, spend time with relatives, and overall I have a fantastic time.

Route

This is the route. From London I flew to Singapore, stayed a couple of days, then flew to Auckland. Then I boarded a plan from Auckland to Wellington, and then from Wellington to Queenstown. In total, that is well over a day of flying, and considerably more when you consider how long you have to be in an airport before an international flight. When combined with the twelve (ish) hour time difference, that’s a hell of a lot of jet lag. But the holiday was just beginning.

From there I travelled up the South Island towards the Cook Straight where I boarded a ferry. Once disembarked, I travelled from Wellington to Auckland where I concluded my time in New Zealand. It was an amazing experience.

To conclude the journey, I boarded a flight from Auckland to Singapore where I was to relax on Sentosa Island for a few days. And finally, the last flight back to London. It was all over.

Map of New Zealand Aerial of New Zealand

And an aerial shot showing the lush greenery, mountains, and emptiness of New Zealand. In total the country has a population of around five million. This is less than London, but larger than Berlin or Paris. Maps courtesy of Google Maps.

Continue Reading...

Get an email when I post, zero spam     Get an email when I post     Newsletter