Close

PDP-8 Software Toolchain

A project log for PDP-8 FPGA

Building a PDP-8 on an FPGA

land-boardscomland-boards.com 04/24/2021 at 20:240 Comments

Build PDP-8 Assembler Tool

This program has been built and successfully executed on:   
Linux (80486 CPU) using gcc   
RS/6000 (AIX 3.2.5)   
Borland C++ version 3.1 (large memory model)   
Borland C++ version 4.52 (large memory model) with no modifications to the source code.
On UNIX type systems, store the the program as the pal command and on 
PC type systems, store it as pal.exe
gcc macro8x.c

Simple Test Program

I wrote a very simple test program, easy.pal . The program continually increments a memory location, at 10 (oct).

../macro8x -x easy.pal

List file is:

1 0010 *10
2 00010 0000 linep, 0
3 0200 *200
4 00200 2010 ISZ linep
5 00201 5200 JMP .-1
6 00202 5200 JMP .-2
7
No detected errors

The binary file from macro8x easy.bin as viewed in HxD (as 16-bit hex values) is:

Bin to MIF Utility

The output of the macro8x assembler is DEC bin loader format. The DEC bin format is described in DEC-OO- LBAA-D:

Wrote a utility, bin2mif.py to convert binary loader data to Altera Memory Initialization (MIF) files. The program:

Here's the output:

-- Generated by bin2mif.py
--
DEPTH = 131;
WIDTH = 12;
ADDRESS_RADIX = DECIMAL;
DATA_RADIX = OCTAL;
CONTENT BEGIN
0000: 0000 0000 0000 0000 0000 0000 0000 0000;
0008: 0000 0000 0000 0000 0000 0000 0000 0000;
0016: 0000 0000 0000 0000 0000 0000 0000 0000;
0024: 0000 0000 0000 0000 0000 0000 0000 0000;
0032: 0000 0000 0000 0000 0000 0000 0000 0000;
0040: 0000 0000 0000 0000 0000 0000 0000 0000;
0048: 0000 0000 0000 0000 0000 0000 0000 0000;
0056: 0000 0000 0000 0000 0000 0000 0000 0000;
0064: 0000 0000 0000 0000 0000 0000 0000 0000;
0072: 0000 0000 0000 0000 0000 0000 0000 0000;
0080: 0000 0000 0000 0000 0000 0000 0000 0000;
0088: 0000 0000 0000 0000 0000 0000 0000 0000;
0096: 0000 0000 0000 0000 0000 0000 0000 0000;
0104: 0000 0000 0000 0000 0000 0000 0000 0000;
0112: 0000 0000 0000 0000 0000 0000 0000 0000;
0120: 0000 0000 0000 0000 0000 0000 0000 0000;
0128: 2010 5200 5200;
END;

Loaded the easy.mif file. Got the expected warning loading it into Quartus (it's OK).

Critical Warning (127005): Memory depth (4096) in the design file 
differs from memory depth (131) in the Memory Initialization File 
"C:/Users/HPz420/Documents/GitHub/Doug Gilliland/Linux-68k/pdp8/
PDP8_Programs/easy.mif" -- setting initial value for remaining
addresses to 0.

Ran. It worked great. The code is at the correct place and increments the location 10 (oct).

Code loaded at 200 (oct) which is 0x80 (hex), Verified data changes with In System Memory Content Editor. 

And again:

Success!

Discussions