6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Apr 25, 2024 11:51 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: C02Monitor and C02BIOS
PostPosted: Fri Nov 20, 2015 12:38 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Well, after quite a while spending some late nights (sleepless nights at least) getting some much wanted coding done, I've got a first version of a small monitor that uses the BIOS I finished last year. All of the first required functions are completed and now it just needs some final testing to ensure it does everything it's suppose to (reliably). It fits in just under 3KB and uses the BIOS which fits in just under 768 bytes, less than 4KB in all. My 65C02 system uses page $FE for all I/O devices, which for now includes a 65C51 and 65C22. Below are the set of command functions in the Monitor:

C02Monitor 1.0 monitor commands:
- NOTES:
- A prompting Monitor - each field entry is completed with the "return" key vs a "space"
- All numeric value entries are validated during entry
- All numeric entries are in hex (field starts with a $ for prompting)
- Certain commands are prompted to continue (Zero RAM, Restart, Memory operations that perform a write)

A = {ACCUMULATOR} Examine/Edit the ACCUMULATOR preset/result register's contents
C = {COMPARE} Compare source to target address for a desired length, shows addresses that don't compare
D = {DUMP} Examine (in Hex/Ascii) the contents of 256 consecutive memory locations
E = {EXAMINE} Examine/Edit a memory location's contents
F = {FILL} Fill consecutive memory locations with a specified value
G = {GO} Begin program execution at a specified memory location
H = {LOCATE BYTE STRING} Search memory for a specified byte string (16 bytes max)
M = {MOVE} Copy a specified memory range to another memory location
P = {PROCESSOR} Examine/Edit the PROCESSOR STATUS preset/result register's contents
R = {REGISTERS} Examine the contents of ALL preset/result registers and Program Counter
S = {STACK POINTER} Examine/Edit the STACK POINTER preset/result register's contents
T = {LOCATE TEXT STRING} Search memory for a specified text string (16 characters max)
X = {X REGISTER} Examine/Edit the X REGISTER preset/result register's contents
Y = {Y REGISTER} Examine/Edit the Y REGISTER preset/result register's contents
[,] = {COMMA} Sets the Delay variables: MSDELAY and DELLO/DELHI (8-bit/16-bit)
[.] = {PERIOD} Performs a 1 millisecond delay times variable MSDELAY (1-256ms)
[/] = {SLASH} Performs the above delay the number of times in DELLO/DELHI (1-65536 times)
[\] = {BACKSLASH] Performas the above delay by 1-256 times
[(] = {NEW MACRO} Start new keystroke macro - limited to 127 bytes
[)] = {RUN MACRO} Run keystroke macro (last byte of 128 byte input buffer)
[ESC] = {ESCAPE} Terminate/exit command function
[CNTL-L] = Xmodem transfer - Uses Xmodem-CRC for download from termimal to memory (default $0800)
[CNTL-P] = Program EEPROM - note: source/target addresses not checked - be careful!
[CNTL-R] = {RESET} Restart C02Monitor
[CNTL-T] = Display System Uptime since Boot/Reset
[CNTL-V] = Display Monitor/BIOS Version
[CNTL-Z] = Zero all RAM and restart C02Monitor
[BREAK] = Send BREAK from console: Interrupt any current task then return control to CO2Monitor

One of the nice features (in my view) is the loader also "automagically" senses the Motorola S19 record format that is used by the WDC Toolsset. As a result, you can use the free WDC Tools to write and assemble code, then simply download it the board through the same console port and then run the program. The EEPROM program utility will allow writing insitu which pretty much allows you to add programs to the system with relative ease.

The monitor is not quite the norm however, as it prompts for entry fields, validates the values for proper range and also requires confirmation on destructive memory commands such as move and fill as well as reset and zero RAM. I'm still cleaning up the source and comments but hope to be able to post it within the next week or so. With the exception of page $FF, all of the code is easily relocatable for difference systems and both the BIOS and Monitor can be easily extended. Hopefully some of other forum members will be able to try it out on some of their home brew systems. All code requires a 65C02 an will not run on older 6502 processors. I've been running the code during development on 3 board sets, two at 4MHz for long term testing and one running at 10MHz which gets the EEPROM reprogrammed constantly. I'm using Atmel EEPROMs and they have been rock solid with hundreds of write cycles.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 22, 2015 3:39 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Well, I've done some final testing and appears to work well and as intended. I've also run the 65C51 at 115200 baud with Xmodem loader with a 4MHz CPU clock without error. I cleaned up the source quite a bit, found another 8 bytes to free up and have decided to share the code now. The zip file contains the source for the monitor (which includes BIOS) and a separate source file for the BIOS. It also contains the LIST file, S19 file (which I use to program the EEPROM), the WDC Tide file and the Quick reference. Using standard directories for WDC Tools, everything should assemble and link fine by placing the zip file under Projects and expanding it (directory is C02Monitor).

Default assembly for the Monitor is $F000 and is 3024 bytes. The BIOS is at $FC00 and is 760 bytes. The BIOS is split however, as my 65C02 setup uses page $FE for I/O. With the exception of page $FF, the rest of the code can be relocated. Page $FF contains the JUMP table (40 entries), all of the soft vector and soft HW config tables and base startup routines. The largest single function is the Xmodem/CRC loader which automagically supports the S19 record processing, 550 bytes of code.

Hope some forum users find it useful, it's been a fun project so far. It can also be used as a quick hardware test as it uses interrupt driven routines to support the 65C51 in full duplex mode, and both 65C22 timers. It also provides basic Port control for setup, input and output.

Now that I can write code in WDC tools and directly load to the board, it's a useful monitor coupled with the EEPROM program capability. I've tested Xmodem download using both ExtraPutty and TeraTerm. Next on the list is a disassembler, no idea when I'll get around to that.

Attachment:
C02Monitor.zip [92.76 KiB]
Downloaded 206 times

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: MSN [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: