MC3 monitor 1.1
A computer won't do you much good without software. We need some way to start the system and get data in and out. In a microcomputer this is often referred to as the monitor. It's a small piece of software, usually in ROM, that handles basic functions like putting characters on the screen, reading from the keyboard, loading data and executing code. My monitor is loosely based on Motorola's MIKBUG but with some changes and additions. The main functions on the MC3 monitor - Initializes the system after reset - Sets up a vector jump table for various functions - Handles the serial console - Loads S19 files into memory - Display contents of memory - Modify contents of memory - Examine stack contents and stack position - Manual I/O page select Reset sequence 1. Initialize stack pointer 2. Initialize vector table 3. Initialize serial interface 4. Select initial I/O page (page 7) 5. Disable CPU internal RAM 6. Goto prompt Commands in the monitor - G Go (RTI) - J Jump to address - L Load S19 from console - MC Memory change - MD Memory dump - RR Print contents of stack - RS Reset stack pointer - RC Change stack CC - RA Change stack A - RB Change stack B - RX Change stack X - RP Change stack PC - P Select I/O page Vector table The monitor sets up a vector table in RAM for access to various routines. Each vector consists of three bytes. A jump ($7E) and then the address to the routine. This allows software to use different routines for these functions. CONSVEC EQU $7FE5 CONSOLE STATUS VECTOR CONOVEC EQU $7FE8 CONSOLE OUTPUT VECTOR CONIVEC EQU $7FEB CONSOLE INPUT VECTOR TMOFVEC EQU $7FEE TIMER OVER FLOW INTERUPT VECTOR TMOCVEC EQU $7FF1 TIMER OUTPUT COMPARE INTERUPT VECTOR TMICVEC EQU $7FF4 TIMER INPUT CAPTURE INTERUPT VECTOR IRQVEC EQU $7FF7 IRQ INTERUPT VECTOR SWIVEC EQU $7FFA SWI INTERUPT VECTOR NMIVEC EQU $7FFD NMI INTERUPT VECTOR The interrupt vectors are a mirror of the CPU vectors. After initialization these all points to an RTI that effectively disables the interrupt. One exception is the SWI vector that points to a stack printout and then back to the monitor prompt. Pressing 'G' will continue execution after an SWI. The three vectors for handling the console I/O are CONSVEC, CONOVEC and CONIVEC. Think of them as stdin and stdout in the Unix world. They point to the routines for the console interface and can be changed and redirected for other output or input. CONSVEC - Status vector. Returns the number of characters in buffer in A-acc. CONIVEC - Input vector. Returns a character in A-acc. CONOVEC - Output vector. Sends a character in A-acc. Jump table The beginning of the monitor ROM consists of a jump table to common routines further into the ROM. RETURN EQU $C000 RETURN TO PROMPT OUTCHAR EQU $C003 OUTPUT CHAR ON CONSOLE INCHAR EQU $C006 INPUT CHAR FROM CONSOLE AND ECHO PDATA EQU $C009 PRINT TEXT STRING @ X ENDED BY $04 OUTHR EQU $C00C PRINT RIGHT HEX CHAR @ X OUTHL EQU $C00F PRINT LEFT HEX CHAR @ X OUT2HS EQU $C012 PRINT 2 HEX CHARS @ X OUT4HS EQU $C015 PRINT 4 HEX CHARS @ X INHEX EQU $C018 INPUT 1 HEX CHAR TO A. CARRY SET = OK INBYTE EQU $C01B INPUT 1 BYTE TO A. CARRY SET = OK BADDR EQU $C01E INPUT ADDRESS TO X. CARRY SET = OK The reason for using a jump table is that the contents of the monitor ROM can be altered without affecting these addresses meaning that programs utilizing these routines will not have to be changed. Example program Hello world utilizing routines in the MC3 monitor RETURN EQU $C000 RETURN TO PROMPT PDATA EQU $C009 PRINT TEXT STRING @ X ENDED BY $04 ORG $0100 0100 CE 0109 LDX #HELLOTX 0103 BD C009 JSR PDATA 0106 7E C000 JMP RETURN 0109 0D 0A HELLOTX FCB $0D,$0A 010B 48 65 6C 6C FCC "Hello World" 010F 6F 20 57 6F 0113 72 6C 64 0116 04 FCB $04 Download MC3 monitor 1.1 - source - listing - S19
by Les 2013-10-25 00:46 UTC
Hi, I found your page looking for some information on the 6800 tiny basic. I had found the KEYBD11 error as well, but had not found the NXTL12 error, thanks. MC6800 has always been a soft spot for me. I built my first 6800 computer in about 1983, and the current version has been in the making for many years. I had PCB's fabricated about 3 years ago, but just got around to building them. Too many projects I suppose. The current version has 2k of ROM(from a 27c256), and 512k of RAM. Any 2k page of the RAM can be mapped in between F000 F7FF. 0-EFFF is always RAM, F800 - FDFF is ROM, FE00 to FEEF is IO, and FF00 FFFF is ROM. There is an expansion buss connector that currently has a 2 port serial card now, but someday I might make a buss extender card so I can have a SD interface as well as the serial ports. I have created a front panel and most of the PCB is interface to the front panel. It is fun to see someone else doing this. I have 4 more PCB's for my design (minimum quantity was 5), I would be glad to mail you a set if you would like. In any case, I am having issues with the basic interpreter. I get a prompt, I can use the size command. I can enter a program and list / run it. The input function works, goto, gosub, pretty much everything. What doesn't work is anything which uses a constant. Any line with a constant gives varying errors like: READY #10 PRINT "AAA";123;"BBB" #RUN AAA 123BBB ERROR# 13 IN LINE 00010 Same thing from the prompt: #PRINT "Hello world" Hello world READY #PRINT 123 READY # Have you seen any issues like that? I did make the following change to allow lower case program entry: LOOP4 INX PUL A LDA B 0,X CMP B #$1E BEQ LOOP7 CMPA #"a" ; BCS Loop4a ; added code SUBA #20h ; Loop4a: CBA I look forward to hearing back from you, Les Hildenbrandt Windsor, Colorado, USA les@hildenbrandt.com


by Les 2013-10-25 00:47 UTC
I uploaded some schematics and pictures if you would like to see them http://www.lh1.org/6800/


by daniel 2013-10-28 07:02 UTC
Hi Les! Thank you for sharing your design. Nice work! It is really great to see other people working on 6800 systems. It makes me feel less alone :) I like your memory mapping design. It's a good idea to have I/O available regardless of what memory page is selected. I have to do a lot of bank switching in my system. I initially planned to include an SD interface as well but while playing around with a CF card I realized that a CF is easy to interface to the 6800 bus and is much faster than bit banging an SD card which was my plan of action. Since you use programmable logic in your design I suspect you will implement SPI in hardware for good performance! Regards, Daniel


Write a comment

Name

E-mail (not visible)

Comment


Code from above