Seems like you're making progress, but I still have the odd feeling that something else is causing issues.
If you consider the fact that the code has been proven to assemble/link and run correctly (including making the correct ROM images), then you can sorta narrow possible causes down:
- possible issue with assembly and linking - if you can use your software setup to successfully build the ROM images correctly, then that "should" validate your development software config.
- possible software issues between your SBC code RAM usage and the OSI Basic RAM usage - knowing exactly what RAM resources are using between the two.
- possible hardware issue... I know you're stating that it's working properly, but sometimes the problem doesn't show up until you start using more RAM, ROM, and software that exercises the system more.
When diagnosing odd system issues, it's nice to be able to use a known working configuration, be it hardware or software. An example is the Micromon code I wrote years ago. It's a very simple monitor that requires a CMOS CPU, a 6551 ACIA and minimal ROM and RAM to work.... bottom line, if this code doesn't work on a small 65C02 system, you have a hardware problem.
Taking a similar approach for running a Basic interpreter, I'll suggest the following:
Take my recent EnHanced Basic source file and make the required config changes to match your system. These include the following:
- change the console in and console out routines to your system. (character out and character in, but note that character in requires no waiting)
- change the page zero start if needed. It currently starts at $0000 and is contiguous in usage
- change the input buffer location if needed. It currently starts at $0500
- change the RAM start and Top of RAM locations if needed. Currently starts at $0800 and ends at $7FFF (RAM top is $8000)
- change the start address for the code in ROM if needed. Currently set for $B000
Here's the section of source code that contains the required parameters to run on any given system.
Code:
; Ibuffs can now be anywhere in RAM, ensure that the max length is < $80,
; the input buffer must not cross a page boundary and must not overlap with
; program RAM pages!
Ibuffs .EQU $0500 ; Start of input buffer
Ibuffe .EQU $0500+$7E ; end of input buffer (127 bytes)
ccflag .EQU Ibuffe+1 ; BASIC CTRL-C flag, 00 = enabled, 01 = dis
ccbyte .EQU ccflag+1 ; BASIC CTRL-C byte
ccnull .EQU ccbyte+1 ; BASIC CTRL-C byte timeout
VEC_CC .EQU ccnull+1 ; CTRL-C check vector
VEC_IN .EQU VEC_CC+2 ; input vector
VEC_OUT .EQU VEC_IN+2 ; output vector
VEC_LD .EQU VEC_OUT+2 ; load vector
VEC_SV .EQU VEC_LD+2 ; save vector
VEC_EXIT .EQU VEC_SV+2 ; exit vector
Ram_base .EQU $0800 ; start of user RAM (1st 2KB used/reserved)
Ram_top .EQU $8000 ; end of user RAM+1 ($8000 is start of ROM)
; Host system routine addresses are defined here for convienence.
; They provide the following functions required by EhBasic:
; CHRIN_NW - Character Input with no waiting - carry flag indicates data
; CHROUT - Character Output
; LOAD - Load data via Xmodem-CRC
; SAVE - Save data via Xmodem-CRC
; EXIT - Exit to warm start of C02 Monitor
B_CHRIN_NW .EQU $FF36
B_CHROUT .EQU $FF3C
M_LOAD .EQU $E015
M_SAVE .EQU $E012
M_EXIT .EQU $E003
; The start address can be changed, noting the BIOS/Monitor locations
.ORG $B000 ; Start of Basic in ROM
; C02Monitor starts at $E000
; C02BIOS starts at $F800
ROM_START
; BASIC cold start entry point
JMP BOOT_BASIC ; jump to Basic cold start routine
Note that you only need to handle the CHRIN_NW and CHROUT routines to get it working. Also, several other folks out here have had no issues getting this CMOS version of EhBasic working on their systems. The build size is just under 10KB. The source is setup for assembly and linking with WDC Tools (a free download).
It can't hurt to try... I'm happy to take your system parameters and build it for you if you like... I use S19 records by default.
Here's a link to my CMOS version:
viewtopic.php?f=5&t=5760&start=15#p76030