Nascom [Microsoft] BASIC 4.7
This is the unaltered form of BASIC 4.7 for the Nascom British-produced personal computer.
This is provided solely for reference; because it makes hardware-specific calls to the NASCOM platform, it isn't for direct use on the Space-Time Productions MCB.
It does, however support the NASCOM's TTY serial data port, which is what caught my attention.
My port-over works off this design.
BASIC 4.7A
This is the version of Nascom BASIC which I modified to run on the Space-Time Productions MCB.
There are two versions, one for a 'factory' configured board with 2K of ram; the other for a modified board that has expanded ram memory from $4000-$FFFF.
Special thanks go out to Grant Searle in the UK for fixing two minor buggy problems I was having.
- BASIC1.ASM - For use on UN-modified ST Z80's with only onboard 2K Ram.
- BASIC.ASM - Tests for RAM from $4300-$FFFF and uses everything it can (48134 max).
Both versions require the Space-Time Productions Monitor Rom in the first Rom socket, BASIC is rom sockets 2 and 3.
See the menu tab for "BASIC Interpreter" to read up on this program for your board.
FORTH Language
I downloaded a very minimal FORTH language interpreter and modified the code so it would correctly work with the
Space-Time Productions SBC. It assumes the following:
- Ram from $8000 thru $FFFF
- SIO Channel A for normal communications thru Hyperterminal or your choice of Terminal Emulator
I was sucessfully able to relocate this program to $5000 and other locations, but when I tried to load it to $1000 (for burning to Rom 2 & 3) it blew up. I (sorry) don't have time to troubleshoot this right now, so I'm offering it "As is". It works quite well, just load it and Go to
$8000 to start it.
You may download:
- FORTH - Original version as I received it. Expects an 8251 UART.
- FORTH - Modified to operate on the Space-Time Productions SBC, using Z-80 SIO.
Added February 23, 2007.
Z80 Disassembler
This is the program that gave me my start with the Space-Time Productions MCB.
The core of this disassembler was borrowed from a Timex-Sinclair disassembler, written by John Kerr back in the day.
I altered the main loop routine and CHROP routine so that on entry, the routine
calls the Monitor rom routine at $0306 to request a starting and ending address into DE and HL, to call the Disassembly for this range of addresses, and then output the results to the serial port.
This is great for finding out what's going on inside your machine, or for checking your own programs for accuracy.
It consumes a little more than 1K of ram space, quite handy.
[ ASM file ] [ Intel Hex file ]
p8251 UART driver
Simple driver program to operate a p8251 UART, works similar to the code for the Z80 SIO serial input/output.
Provides routines RX8251 and TX8251, user can modify ORG, and hardware I/O address location of the UART in your own application.
[ ASM file ]
Modified DUMP command
This routine takes the Dump command that comes with the Monitor rom, and adds a useful function
of printing the (only the printable) ASCII characters to the right of the line (i.e.-
3000 00 00 00 00 00 30 31 32 33 34 35 36 20 39 00 00 .....0123456 9..
Uses a call to ($0306) to get the starting and ending address for the Dump. [ Unlike the TYPE command from the Monitor, which prints everything including control characters which screw up the
Hyperterminal display. ]
Great for determining which area is code, and which area contains text.
NOTE: This contains the ANSI library of colors, and uses Green Red and Yellow text to print.
[ ASM file ] [ Intel Hex file ]
Modified TYPE command
Type ASCII characters from memory contents from DE thru HL.
Prints a '.' where the byte is a non-ASCII or control character to avoid disrupting the display screen.
Rounds down the starting address to nnn0 and rounds up the ending address to nnnF Hex to make complete line lengths.
Several conversion and test subroutines normally inside a monitor program are also included to make this file a stand-alone program.
[ ASM file ]
HD44780 LCD Routines
My original design and file (you may have downloaded the older version before) worked around an HD44780 2x40 LCD display that was tied to ports $68 for the data and $6A for the E and RS pins. WR- was tied to ground, the device configured as a write-only device. I had taken these pins over to J-3 (for the 9513, which is unused on my board in order to hook up the LCD's 14-pin ribbon cable. Problem was a timing loop had to be run for each write to the LCD in order to avoid collisions with the controller. There is no way to read back the Busy Flag.
My design works off an interface board which is lifted above IC-17 (formerly the 9511/12 Arithmetic Processor) by way of a 24-pin wire-wrap socket. This allows the Z-80 to directly address the LCD controller at $7C (Control Register) and $7D (Data Register) and allow both read and write, as well as the all-important pre-test of the Busy Flag. This had made a remarkable improvement in the execution time for LCD calls.
The HD44780U controller has memory space for 8 custom bit-mapped 5x8 characters called CGRAM. The ASM file included here contains bitmaps for creating the image of an Eagle spaceship from Space:1999 using characters 0 thru 6 and the last custom character (7) is a right arrow for highlighting parameters on the screen.
[ ASM file ]
Stepper Motor Control
This is a short assembly file for driving a stepper motor attached to Port $68 lower D3-D0, uses switches attached to another I/O port for increasing and decreasing the motor speed. Shortest workable pulse for this motor was around 1.25 mSec. The faster the drive, the less available torque. This is a good reference piece of software if you are working robotics with this board, but after I completed this experiment I removed the motor and driver circuit from my computer.
My only idea that might have been useful was to drive an 8-ball (Attitude Indicator) with two motors, but since they are 1.8 degrees per step, it wasn't very practical without some gearing (not my forte').
[ ASM file ]
ANSI.ASM
A short test routine containing the most often used ANSI control sequences for data terminals. For a full discussion on this, check the menu option for Using ANSI Sequences.
[ ASM file ] [ Intel Hex file ]
Convert HL to ASCII characters 0-65535
Converts the value in HL into a readable numeric value. Used often in old BASIC
programs to convert two stored bytes into a readable line number.
[ ASM file ]
ASCII Integer to Binary conversion
Converts ASCII digits at location (HL) into a value 0 thru 65535, setting CY flag for any value > 32767 (in case your system using D15 bit as sign for negative numbers).
[ ASM file ]
ASCII Hex in BC to value in Accumulator
Converts ASCII Hex values stored in register pair BC into a Binary value in register A. This is a common routine in monitor programs which allows a user-entered Hex value to be converted and stored as Binary.
[ ASM file ]
Accumulator to ASCII characters in BC conversion
Converts the binary value stored in the Accumulator to ASCII printable characters stored in register pair BC. This gets a lot of mileage in most monitor programs and is called often. Usually followed by a routine like BCOUT where the B, then C registers are transferred to an output device for display.
[ ASM file ]
Precision Software Time Delay
This routine was designed to deliver precision time delays in software for timing purposes, hardware wait periods, and so forth. It can be readily called from anywhere as it is a non-destructive piece of code. Normal INTerrupts are disabled, but activation of an /NMI during execution can undermine the acccuracy of this code.
Time delay for 2 MHz Z80 system are defined as (DE * 20 microseconds) + 40 microseconds.
Time delay for 4 MHz Z80 system are defined as (DE * 10 microseconds) + 20 microseconds.
[ ASM file ]
8279 Operating System Rom
Ron Weiss sent me a file called 8279.BIN, which I have disassembled and commented as thoroughly as I can. It's included it here for your viewing pleasure. This monitor included a couple of neat features not found on the RS232 version: two breakpoints instead of one, calculated ending values both + and - of the entered values. Also includes serial routines for the SIO in high rom, since the SBC and PROM burner routines needed to be able to load an Intel Hex file. Very interesting reading, and what I consider to be good coding techniques. This was used with the keyboard/display in the photo I have over on the Hardware page.
[ ASM file ]
Z80 Eprom Downloads from Vintage Hardware and Equipment
Gas Pump Control Rom
I removed this Z80 control board from an old 'first generation digital' gas pump Jan 2011. This text file is a disassembly with some code comments. The gas pump is vintage 1984-85, a simple 2 user pump (front and back) with bright orange VFD 7 segment displays for the Cost, Gallons Pumped, and Price Per Gallon. It was a simple device and did not process any customer information, unless a set amount to pump was initiated and the counters would operate up to that value and shut off.
This is some very interesting coding style, lots of BCD number manipulation, shifting and bit testing. The I/O map is detailed at the start as much as I could ascertain from decrypting the code. The rom was 8K x 8 from $0000 thru $1FFF and the ram occupied 2K x 8 from $4000-$47FF. Two pages of the ram $4500-$45FF and $4600-$46FF are not used, but the stack occupies the $47xx page. I'm sure a couple of the ports monitored the number of turns of the gas pump(s) to record how much fuel was dispensed, and another port to read if the hose lever was lifted or not. It kept operating totals which could be accessed via pushbutton on one of the PCBs. It appears that pump enables were received serially via a Z80 DART (similar to SIO), and if set amounts were to be pumped, that text was coded in packed BCD.
Sorry, for those of you peeking, these did not handle credit cards at the pump, so there's no mysterious code that you're going to find that reveals a way to juke the system. This technology was simply too old. The pump(s) interfaced RS232 to a cashier's console which could monitor and enable the pumps activities. That's about it. But, very educational stuff.
[ TEXT FILE ]
|