IBCM Interface

To get started programming IBCM programs, there are two documents (both listed on the documentation section of the main page): the IBCM Principles of Operation describes the IBCM language and all of the 16 available instructions, and the IBCM code examples lists, and explains, two programs that have been written in IBCM. Those programs can be downloaded directly here and here.

The IBCM is not a real computer, of course. Nonetheless, one can run programs written for it. The trick is that we have written a PHP/Javascript "simulator", a program that makes another computer behave more-or-less like the IBCM 2.2. The IBCM 2.2 simulator will execute all the instructions of the machine and show the contents of memory locations and the accumulator as it executes.

To load a file, use the Browse button at the top of the simulator page. Find the IBCM file, and click on the "Load" button. The format of your program file is very rigid -- the first four characters of each line are interpreted as a hexadecimal number. The number on the first line is loaded into location zero, the next into location one and so on. Characters after the first four on each line are ignored, so you should use them to comment the code. An invalid file will either not load up at all, or will load up gibberish.

The left side of the simulator lists all the memory locations (using the hexadecimal address), the value in memory (if any), and the PC (program counter) value. Note that any blank value field is interpreted as'0000', as per the IBCM specification. The simulator leaves uninitialized values blank to increase readability.

The value column consists of a series of text boxes, which allow you to directly edit the values in memory. The simulator will read the current memory location from the appropriate textbox when executing an instruction. You can undo any edits by using the Revert button, described below. The IBCM simulator does not check to ensure that your entered values are valid -- it is up to the user to do this. Note that all hexadecimal values must be 4 digits (i.e. '0000', not '0'), or else the simulator will not work correctly. Be sure to read the section about crashing browsers and losing your work, below. There is no way to save your edited work -- you will need to copy the changes by hand. This is party due to a browser limitation, and partly due to the fact that memory editing is meant to be a debugging tool, not a means to write entire IBCM programs from scratch.

The 'PC' column lists the current value of the program counter. It can have three values. Normally, it will have a left pointing arrow ('<-'), which indicates the next instruction that will be executed. If the simulator is waiting for input, it will have a capital 'I' (for Input) next to the input instruction that is currently awaiting a value. Lastly, if the program has halted, then a capital 'H' (for Halt) will be next to the halt instruction that was executed.

On the right side, the values of the accumulator and program counter are listed, both in hexadecimal notation. The PC field will also list, next to the hexadecimal address, if the simulator is awaiting input or is halted. The Input box is used to read in user input when a program requests it. When the simulator is waiting for input, it will flash the 'Input' text. In addition, the simulator will specify which type of input is being requested: 'hex' or 'asc' for hexadecimal or ASCII input, respectively. Note that for entering a hexadecimal value, you do not need to enter all 4 digits: i.e., you can enter '12' instead of '0012'. This is distinctly different that editing memory locations (you have to enter all 4 digits for those). If you enter multiple characters for ASCII input, it will only read in the first one.

Below this are four buttons. Two control execution: Run, which will start a program executing, and Step, which will execute a single instruction. Note that Run will execute until either a halt command is reached, or until an input command is reached. The other two buttons control the resetting of the IBCM program. The Reset button will reset the PC and accumulator, in effect allowing the program to run again. It will not, however, modify any memory locations. The Revert button will do what a Reset does, but will also reload the memory locations to what they were when the file was last loaded (it does not load the file from disk again). Thus, if you have edited any of the memory locations (or the IBCM program has modified them), then those changes will be erased on a Revert, but not on a Reset. Note that a Revert will not modify memory addresses outside the range that was loaded (i.e. any 'blank' values).

Any output is displayed in the text area below these buttons. Each output command prints the value (hexadecimal or ASCII character) on a separate line.

A few notes: