Monday 16 July 2012

NRI832 Assembler now available.

Now you can write NRI832 code using an assembler. The assembler takes source files and creates a binary output file, and a source/object listing.

The assembler is written in Python and requires version 2.7. The archive includes the multiplication and division routines, and a version of the divide code using the paging system.

To use it, you need to run it as a Python script from the command line (okay, Visual Studio 2012 it is not .....) and pass source file name(s) as a parameter.

As well as producing hexadecimal listing, it also produces a 737 octal listing (i.e. an octal number representing bits 5,6,7, bits 3,4, and bits 0,1,2. The reason for this is that the hardware version won't use toggle switches but a 3x4 keypad (see piccy), and the operation codes are better suited to 737 format than 377 format.

I am using a 3x4 keypad because .... that's what I've got in my box of electronic bits and bobs. Actually a 4x4 keypad allowing Hexadecimal opcodes wouldn't be as clear and the octal keypad gives four keys for controlling the machine. Using a 737 format gives you the opcode as the first digit and the operand as the last two. However it is a bit of a daft thing for constants. So it'll be one of these, 8 LEDs, 8 resistors and an Arduino Uno.

I wasn't ever actually going to reproduce the physical controls of the NRI832. I do not have 128 toggle switches for one thing. If I did I wouldn't want to spend hours wiring the things up along with the multiplexer circuits. It would be a nightmare to program anyway. The toggle switches aren't too bad, but memory locations 16-31 (the TTL Ram) you have to write a little program to load the code into there and you can't really check it.

It also outputs a URL which for Linux (yo !) and iMac (rich or what ?) users means you can write click on it and open the object code in the javascript version, in the same way the multiply example works. Windows users will have to cut and paste it into the browser bar.

However, the assembler does support the subroutine calls mechanism described earlier and the javascript emulator does not.

No comments:

Post a Comment