Little Man Computer - Simulator Applet

Nope, not like that. If you have specific plans, PM me and I’ll make up my mind.

Paste: If you have anything from passwords to bank accounts in your clipboard the program will be able to pick it up.
Copy: Overwrite something important you have in your clipboard without asking you. :slight_smile:

Mike

I can’t help thinking: Worrying about our ctrl-c-ed porn links, are we?

I will but not soon. My idea is kinda same as this, but different goal.

First: with those arguments, you could ban copy/paste entirely from an OS
second: whatever is in the clipboard isn’t very safe. one of the browsers, if you copy a link, then close it, clipboard is empty

[quote]If you have anything from passwords to bank accounts in your clipboard
[/quote]
Obviously - so don’t be that stupid.

Passwords are on my clipboard all the time, for either a limited time or for the duration of one paste, because I use a password manager that generates passwords like this: jGHt%6j#]KJ,Xsh%2

I hardly think using a proper password manager is stupid. The real problem is that there isn’t any consumer OS with the concept of a secure clipboard.

You’d be surprised with how little most computer users think about security :slight_smile:

Mike

Saykureti? What’s that?

Sorry to necropost, but I’m VERY interested in using your Little Man Computing app with my students this term, and I suspect others may too.

I’m switching to teaching GCSE Computing this year, from ICT. One of the programming research components has students use LMC to investigate ‘bottom line’ computing, learning how computers shift bits around, seeing how memory is used at low-level, etc. Unfortunately, the LMC app they recommend:

http://www.atkinson.yorku.ca/~sychen/research/LMC/LittleMan.html

doesn’t work very well in any of my (Mac) browsers, specifically the text boxes are too small and only display one character, not much use when the box contain ‘901’ and all I can see is a centre ‘0’. Definitely not good for students putting screenshots into reports…

So I went looking for an alternative LMC app… and there aren’t any! The idea is well documented, but implementations are thin on the ground. Yours is excellent, especially the syntax colouring and single-stepping with line highlight. Unfortunately, I’m new to Java and can’t figure out how to get this to be a standalone app, even though you kindly posted the source. I downloaded Eclipse, did the intro-tutorials, then pasted your code as a new project, but both ‘checkAddress’ and ‘execute’ are marked with red crosses, I think because ‘EmulatorCrash cannot be resolved to a type’. Do I need to load a library/module/something to make this work? I did google ‘EmulatorFeedback’ and ‘EmulatorCrash’ but the only results point back to your page, which makes me think this is something specific to your code that I’m missing.

Alternatively, can I download the finished .jar file somehow? Not as good as having the source to go through with the students, but better than having to have them load the LMC from the discussion page!

John.

PS No offence, but the anti-spam sign-up requirements for this BB are mighty steep for someone just wanting to ask a casual question!

We use MIPS in our uni, it’s made in pure java too.

http://courses.missouristate.edu/kenvollmar/mars/

[EDIT]: Oh you want to run it directly in the browser? Nvm then.

But if you run it as an applet only isn’t it hard to save and load previous code snippets?

The students have to use LMC - not even 100% sure yet whether I’m even allowed to suggest a different implementation of LMC than the one they’ve suggested in the materials, but I’d at least like to have a standalone exemplar page I can direct the exam board to.

Regards HOW it runs, I’m happy either in-browser or as a standalone app. Currently I can’t figure out how to make either of them work. I’ve now downloaded the NetBeans environment too, but although I can make Hello World work there, the LMC code still chokes with the same error.

John.

Thanks for your interest in this project!

Download the JAR file: here and double-click it. It will immediately launch the application.

[quote=“johnkershaw,post:29,topic:37277”]
That’s exactly the reason I coded this LMC simulator: existing implementations were crap, often to the point of being unusable. Teaching students LMC without a parser & compiler is just cruel.

[quote=“johnkershaw,post:29,topic:37277”]
The posted sourcecode was the core of the simulator, and didn’t contain any user-interface code, or code to parse and compile input.

I agree with your observation, but our experience is that anything less hard will cause a huge influx of (human!) spammers. Sorry for the inconvenience!

Thanks a million - that’s fantastic! Would you be okay with me approaching the exam board to offer this as an alternative LMC for project work? As I said, they are currently basing an entire chunk of the curriculum on a single implementation from a guy at York University, which doesn’t offer the source code and could disappear at any moment! On that note (and because I’d still like to have a crack at compiling some ‘real’ Java source) would you be happy to post the complete source?

Thanks again for an excellent resource.

John.

Sure.

I didn’t quite ‘agree’ with the proposed syntax on wikipedia (which is just one of the proposed versions on the web). Therefore, there are a few bits you need to know:
[x] There is no support for the DAT mnemonic
[x] I added a way to directly assign a value to any value in memory: @96 145 (put 145 in mailbox 96)
[x] labels are defined using: label: ...
[x] labels are refered to using: ... :label (you can use and refer to a label on 1 line)
[x] mnemonics and raw opcodes/values can be used interchangeably (which is why we don’t need the DAT mnemonic)

[quote=“johnkershaw,post:33,topic:37277”]
The source code is not really worth it, really. For the UI it’s poor code quality all the way down, the syntax highlighter, parser & compiler are a bunch of regex, and the ‘core’ that’s properly written is already posted in this thread :slight_smile: It’d rather keep it closed source, for the simple reason that it wouldn’t end up in the hands of those novice students :slight_smile:

Hi,

I’ve created a page for my students to use this week:

Let me know if you’re unhappy about any of it or if I’ve mis-representated anything. If you’re happy I’d like to email a link to the page to the OCR exam board to check they’re happy with my students submitting their work on your emulator.

Thanks again,

John.

I’d say for the sake of clarity, your examples of ‘my syntax’ would be a little clearer if you didn’t write uninitialized variables as label definitions only, but adding a 0 after it:


var1 DAT   // wikipedia syntax
var1 DAT 0 // wikipedia syntax (explicit)

var1:   // my syntax #1 (might raise a few eyebrows)
var1: 0 // my syntax #2 (which I think is clearer)

Sounds great. If there are any showstoppers, notify me, and I’ll see what I can do.

Goddamn, I’m now addicted to this thing again. There goes the next few hours…

Share the code you came up with. The nastier the tricks the better. Self modifying code is mandatory.

I agree, but I was trying to make as few changes to the original code as possible. Possibly it’s making the point that all memory ‘starts off’ with a default value of zero and therefore doesn’t need initialising explicitly, though that approach doesn’t hold water after the first run after the machine boots up (or even partway through the first run!).