| Home | Job | Pinball | Photo Album | Automotive | Press/Awards | Contact |
One area that I have not previously explored is the development of my own ROMs for the 6802. To get started in this area, I looked into several cross-assemblers, and settled on the A68. One appealing aspect is that it is a small, portable (143 kbytes) DOS command line application. My first goal was to write a small assembly program that demonstrates the basic interactions I would need and then decide later how far to take it. This initial program would 1)read ROM, 2)write and read RAM, and 3)do some PIA output toggling. It would also 4)demonstrate the Reset and Interrupt vectors.
The first thing to figure out is how to set up the code to run. From reading the datasheet on the 6802, the CPU core uses the word at the top of memory as the vector to jump to after a Reset (this is known as the Reset Vector). One important thing to note is that on System 11 (my first target system), the U27 ROM is located starting at address 0x8000. It is a 27256 (a 32kbyte) device. So it spans from CPU address 0x8000 to CPU 0xFFFF. This needs to be taken into account in the constants in the ROM. An example with a super minimal program illustrates this:
; Top of
program
LOOP
ORG $3FFF
JMP $BFFF
; Set up Reset Vector
ORG $7FFE
FCB $BF,$FF
END
I have been using a Dataman S4 for several years to program ROMs, and I know it has an emulator mode. I had initially assumed that I needed to connect the CPU board (the target location) to the ZIF socket where the ROM normally goes, but after emailing the manufacturer, I learned that a special emulator cable plugs into the back of the programmer.
This cable effectively turns the S4 into a ROM chip that can be easily changed and updated via its serial cable. I therefore didn't need to constantly burn and erase ROMs to try code revisions.

S4 (right) plugged into the System 11 board.
The above images shows the development environment. The S4 is plugged into the System 11 board at the U27 ROM location, and the CPU chip is plugged into a breakout board that allows me to connect in my Logic Analyzer. This latter tool allows me to observe what the CPU chip is doing and do general code debugging.
The power of this setup
is shown by the fact that I can edit the assembly file and
then have that code running on the board in mere seconds.
I can repeat this cycle quickly without having to burn
and UV erase any PROMS. As a note, the hex file that
A68 generates can be transferred directly into the S4
without any processing (set S4 to hex mode).
In Nov 2024, I found out
that there is an EEPROM version of the 27256, which is the
28C256. Unfortunately, (to my annoyance) I found out
that the 27C256 and the 28C256 are not exactly pin
compatible. For the latter to be used in a location
for the former, pins 1 and 27 need to be swapped.
Using a web search, I found the above adapter on
Tindie. The DIP switches allow the above pins to be
swapped or not.
I purchased a few Atmel
28C256 on Amazon for a few dollars each. My Dataman S4
programs these although I do need to change from the
conventional library to the EEPROM one. I suspect
using this vs the emulator would not be quite as fast as I
need to move the part from the programmer to the
board. But it would require less setup than the
emulator.
The sample program (see link below), was assembled and then loaded into the S4 ROM emulator. The Logic Analyzer result is shown on the right side of the image below. This simple program demonstrates most of the goals set above.
Assembly listing on the left and the Logic Analyzer samples of the Address and Data Bus on the right.
org $F000 ; Put main near top of ROMThe code assembles to a small .hex file and that is easily copied to my S4 programmer. I do have to 'move' the code from top of CPU address space (0-0x0FFFF) to top of PROM (0-0x1FFFF).
main nop
lda #$55
sta $0400 ; write RAM
lda #$7A
sta $0401 ; write RAM
lda $0400 ; read RAM
lda $0401 ; read RAM
nop
jmp main ; Loop
(c) 2024 Edward Cheung, all rights reserved.